89C51单片机内部结构深度解析三:单片机RAM地址空间
单片机的作业寄存器:00H~1FH
单片机在作业时需求处理很多的数据,这些数据有些要用来运算,有些要重复调用,有些用来比较查验,这时单片机就需求有这些方位暂时寄存这些数据,以便利后边数据的处理,而单片机供给暂存数据的当地便是作业寄存器。作业寄存器有4组,每组都是8个作业寄存器R0~R7,经过PSW中的RS1、RS0两位来挑选运用哪一组,假如不选,默许是挑选第0组。
RS1RS0组合为00时,选中第0组作业寄存器,R0~R7地址为00H~07H;
RS1RS0组合为01时,选中第1组作业寄存器,R0~R7地址为08H~0FH;
RS1RS0组合为10时,选中第2组作业寄存器,R0~R7地址为10H~17H;
RS1RS0组合为11时,选中第3组作业寄存器,R0~R7地址为18H~1FH。
真实的RAM:20H~7FH
SFR:special function register,特别功用寄存器的总称,是单片计算机中的一组特别的暂时存储区域,用于动态寄存计算机运转进程的一些状况信息、并依此做相应的操控,一共21个。
地址 |
高位(MSB) |
|||||||
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|
0xFF |
|
|
|
|
|
|
|
|
0xFE |
|
|
|
|
|
|
|
|
0xFD |
|
|
|
|
|
|
|
|
0xFC |
|
|
|
|
|
|
|
|
0xFB |
*CCAP1H |
|||||||
|
|
|
|
|
|
|
|
|
0xFA |
*CCAP0H |
|||||||
|
|
|
|
|
|
|
|
|
0xF9 |
*CH |
|||||||
|
|
|
|
|
|
|
|
|
0xF8 |
|
|
|
|
|
|
|
|
0xF7 |
|
|
|
|
|
|
|
|
0xF6 |
|
|
|
|
|
|
|
|
0xF5 |
|
|
|
|
|
|
|
|
0xF4 |
|
|
|
|
|
|
|
|
0xF3 |
*PCA_PWM1 |
|||||||
|
|
|
|
|
|
|
|
|
0xF2 |
*PCA_PWM0 |
|||||||
|
|
|
|
|
|
|
|
|
0xF1 |
|
|
|
|
|
|
|
|
0xF0 |
B(通用寄存器B,初值:0000 0000) |
|||||||
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
0xEF |
|
|
|
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CC |
|
|
|
|
|
|
|
|
0xCB |
|
|
|
|
|
|
|
|
0xCA |
*P5M0 |
|||||||
|
|
|
|
|
|
|
|
|
0xC9 |
*P5M1 |
|||||||
|
|
|
|
|
|
|
|
|
0xC8 |
*P5 |
|||||||
|
|
|
|
|
|
|
|
|
0xC7 |
*IAP_CONTR |
|||||||
|
|
|
|
|
|
|
|
|
0xC6 |
*IAP_TRIG |
|||||||
|
|
|
|
|
|
|
|
|
0xC5 |
*IAP_CMD |
|||||||
|
|
|
|
|
|
|
|
|
0xC4 |
*IAP_ADDRL |
|||||||
|
|
|
|
|
|
|
|
|
0xC3 |
*IAP_ADDRH |
|||||||
|
|
|
|
|
|
|
|
|
0xC2 |
*IAP_DATA |
|||||||
|
|
|
|
|
|
|
|
|
0xC1 |
*WDT_CONTR |
|||||||
|
|
|
|
|
|
|
|
|
0xC0 |
*P4 |
|||||||
|
|
|
|
|
|
|
|
|
0xBF |
|
|
|
|
|
|
|
|
0xBE |
*ADC_RESL |
|||||||
|
|
|
|
|
|
|
|
|
0xBD |
*ADC_RES |
|||||||
|
|
|
|
|
|
|
|
|
0xBC |
*ADC_CONTR |
|||||||
|
|
|
|
|
|
|
|
|
0xBB |
*P4SW |
|||||||
|
|
|
|
|
|
|
|
|
0xBA |
|
|
|
|
|
|
|
|
0xB9 |
*SADEN |
|||||||
|
|
|
|
|
|
|
|
|
0xB8 |
IP(中止优先级寄存器,初值:0000 0000) |
|||||||
*PPCA |
*PLVD |
*PADC |
PS |
PT1 |
PX1 |
PT0 |
PX0 |
|
0xB7 |
*IPH |
|||||||
|
|
|
|
|
|
|
|
|
0xB6 |
*IP2H |
|||||||
|
|
|
|
|
|
|
|
|
0xB5 |
*IP2 |
|||||||
|
|
|
|
|
|
|
|
|
0xB4 |
*P4M0 |
|||||||
|
|
|
|
|
|
|
|
|
0xB3 |
*P4M1 |
|||||||
|
|
|
|
|
|
|
|
|
0xB2 |
*P3M0 |
|||||||
|
|
|
|
|
|
|
|
|
0xB1 |
*P3M1 |
|||||||
|
|
|
|
|
|
|
|
|
0xB0 |
P3(I/O接口第3组,初值:1×11 1111) |
|||||||
P3.7 |
P3.6 |
P3.5 |
P3.4 |
P3.3 |
P3.2 |
P3.1 |
P3.0 |
|
0xAF |
*IE2 |
|||||||
|
|
|
|
|
|
|
|
|
0xAE |
|
|
|
|
|
|
|
|
0xAD |
|
|
|
|
|
|
|
|
0xAC |
|
|
|
|
|
|
|
|
0xAB |
|
|
|
|
|
|
|
|
0xAA |
|
|
|
|
|
|
|
|
0xA9 |
*SADDR |
|||||||
|
|
|
|
|
|
|
|
|
0xA8 |
IE(中止操控寄存器,初值:0000 0000) |
|||||||
EA |
*ELVD |
*EADC |
ES |
ET1 |
EX1 |
ET0 |
EX0 |
|
0xA7 |
|
|
|
|
|
|
|
|
0xA6 |
|
|
|
|
|
|
|
|
0xA5 |
|
|
|
|
|
|
|
|
0xA4 |
|
|
|
|
|
|
|
|
0xA3 |
|
|
|
|
|
|
|
|
0xA2 |
*AUXR1 |
|||||||
|
|
|
|
|
|
|
|
|
0xA1 |
*BUS_SPEED |
|||||||
|
|
|
|
|
|
|
|
|
0xA0 |
P2(I/O接口第2组,初值:1111 1111) |
|||||||
P2.7 |
P2.6 |
P2.5 |
P2.4 |
P2.3 |
P2.2 |
P2.1 |
P2.0 |
|
0x9F |
|
|
|
|
|
|
|
|
0x9E |
|
|
|
|
|
|
|
|
|
*P1ASF |
|||||||
0x9D |
|
|
|
|
|
|
|
|
|
*BRT |
|||||||
0x9C |
|
|
|
|
|
|
|
|
|
*S2BUF |
|||||||
0x9B |
|
|
|
|
|
|
|
|
|
*S2CON |
|||||||
0x9A |
|
|
|
|
|
|
|
|
0x99 |
SBUF(UART串口数据寄存器,初值:xxxx xxxx) |
|||||||
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
0x98 |
SCON(UART串口操控寄存器,初值:0000 0000) |
|||||||
SM0 |
SM1 |
SM2 |
REN |
TB8 |
RB8 |
T1 |
R1 |
|
0x97 |
*CLK_DIV |
|||||||
|
|
|
|
|
|
|
|
|
0x96 |
*P2M0 |
|||||||
|
|
|
|
|
|
|
|
|
0x95 |
*P2M1 |
|||||||
|
|
|
|
|
|
|
|
|
0x94 |
*P0M0 |
|||||||
|
|
|
|
|
|
|
|
|
0x93 |
*P0M1 |
|||||||
|
|
|
|
|
|
|
|
|
0x92 |
*P1M0 |
|||||||
|
|
|
|
|
|
|
|
|
0x91 |
*P1M1 |
|||||||
|
|
|
|
|
|
|
|
|
0x90 |
P1(I/O接口第1组,初值:1111 1111) |
|||||||
P1.7 |
P1.6 |
P1.5 |
P1.4 |
P1.3 |
P1.2 |
P1.1 |
P1.0 |
|
0x8F |
*WAKE_CLK0 |
|||||||
|
|
|
|
|
|
|
|
|
0x8E |
*AUXR |
|||||||
|
|
|
|
|
|
|
|
|
0x8D |
TH1(T1守时/计数器16位寄存器高8位,初值:0000 0000) |
|||||||
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
0x8C |
TH0(T0守时/计数器16位寄存器高8位,初值:0000 0000) |
|||||||
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
0x8B |
TL1(T1守时/计数器16位寄存器低8位,初值:0000 0000) |
|||||||
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
0x8A |
TL0(T0守时/计数器16位寄存器低8位,初值:0000 0000) |
|||||||
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
0x89 |
TMOD(守时/计数器方法操控寄存器,初值:0000 0000) |
|||||||
GATE |
C/T |
M1 |
M0 |
GATE |
C/T |
M1 |
M0 |
|
0x88 |
TCON(守时/计数器操控寄存器,初值:0000 0000) |
|||||||
TF1 |
TR1 |
TF0 |
TR0 |
IE1 |
IT1 |
IE0 |
IT0 |
|
0x87 |
PCON(电源操控寄存器,初值:0011 0000) |
|||||||
SMOD |
SMOD0 |
*LVDF |
POF |
GF1 |
GF0 |
PD |
IDL |
|
0x86 |
|
|
|
|
|
|
|
|
0x85 |
|
|
|
|
|
|
|
|
0x84 |
|
|
|
|
|
|
|
|
0x83 |
DPH(通用16位指针高8位,初值:0000 0000) |
|||||||
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
0x82 |
DPL(通用16位指针低8位,初值:0000 0000) |
|||||||
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
0x81 |
SP(仓库指针,初值:0000 0111) |
|||||||
0 |
0 |
0 |
0 |
0 |
1 |
1 |
1 |
|
0x80 |
P0(I/O接口第0组,初值:xxxx 1111) |
|||||||
P0.7 |
P0.6 |
P0.5 |
P0.4 |
P0.3 |
P0.2 |
P0.1 |
P0.0 |