Re: LZ: my proggy...


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

Re: LZ: my proggy...



MiKe kRiSToPeiT wrote:
> 
> I made this ripping code from a lot of other programs... so if you
> look at it and say "HEY, I WROTE THIS!!" I am sorry... I just learned
> Z80 in the past week... I tried to make something that just prints a
> number, then incs it and reprints...
> I just wanted to see how fast it could count... well, I compiled it,
> no errors, but when I run it in zshell, it starts to load, but then the
> zshell menu scrolls again (this happens VERY quickly...)
> first though... I accidentally added a ret z somewhere, but I couldn't
> see anything... any help would be appreciated.
> I will just paste it on the message...
> 

comments will explain some things...

> #INCLUDE "TI-85.H"
> 
> .org 0
> .db "Counter thingy", 0
> 
> Number = $8100
> numTxt = $8101
> 
>         ld a, 1
>         ld (Number),a
> Loop:
>         ld a, (Number)
>         inc a
>         ld (Number),a
>         CALL_(Drawnum)
>         ROM_CALL(GET_KEY)	;this is just a "call GET_KEY"
>         cp $37		;that's probably the worst problem
>         jr NZ, Loop
>         ret z
> 
> Drawnum:
>         ld hl, (Number)	;up at the top, (number) was defined 				;as one byte
>         ld a, $67
>         ld (CURSOR_X), a
>         ld a, $07
>         ld (CURSOR_Y), a
>         CALL_(PrintNumber)
>         ret
> PrintNumber:
>         ld de, numTxt+4	;since it was one byte, some of this 				;stuff oyu odn't need
>         ld b, $05
> PrintNumber2:
>         call UNPACK_HL
>         add a, '0'
>         ld (de), a
>         dec de
>         djnz PrintNumber2
>         ld hl, numTxt
>         ld b, $05
>         res 3, (iy+5)
>         ROM_CALL(D_LM_STR)
>         ret
> 
> .end
> 
> WHAT IS WRONG WITH THIS?!!!
> 
> Mike Kristopeit

-- 
Compliments of:
_-_-_-_-_-_-_-_
  Alan Bailey
  mailto:bailala@mw.sisna.com
  IRC:Abalone
  Web:http://www.mw.sisna.com/users/bailala/home.htm


References: