Make your own free website on Tripod.com

LDIR

Repeating block load with increment.
Function: (DE) <- (HL); DE <- DE + 1; HL <- HL + 1; BC <- BC - 1
Repeat until BC = 0
 
Format:
1110 1101
 
byte 1: ED
 
1011 0000
 
byte 2: B0
 
Description: The contents of the memory location addressed by HL are loaded into the memory location addressed by DE. Then both DE, and HL are incremented. BC is decremented. If B != 0, then the program counter is decremented by 2 and the instruction re-executed.
 
Data Flow:
 
Timing: B != 0: 5 M cycles; 21 T states: 10.5 usec @ 2 MHz
B = 0: 4 M cycles; 16 T states: 8 usec @ 2 MHz
 
Addressing Mode: indirect
 
Flags:
 
Example:
LDIR

OBJECT CODE
Before:
 
After: