KS57C2308/P2308/C2316/P2316
SAM47 INSTRUCTION SET
5-65
LDB
— Load Bit
LDB
(Continued)
Examples:
1. The carry flag is set and the data value at input pin P1.0 is logic zero. The following instruction
clears the carry flag to logic zero.
LDB
C,P1.0
2. The P1 address is FF1H and the L register contains the value 9H (1001B). The address
(memb.7–2) is 111100B and (L.3–2) is 10B. The resulting address is 11110010B or FF2H and
P2 is addressed. The bit value (L.1–0) is specified as 01B (bit 1).
LD
L,#9H
LDB
C,P1.@L
; P1.@L specifies P2.1 and C
←
P2.1
3. The H register contains the value 2H and FLAG = 20H.3. The address for H is 0010B and for
FLAG(3–0) the address is 0000B. The resulting address is 00100000B or 20H. The bit value is
3. Therefore, @H+FLAG = 20H.3.
FLAG
EQU 20H.3
LD
H,#2H
LDB
C,@H+FLAG
; C
←
FLAG (20H.3)
4. The following instruction sequence sets the carry flag and the loads the "1" data value to the
output pin P2.0, setting it to output mode:
SCF
; C
←
"1"
LDB
P2.0,C
; P2.0
←
"1"
5. The P1 address is FF1H and L = 9H (1001B). The address (memb.7–2) is 111100B and (L.3–
2) is 10B. The resulting address, 11110010B specifies P2. The bit value (L.1–0) is specified as
01B (bit 1). Therefore, P1.@L = P2.1.
SCF
; C
←
"1"
LD
L,#9H
LDB
P1.@L,C
; P1.@L specifies P2.1
; P2.1
←
"1"
6. In this example, H = 2H and FLAG = 20H.3 and the address 20H is specified. Since the bit
value is 3, @H+FLAG = 20H.3:
FLAG
EQU 20H.3
RCF
; C
←
"0"
LD
H,#2H
LDB
@H+FLAG,C
; FLAG(20H.3)
←
"0"
NOTE
: Port pin names used in examples 4 and 5 may vary with different SAM47 devices.
Summary of Contents for C2316
Page 30: ...ADDRESS SPACES KS57C2308 P2308 C2316 P2316 2 22 NOTES ...
Page 168: ...SAM47 INSTRUCTION SET KS57C2308 P2308 C2316 P2316 5 94 NOTES ...
Page 170: ......
Page 206: ...POWER DOWN KS57C2308 P2308 C2316 P2316 8 8 NOTES ...
Page 210: ...RESET KS57C2308 P2308 C2316 P2316 9 4 NOTES ...
Page 222: ...I O PORTS KS57C2308 P2308 C2316 P2316 10 12 NOTES ...
Page 272: ...LCD CONTROLLER DRIVER KS57C2308 P2308 C2316 P2316 12 24 NOTES ...
Page 280: ...SERIAL I O INTERFACE KS57C2308 P2308 C2316 P2316 13 8 NOTES ...
Page 294: ...MECHANICAL DATA KS57C2308 P2308 C2316 P2316 15 2 NOTES ...
Page 310: ...KS57P2308 P2316 OTP KS57C2308 P2308 C2316 P2316 16 16 NOTES ...
Page 318: ......
Page 320: ......
Page 322: ......
Page 325: ......
Page 327: ......