Calculator Community > ASM

Number too large to fit?

(1/1)

Yeong:
So I have this.


--- Code: ---#include "ti83plus.inc"
.org $9D93
.db t2ByteTok, tAsmCmp
bcall(_ClrLCDFull)
bcall(_getKey)
ld (Keystore),a
ld a,0
ld (curCol),a
ld (curRow),a
ld hl,Hello
bcall(_PutS)
ld a,1
ld (curRow),a
ld a,Keystore
ld h,0
ld l,a
bcall(_DispHL)
bcall(_getKey)
bcall(_ClrLCDFull)

ret
Hello:
.db "You pressed",0
Keystore:
.db 0
--- End code ---

The compiler throws a warning at "ld a,Keystore" part, saying that the number is too big for 8-bit and is being truncated.
What am I doing wrong here?

Xeda112358:
You need to do ld a,(Keystore). The way you currently have it, you are trying to store the pointer, Keystore, to the 8-bit register A, but pointers are 16-bit for the Z80. By using (Keystore) instead, you are loading the byte at keystone.

Yeong:
Oof, just when I thought that I was no longer confusing (pointer) and pointer, I had it backwards.
The program worked as intended after the parenthesis. Thanks.

Navigation

[0] Message Index

Go to full version