A83: Re: ldir


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

A83: Re: ldir




It repeats the LDI instruction.  To the user (well, asm programmer), LDIR
appears as a single instruction.  But to the CPU, it's a repeated LDI (like
the repeated instructions on the x86).  An interrupt can occur _inside_ an
LDIR instruction, bewteen the LDI instructions.  I don't know exactly how it
handles it internally, but LDI sets the parity flag as odd when BC = 0, so
it might internally check it to know when to stop repeating.

>From the Assembly Studio 86 help file:

---
LDI Instruction
Load and Increment

Loads the value stored in the byte pointed to by HL into the byte pointed to
by DE, increments HL and DE, and decrements BC

(DE)=(HL)

HL=HL+1
DE=DE+1
BC=BC-1
---


> I don't understand the ldir command.
>
> load, increment, repeat.
>
> Repeat what?




References: