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


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

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




At 19:49 1998-07-26 -0700, you wrote:
>
>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

*sigh*

then just follow that stuff above with:

	ld	hl,start
	ld	bc,768
loop
	ld	(hl),0
	inc	hl
	dec	bc
	jp	NZ,loop


how hard can it be? think some.. please...

or take it in the same loop:

	ld	hl,start
	ld	bc,768
	ld	de,moveto
loop
	ld	A,(HL)		;load data
	ld	(hl),0		;erase
	ld	(DE),A		;put it at the new place..
	inc	hl
	inc	de		;increase pointers
	dec	bc		;decrease loopcounter..
	jp	NZ,loop

//Olle


References: