SECTION III - ADDRESSES OF SPECIAL FUNCTION REGISTERS IN 8051

SECTION III - ADDRESSES OF SPECIAL FUNCTION REGISTERS IN 8051

'B' register, 'A' register, 'PSW' register and 'DPTR' register as discussed in previous sections also have addresses. these registers are 'Special Function Registers' or 'SFR'. There are many other special function registers widely used. The special function registers have their names through which SPF can be accessed by their names or by their addresses. Register 'A' has address 'E0H' and register 'B' has address 'F0H'. The SFR table is listed below showing addresses and names:

Special Function Registers [SFR] Addresses:

SYMBOLNAMEADDRESSBIT / BYTE ADDRESSABLE
ACCAccumulator0E0HBIT addressable
BB Register0F0HBIT addressable
PSWProgram Status Word0D0HBIT addressable
SPStack Pointer81HBYTE addressable
DPTRData Pointer [2 bytes]  
   DPLData Pointer Low Byte82HBYTE addressable
   DPHData Pointer High Byte83HBYTE addressable
P0Port 080HBIT addressable
P1Port 190HBIT addressable
P2Port 20A0HBIT addressable
P3 Port 30B0HBIT addressable
IPInterrupt Priority Control0B8HBIT addressable
IEInterrupt Enable Control0A8HBIT addressable
TMODTimer/Counter Mode Control89HBYTE addressable
TCONTimer/Counter Control88HBIT addressable
T2CONTimer/COunter 2 Control0C8HBIT addressable
T2MODTimer/Counter Mode Control0C9HBYTE addressable
TH0Timer/Counter 0 High Byte8CHBYTE addressable
TL0Timer/Counter 0 Low Byte8AHBYTE addressable
TH1Timer/Counter 1 High Byte8DHBYTE addressable
TL1Timer/Counter 1 Low Byte8BHBYTE addressable
TH2Timer/Counter 2 High Byte0CDHBYTE addressable
TL2Timer/Counter 2 Low Byte0CCHBYTE addressable
RCAP2HTimer/Counter 2 Capture Register High Byte0CBHBYTE addressable
RCAP2LTimer/Counter 2 Capture Register Low Byte0CAHBYTE addressable
SCONSerial Control Register98HBIT addressable
SBUFSerial Data Buffer Register99HBYTE addressable
PCONPower Control87HBYTE addressable

The special function registers SFR has addresses between 80H and FFH. The addresses 00 to 7FH are addresses of RAM memory inside the 8051. There are some unused locations between 80H to FFH. These are reserved and must not be used by the 8051 programmer.

The pairs of instructions given below are the same thing:

MOV 0E0H, #AAH;is same as the instruction given below
MOV A, #AAH;Load value AAH into accumulator A i.e A=AAH
MOV 0F0H, #24H;is same as the instruction given below
MOV B, #24H;Load value 24H into B register i.e B=24H
MOV 0E0H, #R1;is same as the instruction given below
MOV A, #R1;Load value of R1 into accumulator A i.e A=R1
MOV 0F0H, #R7;is same as the instruction given below
MOV B, R7;Load value of R7 into register B i.e B=R7

Example # 1:

Lets write a code to send 55H to Port 2 and Port 3 by using their original names and by using their addresses:

By Using their Names:

MOV A, #55H;Load 55H into accumulator register A
MOV P2, A;Send 55H value to Port 2
MOV P3, A;Send 55H value to Port 3

By Using their Addresses:

MOV 0E0H, #55H;Load 55H into accumulator A [0E0H accumulator address]
MOV 0A0H, 0E0H;Send 55H value to Port 2 [0A0H port2 address]
MOV 0B0H, 0E0H;Send 55H value to Port3 [0B0H port3 address]

 

More From Iamtechnical.com

Advertisement: