DatasheetQ Logo
Electronic component search and free download site. Transistors,MosFET ,Diode,Integrated circuits

UPSD3212A(2009) Просмотр технического описания (PDF) - STMicroelectronics

Номер в каталоге
Компоненты Описание
производитель
UPSD3212A Datasheet PDF : 181 Pages
First Prev 21 22 23 24 25 26 27 28 29 30 Next Last
Architecture overview
UPSD3212A, UPSD3212C, UPSD3212CV
After the routine has been executed, the Accumulator contains the two digits that were
shifted out on the right. Doing the routine with direct MOVs uses 14 code bytes. The same
operation with XCHs uses only 9 bytes and executes almost twice as fast. To right-shift by
an odd number of digits, a one-digit must be executed. Table 9 shows a sample of code that
will right-shift a BCD number one digit, using the XCHD instruction. Again, the contents of
the registers holding the number and of the accumulator are shown alongside each
instruction.
Table 6. Data transfer instructions that access internal data memory space
Mnemonic
Operation
Addressing modes
Dir.
Ind.
Reg.
Imm.
MOV A,<src>
A = <src>
X
X
X
X
MOV <dest>,A
<dest> = A
X
X
X
MOV <dest>,<src>
<dest> = <src>
X
X
X
X
MOV DPTR,#data16
DPTR = 16-bit immediate
constant
X
PUSH <src>
INC SP; MOV “@SP”,<src>
X
POP <dest>
MOV <dest>,”@SP”; DEC SP
X
XCH A,<byte>
Exchange contents of A and
<byte>
X
X
X
XCHD A,@Ri
Exchange low nibbles of A and
@Ri
X
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, location 2EH, holding the last two
digits of the shifted number. The pointers are decremented, and the loop is repeated for
location 2DH. The CJNE instruction (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 originally shifted out on the right has propagated to
location 2AH. Since that location should be left with 0s, the lost digit is moved to the
Accumulator.
Table 7.
MOV
MOV
MOV
MOV
MOV
Shifting a BCD number 2 digits to the right (using direct MOVs: 14 bytes)
2A
2B
2C
2D
2E
ACC
A,2Eh
00
12
34
56
78
78
2Eh,2Dh
2Dh,2Ch
2Ch,2Bh
00
12
34
56
56
78
00
12
34
34
56
78
00
12
12
34
56
78
2Bh,#0
00
00
12
34
56
78
26/181

Share Link: 

datasheetq.com  [ Privacy Policy ]Request Datasheet ] [ Contact Us ]