A82: Fw: Copying HL -> DE skipping bytes
[Prev][Next][Index][Thread]
A82: Fw: Copying HL -> DE skipping bytes
----- Original Message -----
From: Dines Justesen <dines@resnet.gatech.edu>
To: <assembly-82@lists.ticalc.org>
Sent: Tuesday, January 19, 1999 11:07 AM
Subject: Re: Copying HL -> DE skipping bytes
>I think this works:
>
>LD HL,TEXT_MEM
>LD DE,APD_BUF
>LD BC,44
>LOOP:
>LDI ; Copy one byte, HL+1, DE+1, BC-1
>INC DE ; No effects on flags
>JP PE,LOOP ; Check P/V
>
>Dines
>----- Original Message -----
>From: Evil Sam <evil_sam@hotmail.com>
>To: <assembly-82@lists.ticalc.org>
>Sent: Monday, January 18, 1999 11:17 PM
>Subject: A82: Copying HL -> DE skipping bytes
>
>
>>
>> I want to copy HL to DE skipping every other byte of DE. I tried
>>something like this:
>> ld hl,TEXT_MEM
>> ld de,APD_BUF
>> ld a,44
>>loop:
>> ld bc,1
>> ldir
>> inc de
>> dec a
>> jr nz,loop
>>
>> That didn't work. So I tried something like this:
>> ld hl,TEXT_MEM
>> ld de,APD_BUF
>> ld b,44
>>loop:
>> ld a,(hl)
>> ld (de),a
>> inc hl
>> inc de
>> inc de
>> djnz loop
>>
>> Also didn't work. What am I doing wrong?
>>
>>______________________________________________________
>>Get Your Private, Free Email at http://www.hotmail.com
>>
>>
>