Re: LZ: Stupid Newbie Question: Why doesn't this work?


[Prev][Next][Index][Thread]

Re: LZ: Stupid Newbie Question: Why doesn't this work?



> I'm having a little trouble putting a number into HL, and trying to figure
> out how to display this number on the screen. I've tried this:
> 
> #include "ti-85.h"
> 
> org 0
> db "Numbers",0
> 

You have to set the correct rom-page here. You know, ti-85 has 128kb 
of rom, and only 32kb of it is visible to Z80 simultaneously. The 
CLEARLCD  routine is in the page 4. So we put  this here:

ld a,4
out (5),a   

>   ROM_CALL(CLEARLCD)
>   ld de,0
>   ld hl,1000
>   ld (CURSOR_ROW),de
>   dec hl
>   ROM_CALL(D_HL_DECI)
> 
> Loop:
>   call GET_KEY
>   cp K_EXIT
>   jr z,Loop
>   ret

You have an error here. Replace it with:
Loop:
 call GET_KEY
 cp K_EXIT
 jr nz,Loop   ; = jump if key NOT pressed 

> 
> end


Follow-Ups: References: