这是小弟的调试C程序;
include <reg51.h>
typedef unsigned char uchar;
typedef unsigned int uint ;
uchar data * point;
main()
{
uchar a,b;
point=0x5A; //指向RAM区的0x5a单元
*point++=0x55;//向0x5a单元写入数据0行0x55,指针加1
*point=0xaa;
point=0x5A;
a= *point++; //将0x5a单元的内容读到a中
b=*point; //将0x5b单元的内容读到b中
while(1);
}
这是自动转换的汇编程序:
C:0x0000 020025 LJMP STARTUP1(C:0025)
9: main()
10: {
11: uchar a,b;
12: point=0x5A;
C:0x0003 750A5A MOV point(0x0A),#0x5A
13: *point++=0x55
C:0x0006 AF0A MOV R7,point(0x0A)
C:0x0008 050A INC point(0x0A)
C:0x000A A807 MOV R0,0x07
C:0x000C 7655 MOV @R0,#0x55
14: *point=0xaa;
C:0x000E A80A MOV R0,point(0x0A)
C:0x0010 76AA MOV @R0,#0xAA
15: point=0x5A;
C:0x0012 750A5A MOV point(0x0A),#0x5A
16: a= *point++;
C:0x0015 AF0A MOV R7,point(0x0A)
C:0x0017 050A INC point(0x0A)
C:0x0019 A807 MOV R0,0x07
C:0x001B E6 MOV A,@R0
C:0x001C F508 MOV 0x08,A
17: b=*point; //将0x5b单元的内容读到b中
C:0x001E A80A MOV R0,point(0x0A)
C:0x0020 E6 MOV A,@R0
C:0x0021 F509 MOV 0x09,A
18: while(1);
C:0x0023 80FE SJMP C:0023
133: MOV R0,#IDATALEN - 1
C:0x0025 787F MOV R0,#0x7F
134: CLR A
C:0x0027 E4 CLR A
135: IDATALOOP: MOV @R0,A
C:0x0028 F6 MOV @R0,A
136: DJNZ R0,IDATALOOP
C:0x0029 D8FD DJNZ R0,IDATALOOP(C:0028)
185: MOV SP,#?STACK-1
为什么在调试窗口中memory中查看0x5a单元的值根本没有发生改变,还有a,b的值也没有。?求大神指教
|