Re: LZ: my test results


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

Re: LZ: my test results



Peter Cordes wrote:
> 
> Here is the Assembler version of the same program: File Name is:
> abcdefgh


You can make the ZShell program much shorter like this:


.org 0
.db " ",0


 ROM_CALL(CLEARLCD)
GetKey:
 call GET_KEY
 cp $37
 ret z
 or a
 jr z,GetKey
 cp $05
 jr nc,GetKey
 dec a
 ld hl,0
 ld ($800C),hl
 ld l,a
 sla l
 ld d,0
 ld e,l
 sla e
 add hl,de
 ld de,Text
 add hl,de
 ld de,(PROGRAM_ADDR)
 add hl,de
 ROM_CALL(D_ZT_STR)
 jr GetKey


Text:
 .db "DOWN ",0,"LEFT ",0,"RIGHT",0,"UP   ",0




About 75 byte I think...


<pre>
-- 
Real name: Jimmy Mårdell
Email....: mailto:mja@algonet.se
IRC-name.: Yarin
WWW......: http://www.algonet.se/~mja


"If anything can go wrong, it will
 if it can't, it will anyway"


"I was worth the best, and nothing but the best,
 so when I gave myself a present, it was me" - Cat rapes dog
</pre>


References: