UPSD3254 STMICROELECTRONICS [STMicroelectronics], UPSD3254 Datasheet - Page 28

no-image

UPSD3254

Manufacturer Part Number
UPSD3254
Description
Flash Programmable System Devices with 8032 Microcontroller Core
Manufacturer
STMICROELECTRONICS [STMicroelectronics]
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
UPSD3254A-24U6
Manufacturer:
ST
0
Part Number:
UPSD3254A-40T6
Manufacturer:
STMicroelectronics
Quantity:
10 000
Part Number:
UPSD3254A-40U6
Manufacturer:
STMicroelectronics
Quantity:
10 000
Part Number:
UPSD3254A-40U6
Manufacturer:
ST
Quantity:
20 000
Part Number:
UPSD3254B-24U6
Manufacturer:
ST
0
Part Number:
UPSD3254BV-24U6
Manufacturer:
ST
Quantity:
3 100
Part Number:
UPSD3254BV-24U6
Manufacturer:
ST
Quantity:
875
Part Number:
UPSD3254BV-24U6
Manufacturer:
STMicroelectronics
Quantity:
10 000
Part Number:
UPSD3254BV-24U6
Manufacturer:
ST
Quantity:
20 000
Part Number:
UPSD3254BV-40U6
Manufacturer:
ST
Quantity:
200
UPSD3254A, UPSD3254BV, UPSD3253B, UPSD3253BV
Boolean Instructions
The uPSD325X devices contain a complete Bool-
ean (single-bit) processor. One page of the inter-
nal RAM contains 128 address-able bits, and the
SFR space can support up to 128 addressable bits
as well. All of the port lines are bit-addressable,
and each one can be treated as a separate single-
bit port. The instructions that access these bits are
not just conditional branches, but a complete
menu of move, set, clear, complement, OR and
AND instructions. These kinds of bit operations
are not easily obtained in other architectures with
any amount of byte-oriented software.
The instruction set for the Boolean processor is
shown in Table 12. All bits accesses are by direct
addressing.
Bit addresses 00h through 7Fh are in the Lower
128, and bit ad-dresses 80h through FFh are in
SFR space.
Note how easily an internal flag can be moved to
a port pin:
In this example, FLAG is the name of any addres-
sable bit in the Lower 128 or SFR space. An I/O
line (the LSB of Port 1, in this case) is set or
cleared depending on whether the Flag Bit is '1' or
'0.'
The Carry Bit in the PSW is used as the single-bit
Accumulator of the Boolean processor. Bit instruc-
tions that refer to the Carry Bit as C assemble as
Carry-specific instructions (CLR C, etc.). The Car-
ry Bit also has a direct address, since it resides in
the PSW register, which is bit-addressable.
Note: The Boolean instruction set includes ANL
and ORL operations, but not the XRL (Exclusive
OR) operation. An XRL operation is simple to im-
plement in software. Suppose, for example, it is re-
quired to form the Exclusive OR of two bits:
The software to do that could be as follows:
First, Bit 1 is moved to the Carry. If bit2 = 0, then
C now contains the correct result. That is, Bit 1
.XRL. bit2 = bit1 if bit2 = 0. On the other hand, if
bit2 = 1, C now contains the complement of the
correct result. It need only be inverted (CPL C) to
complete the operation.
This code uses the JNB instruction, one of a series
of bit-test instructions which execute a jump if the
28/175
MOV C,FLAG
MOV P1.0,C
C = bit 1 .XRL. bit2
MOV C , bit1
JNB bit2, OVER
CPL C
OVER: (continue)
addressed bit is set (JC, JB, JBC) or if the ad-
dressed bit is not set (JNC, JNB). In the above
case, Bit 2 is being tested, and if bit2 = 0, the CPL
C instruction is jumped over.
JBC executes the jump if the addressed bit is set,
and also clears the bit. Thus a flag can be tested
and cleared in one operation. All the PSW bits are
directly addressable, so the Parity Bit, or the gen-
eral-purpose flags, for example, are also available
to the bit-test instructions.
Table 12. Boolean Instructions
Relative Offset
The destination address for these jumps is speci-
fied to the assembler by a label or by an actual ad-
dress in
destination address assembles to a relative offset
byte. This is a signed (two’s complement) offset
byte which is added to the PC in two’s complement
arithmetic if the jump is executed.
The range of the jump is therefore -128 to +127
Program Memory bytes relative to the first byte fol-
lowing the instruction.
Mnemonic
ORL C,/bit
ANL C,/bit
MOV C,bit
MOV bit,C
JNB bit,rel
JBC bit,rel
ORL C,bit
ANL C,bit
SETB bit
JB bit,rel
SETB C
CLR bit
CPL bit
JNC rel
CLR C
CPL C
JC rel
Program memory. How-ever, the
Jump if bit = 1; CLR bit
C = C .AND. .NOT. bit
C = C .OR. .NOT. bit
C = A .AND. bit
C = A .OR. bit
Jump if bit = 0
bit = .NOT. bit
Jump if C = 0
Jump if bit =1
Jump if C =1
C = .NOT. C
Operation
C = bit
bit = C
bit = 0
bit = 1
C = 0
C = 1

Related parts for UPSD3254