UPSD3234AV-24U1T STMicroelectronics, UPSD3234AV-24U1T Datasheet - Page 21

no-image

UPSD3234AV-24U1T

Manufacturer Part Number
UPSD3234AV-24U1T
Description
Flash Programmable System Devices with 8032 Microcontroller Core and 64Kbit SRAM
Manufacturer
STMicroelectronics
Datasheet
www.DataSheet4U.com
First, pointers R1 and R0 are set up to point to the
two bytes containing the last four BCD digits. Then
a loop is executed which leaves the last byte, loca-
tion 2EH, holding the last two digits of the shifted
number. The pointers are decremented, and the
loop is repeated for location 2DH. The CJNE in-
struction (Compare and Jump if Not equal) is a
loop control that will be described later. The loop
executed from LOOP to CJNE for R1 = 2EH, 2DH,
2CH, and 2BH. At that point the digit that was orig-
inally shifted out on the right has propagated to lo-
cation 2AH. Since that location should be left with
0s, the lost digit is moved to the Accumulator.
Table 9. Shifting a BCD Number One Digit to the Right
LOOP:
MOV
MOV
; loop for R1 = 2Eh
MOV
XCHD
SWAP
MOV
DEC
DEC
CNJE
; loop for R1 = 2Dh
; loop for R1 = 2Ch
; loop for R1 = 2Bh
CLR
XCH
R1,#2Eh
R0,#2Dh
A,@R1
A,@R0
A
@R1,A
R1
R0
R1,#2Ah,LOOP
A
A,2Ah
uPSD3234A, uPSD3234BV, uPSD3233B, uPSD3233BV
2A
00
00
00
00
00
00
00
00
00
00
00
08
08
00
Table 7. Shifting a BCD Number Two Digits to
the Right (using direct MOVs: 14 bytes)
Table 8. Shifting a BCD Number Two Digits to
the Right (using direct XCHs: 9 bytes)
MOV
MOV
MOV
MOV
MOV
CLR
XCH
XCH
XCH
XCH
A,2Eh
2Eh,2Dh
2Dh,2Ch
2Ch,2Bh
2Bh,#0
A
A,2Bh
A,2Ch
A,2Dh
A,2Eh
2B
12
12
12
12
12
12
12
12
12
12
18
01
01
01
2C
34
34
34
34
34
34
34
34
34
38
23
23
23
23
2A
2A
00
00
00
00
00
00
00
00
00
00
2B
12
12
12
12
00
2B
12
00
00
00
00
2D
56
56
56
58
58
58
58
58
58
45
45
45
45
45
2C
34
34
34
12
12
2C
34
34
12
12
12
2D
56
56
34
34
34
2D
56
56
56
34
34
2E
78
78
78
78
78
67
67
67
67
67
67
67
67
67
2E
78
56
56
56
56
2E
78
78
78
78
56
ACC
78
76
67
67
67
67
67
45
23
01
00
08
21/170
xx
xx
ACC
ACC
78
78
78
78
78
00
12
34
56
78

Related parts for UPSD3234AV-24U1T