Hello again everyone!
I'm going through Hot Dog's tutorial on asm right now and I have encountered a slight problem. Working with variables, ld doesn't want to set a register. In the snippet below, the first line will work but the second one will not. Is there something I skipped over accidentally?
ld a, (var1)
ld b, (var1)
The error spasm outputs:
Pass one...
learn2.asm:7: warning: Suggest remove extra parentheses around argument
Pass two...
learn2.asm:7: warning: Number is too large to fit in 8 bits, truncating
Done
Here is the code
;Multiplication program
#include "ti83plus.inc"
.org $9d93
.db t2ByteTok, tAsmCmp
B_CALL _ClrLCDFull
ld a, (Mula) ;Holds the answer
ld b, (Mulb) ;How many times to multiply
ld c, a ;What to add every time it multiplies, or else it will do powers
BeginLoop:
add a, c
djnz BeginLoop ;Remember that the b is decresed before it checks
ld h, 0
ld l, a
B_CALL _DispHL
ret
Mula:
.db 5
Mulb:
.db 5
Thanks!
Edit:
Found the answer! For those who look at this in the future, you can only use register a to retrieve data. You need to store the memory address in hl for other registers.