LZ: Prog help
[Prev][Next][Index][Thread]
LZ: Prog help
-
Subject: LZ: Prog help
-
From: Frank <Jblaze77@msn.com>
-
Date: Tue, 24 Sep 96 01:45:59 UT
-
In-Reply-To: <>
After some suggestions i revised the program now i just get my exiting message
printed and the calc freezes...
Here is the new one... :
#include "ti-85.h"
.org 0
.db "By Frank Apap",0
Init:
ld a,4
out (5),a
ROM_CALL(CLEARLCD)
ld b,40 ; x start
ld c,30 ; y start
Start:
call GET_KEY ; get a key
cp $04 ; up ?
jr nz,nextkey
CALL_Z(up)
JUMP_(Start)
nextkey:
cp $01 ; down
CALL_Z(down)
cp $02 ; left?
CALL_Z(left)
cp $03 ; right
CALL_Z(left)
cp $37 ;exit
JUMP_(exit)
JUMP_(Start) ; loop
up:
inc b ; x=x+1
CALL_(PlotPixel) ; draw it
JUMP_(Start)
down:
dec b ; x=x-1
CALL_(PlotPixel)
JUMP_(Start)
right:
inc c ; y=y+1
CALL_(PlotPixel) ; draw it
JUMP_(Start) ; go back
left:
dec c ; y=y-1
CALL_(PlotPixel) ; draw it
JUMP_(Start) ; go back
PlotPixel:
ROM_CALL(FIND_PIXEL)
ld de,$FC00
add hl,de
or (HL)
ld (HL),a
JUMP_(Start)
exit:
ROM_CALL(CLEARLCD)
ld hl,$1A1A
ld ($8333), hl
ld hl, (PROGRAM_ADDR)
ld de,bye
add hl,de
ROM_CALL(D_ZM_STR)
ret z
bye:
.db "BYE THANKS FOR TESTING",0 ; this is what prints and then freezes
.end