.2.9. ALU (ARITHMETIC AND LOGIC UNIT)
The arithmetic and logic unit performs 8 bit arithmetic
and logic operations over the operands held by the
temporary registers TMP1 and TMP2. The users cannot
access these temporary registers. oi
The various arithmetic operations performed by ALU
are addition, addition with carry, subtraction with borrow,
increment, decrement, multiplication and division. The
addition and subtraction functions are performed in both
Signed and unsigned manners also. Similarly ALU can
perform AND, OR, EX-OR, clear, complement and rotate
logic functions. After the arithmetic and logical operations
the result is stored in the destination operand.-
2.10. SPECIAL FUNCTION REGISTERS
The microcontroller 8051 has a family of special
purpose registers called special function registers. There are
a total of 21 special function 8-bit registers. Among them, |
there are 11 tegisters are byte and bit addressable registers.
The se AccfA), B, PSW, PO, P4, P2, P3, IP, IE, TCON and
SCCix..The remaining 10 registers, namely SP, DPH, DPL,
TMGD, THO, TLO, TH1, TL1, SBUF and PCON registers are
addressable registers, they are not bit addressable
The registers DPH and DPL are higher and tower bytes of a
46-bit ra gister DPTR (Data Pointer}. This register is used for °
accessing external data memory.2.12
THO and TLO are the higher and lower
mericounter Kegister To. Similarly,
gher and lower byte registers of
T1. The fot,port Jatches are
E The registers
byte registers of 16-bit ti
TH1 and TL1 are the hi
16-bit timer/counter register
represented by Po, ‘PA, P2 and P3. ;
The TMOD aiid TCON registers are u!
counter operations. The IP and IE registers are used for
interrupt operations. The SCON, SBUF and PCON registers
are used for serial communicati
also used for setting the. power mode o}
The list of SFR names and their byte and bit addresses
are shown in the table below. The unused Iccations in SFRs
(80H to FFH) are reserved and must not be used by the 8051
The SFR cari be accessed by their names
2d for timer/
f 8051.
programmer.
(which is much easier than by their addresses)
symbol ime Byte | Bit addresses
a address} MSB LSB
Acc* Accumulator OEOH ETH - €0H
Bt B register ‘ OFOH | F7H --FOH
PSW* Program status word oDoH D7H ~ DOH
SP. Stack pointer 81H -
DPL Low byté DPTR 82H :
opH | High byte DPTR 83H
Po’ PortO 80H 87H - 60H
oe - 90H 97H - 90H
OAQH ATH - AGH
| Pa | Ports | cgoH btn
| P | Inept icrity control | OB8H FH - 68!
| ie OASH e
L_[MOD | Timer / counter mode - 89H :
ion. The PCON regisier is |
|
|
|
|Timer/ counter conirot 8FH - 88H
Timer/ counter 6 high byte
| Timer /counter 0 low byte .
. Timer/ counter 1 ie byte
; Timer / counter 1fow byte
Serial contro!
| Serial data buffer
Power coxftrol
The SFRs raarked with an asterisk (x) are both bit and.
byte addressable.