Updated the Parser to try and give 'AddressParameter's more meaning depending on the SymbolType.

This commit is contained in:
2022-10-08 18:21:11 -05:00
parent 48a77950be
commit fd44e03b1b
4 changed files with 48 additions and 8 deletions
+3 -1
View File
@@ -1,5 +1,7 @@
.db video_start 0xF37F
.db msg "Hello, world!", 0
.db NOTERM "No terminating byte here"
.db null_byte 0
load r1, [msg] ; Because the lod* instructions can't load an address
; from anything but a register, this becomes laa r1, [msg]
@@ -11,7 +13,7 @@ load r1, [msg] ; Because the lod* instructions can't load an address
string_length:
loadb r3, [r1] ; Load the byte from the address in R1, into R3
load r2, 0 ; String length
cmp r3, 0 ; Is R3 a null byte?
cmp r3, null_byte ; Is R3 a null byte?
je end
inc r2