Samsung KS57C2308 Manual page 124

Single-chip cmos microcontroller
Table of Contents

Advertisement

SAM47 INSTRUCTION SET
DECS
— Decrement and Skip on Borrow
DECS
dst
Operation:
Operand
R
RR
Description:
The destination is decremented by one. An original value of 00H will underflow to 0FFH. If a
borrow occurs, a skip is executed. The carry flag value is unaffected.
Operand
R
RR
Examples:
1. Register pair HL contains the value 7FH (01111111B). The following instruction leaves the
value 7EH in register pair HL:
DECS HL
2. Register A contains the value 0H. The following instruction sequence leaves the value 0FFH
in register A. Since a "borrow" occurs, the "CALL PLAY1" instruction is skipped and the "CALL
PLAY2" instruction is executed:
DECS A
CALL
CALL
5-50
Operation Summary
Decrement register (R); skip on borrow
Decrement register pair (RR); skip on borrow
Binary Code
0
1
0
1
1
0
1
1
0
PLAY1
PLAY2
0
1
r2
r1
r0
1
1
1
0
0
1
1
r2
r1
0
; "Borrow" occurs
; Skipped
; Executed
KS57C2308/P2308/C2316/P2316
Bytes
1
2
Operation Notation
R
R–1; skip on borrow
RR
RR–1; skip on borrow
Cycles
1 + S
2 + S

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

P2308C2316P2316Ks57p2308Ks57c2316Ks57p2316

Table of Contents