.endmacro
.macro LoadW dest, value
- LoadB dest+1, >value
- LoadB dest+0, <value
+ LoadB dest+1, >(value)
+ LoadB dest+0, <(value)
.endmacro
.macro MoveB source, dest
.macro AddVB value, dest
lda dest
clc
- adc #value
+ adc #(value)
sta dest
.endmacro
.macro AddVW value, dest
.local Skip
- clc
- lda #<value
- adc dest+0
- sta dest+0
- .if (>value)=0
+ AddVB <(value), dest+0
+ .if (>(value))=0
bcc Skip
inc dest+1
.else
- lda #>value
+ lda #>(value)
adc dest+1
sta dest+1
.endif
.macro SubVW value, dest
sec
lda dest+0
- sbc #<value
+ sbc #<(value)
sta dest+0
lda dest+1
- sbc #>value
+ sbc #>(value)
sta dest+1
.endmacro
.macro CmpBI source, immed
lda source
- cmp #immed
+ cmp #(immed)
.endmacro
.macro CmpW source, dest
.macro CmpWI source, immed
.local Skip
- CmpBI source+1, >immed
+ CmpBI source+1, >(immed)
bne Skip
- CmpBI source+0, <immed
+ CmpBI source+0, <(immed)
Skip:
.endmacro
.macro addv value
clc
- adc #value
+ adc #(value)
.endmacro
.macro subv value
sec
- sbc #value
+ sbc #(value)
.endmacro
.macro bnex addr