[Prev][Next][Index][Thread]
Re: A85: Vars
I wrote this really quick to test variable stuff, but it doesn't work. It is
designed to show each of the variables in past the "Variable" Label in
sequence. It should show zero for the third nuber, and then 255 for the
fourth. After assembling it (usgard, which would explain the usgard.h file) I
ran it, but it gave me odd numbers. I don't know if it is just an error like
with the "ld h,0 / ld l,a" or what, but could someone please help. (sorry if
I sound like an idiot to those of you who know what you are doing :-) , but
i'm just trying to figure out how this works) thanxx again. Here's the
source:
#include "usgard.h"
.org 0
.db "Variable Test",0
call CLEARLCD
ld a,(Variables)
call &Bob
ld a,(Variables+1)
call &Bob
ld a,(Variables+2)
call &Bob
ld hl,&Variables+2
ld (hl),255
ld a,(Variables+2)
call &Bob
ld a,(Variables+3)
call &Bob
ld a,(Variables+4)
call &Bob
ret
Bob:
ld hl,0
ld ($800C),hl
ld h,0
ld l,a
call D_HL_DECI
Wait:
call GET_KEY
cp K_ENTER
jr nz,Wait
call CLEARLCD
ret
Variables:
.db 242,5,0,3,2,111
.end
Follow-Ups: