[A83] Re: ldir
[Prev][Next][Index][Thread]
[A83] Re: ldir
DJNZ Loops can be smaller if you need to init <= 256 bytes.
ld b,0
ld hl,mem
DJNZ_LOOP:
ld (hl),0
inc hl
djnz DJNZ_LOOP
10 bytes I believe. (this clears 256 bytes of ram)
Compared to:
ld hl,mem
ld de,mem+1
ld bc,256
ld (hl),0
ldir
13 bytes here... but faster.
Sorry if my byte totals are off...
>From: SOCCERK121@aol.com
>Reply-To: assembly-83@lists.ticalc.org
>To: assembly-83@lists.ticalc.org
>Subject: [A83] Re: ldir
>Date: Wed, 11 Apr 2001 01:22:24 EDT
>
>
>Whoa, good idea, now i dont have to waste a lot of mem with djnz routines!
>
>Thanks!
>
><< ldir can also be used to clear memory: (this clears the back buffer)
>
> ld hl,plotsscreen
> ld de,plotsscreen+1
> ld bc,767
> ld (hl),0
> ldir >>
>
>
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com