KS57C2308/P2308/C2316/P2316

SAM47 INSTRUCTION SET

 

 

LDI — Load Data Memory and Increment

LDI Operation:

dst,src

Operand

Operation Summary

Bytes

Cycles

 

 

 

 

A,@HL

Load indirect data memory to A; increment register L

1

2 + S

 

contents and skip on overflow

 

 

 

 

 

 

Description: The contents of a data memory location are loaded into the accumulator, and the contents of the register L are incremented by one. If an overflow occurs (e.g., if the resulting value in register L is 0H), the next instruction is skipped. The contents of data memory and the carry flag value are not affected.

Operand

 

 

Binary Code

 

 

Operation Notation

 

 

 

 

 

 

 

 

 

 

A,@HL

1

0

0

0

1

0

1

0

A (HL), then L L+1;

 

 

 

 

 

 

 

 

 

skip if L = 0H

 

 

 

 

 

 

 

 

 

 

Example: Assume that register pair HL contains the address 2FH and internal RAM location 2FH contains the value 0FH:

LD

HL,#2FH

 

 

LDI

A,@HL

;

A (HL) and L L+1

JPS

XXX

;

Skip

JPS

YYY

;

H 2H and L 0H

The instruction “JPS XXX” is skipped since an overflow occurred after the “LDI A,@HL” and the instruction “JPS YYY” is executed.

5-69

Page 143
Image 143
Samsung KS57C2308 manual LDI Load Data Memory and Increment, LDI Operation, HL,#2FH LDI @HL