Samsung KS57C2308 Manual page 165

Single-chip cmos microcontroller
Table of Contents

Advertisement

KS57C2308/P2308/C2316/P2316
XCHD
— Exchange and Decrement
XCHD
dst,src
Operation:
Operand
A,@HL
Description:
The instruction XCHD exchanges the contents of the accumulator with the RAM location
addressed by register pair HL and then decrements the contents of register L. If the content of
register L is 0FH, the next instruction is skipped. The value of the carry flag is not affected.
Operand
A,@HL
Example:
Register pair HL contains the address 20H and internal RAM location 20H contains the value
0FH:
YYY
The "JPS YYY" instruction is executed since a skip occurs after the XCHD instruction.
Operation Summary
Exchange A and data memory contents; decrement
contents of register L and skip on borrow
Binary Code
0
1
1
LD
HL,#20H
LD
A,#0H
XCHD
A,@HL
JPS
XXX
JPS
YYY
XCHD
A,@HL
1
1
0
1
1
; A
0FH and L
; Skipped since a borrow occurred
; H
2H, L
0FH
; (2FH)
0FH, A
SAM47 INSTRUCTION SET
Bytes
1
Operation Notation
A
(HL), then L
L–1;
skip if L = 0FH
L – 1, (HL)
"0"
(2FH), L
L – 1 = 0EH
Cycles
2 + S
5-91

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

P2308C2316P2316Ks57p2308Ks57c2316Ks57p2316

Table of Contents