LZ: my new prog
[Prev][Next][Index][Thread]
LZ: my new prog
-
Subject: LZ: my new prog
-
From: Frank <Jblaze77@msn.com>
-
Date: Mon, 23 Sep 96 23:35:29 UT
-
In-Reply-To: <>
Hey was up i am new to zshell programming.. i tried to make a program that
would draw pixels corresponding to the keys pressed... (like etch a
sketch).... here it is... it dont work.... if someone can help let me know
(jblaze77@msn.com)...
> #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 ?
> CALL_(up)
> cp $01 ; down?
> CALL_(down)
> cp $02 ; left?
> CALL_(left)
> cp $03 ; right
> CALL_(left)
> cp $37 ;exit
> CALL_(exit)
> JUMP_(Start) ; loop
> up:
> inc b ; x=x+1
> CALL_(PlotPixel) ; draw it
> ret
> down:
> dec b ; x=x-1
> CALL_(PlotPixel)
> ret
> right:
> inc c ; y=y+1
> CALL_(PlotPixel) ; draw it
> ret ; go back
> left:
> dec c ; y=y-1
> CALL_(PlotPixel) ; draw it
> ret ; go back
> PlotPixel:
> ROM_CALL(FIND_PIXEL)
> ld de,$FC00
> add hl,de
> or (HL)
> ld (HL),a
> ret
> 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
> .end
Follow-Ups: