Re: A83: A routine to move data...


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

Re: A83: A routine to move data...




Yea it would work but it doesn't **delete** the old data!!!

Revenant wrote:

> Why not just do this?
>
>    ld hl,start                  ;Start of data
>
>    ld de,moveto                 ;Where to put it
>
>    ld bc,768                    ;Bytes to copy
>
>    ldir                         ;Copy bytes
>
> Revenant
>
> >
> >Does this work??
> >
> >SOURCE:
> >;MOVEIT.Z80
> >;by: Chris Watford
> >;copying data plus deleting the old data
> >;usage: moving data
> >
> >;input:
> >;bc= Start of old data
> >;de= End of old data
> >;hl= Where to put it
> >
> >start:
> > push bc
> > push de
> > push hl
> >;I am getting the lenght of data
> > ld hl,de-bc
> > ld (statvars),hl
> >;statvars now contains the length of the data
> > pop hl
> > pop de
> > pop bc
> > ld de,(statvars)
> > ld (statvars+2),0
> >loop:
> > sub (statvars),(statvars+2) ;is the operation done??
> > jp z,the_end
> > ld (hl),(bc) ;copy old data
> > ld (bc),0000h ;delete old data
> > inc (statvars+2) ;increment the counter
> > inc (bc)  ;
> > inc (bc)  ;move to the next mem location
> > jp loop  ;lets do more deleting and moving
> >the_end:
> > ret
> >
> >
> >
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com




Follow-Ups: References: