Samsung KS57C2308 Manual page 115

Single-chip cmos microcontroller
Table of Contents

Advertisement

KS57C2308/P2308/C2316/P2316
BTSTZ
— Bit Test and Skip on True; Clear Bit
BTSTZ
dst.b
Operation:
Operand
mema.b
memb.@L
@H+DA.b
Description:
The specified bit within the destination operand is tested. If it is a "1", the instruction immediately
following the BTSTZ instruction is skipped; otherwise the instruction following the BTSTZ is
executed. The destination bit value is cleared.
Operand
mema.b
memb.@L
@H+DA.b
*
mema.b
Examples:
1. Port pin P2.0 is toggled by checking the P2.0 value (level):
2. For toggling port pins P2.2, P2.3 and P3.0–P3.3:
BP2
Test specified bit; skip and clear if memory bit is set
Binary Code
1
1
1
*
1
1
1
0
1
0
1
1
1
0
0
b1
Second Byte
1
0
b1
1
1
b1
BTSTZ
P2.0
BITS
P2.0
JP
LABEL3
LD
L,#0AH
BTSTZ
P1.@L
BITS
P1,@L
INCS
L
JR
BP2
Operation Summary
1
1
1
0
1
1
1
0
0
a5
a4
a3
a2
1
1
1
0
b0
a3
a2
a1
a0
b0
a3
a2
a1
a0 FB0H–FBFH
b0
a3
a2
a1
a0 FF0H–FFFH
; If P2.0 = "1", then P2.0
; If P2.0 = "0", then P2.0
; First, P1.@0AH = P2.2
; (111100B) + 10B.10B = 0F2H.2
SAM47 INSTRUCTION SET
Bytes
2
2
2
Operation Notation
1
Skip if mema.b = 1 and clear
1
Skip if [memb.7–2 + L.3–2].
[L.1–0] = 1 and clear
1
Skip if [H + DA.3–0].b =1 and clear
Bit Addresses
"0" and skip
"1"
Cycles
2 + S
2 + S
2 + S
5-41

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

P2308C2316P2316Ks57p2308Ks57c2316Ks57p2316

Table of Contents