S3C84E5/C84E9/P84E9

INSTRUCTION SET

 

 

LDCI/LDEI — Load Memory and Increment

LDCI

dst,src

LDEI

dst,src

Operation:

dst src

 

rr rr + 1

 

These instructions are used for user stacks or block transfers of data from program or data memory

 

to the register file. The address of the memory location is specified by a working register pair. The

 

contents of the source location are loaded into the destination location. The memory address is then

 

incremented automatically. The contents of the source are unaffected.

 

LDCI refers to program memory and LDEI refers to external data memory. The assembler makes

 

"Irr" an even number for program memory and an odd number for data memory.

Flags: No flags are affected.

Format:

opc

dst src

 

 

Bytes

Cycles

Opcode

Addr Mode

 

 

(Hex)

dst

src

2

10

E3

r

Irr

Examples: Given: R6 = 10H, R7 = 33H, R8 = 12H, program memory locations 1033H = 0CDH and

1034H = 0C5H; external data memory locations 1033H = 0DDH and 1034H = 0D5H:

LDCI

R8,@RR6

;

0CDH (contents of program memory location 1033H) is

 

 

 

loaded

 

 

; into R8 and RR6 is incremented by one

 

 

 

(RR6 RR6 + 1);

 

 

;

R8 = 0CDH, R6 = 10H, R7 = 34H

LDEI

R8,@RR6

;

0DDH (contents of data memory location 1033H) is

 

 

 

loaded

 

 

; into R8 and RR6 is incremented by one

 

 

 

(RR6 RR6 + 1);

 

 

;

R8 = 0DDH, R6 = 10H, R7 = 34H

NOTE:LDEI instruction can be used to read/write the data of 64-Kbyte data memory.

6-55

Page 182
Image 182
Samsung S3C84E5 user manual LDCI/LDEI Load Memory and Increment, Ldci, Ldei, Rr ← rr +