void pointerCover()
{
int * volatile pointerGeneration; /*一般指针(3字节)*/
int xdata * volatile pointerXdata; /*xdata指针(2字节)*/
int idata * volatile pointerIdata; /*idata指针(1字节)*/
int code * volatile pointerCode; /*code指针(2字节)*/
pointerGeneration = pointerXdata;
pointerGeneration = pointerIdata;
pointerGeneration = pointerCode;
pointerGeneration = 4;
pointerXdata = pointerGeneration;
pointerIdata = pointerGeneration;
pointerCode = pointerGeneration;
}
int main()
{
pointerCover();
}
C:0x0000 02005B LJMP STARTUP1(C:005B)
2: {
3:
4: int * volatile pointerGeneration; /*一般指针(3字节)*/
5: int xdata * volatile pointerXdata; /*xdata指针(2字节)*/
6: int idata * volatile pointerIdata; /*idata指针(1字节)*/
7: int code * volatile pointerCode; /*code指针(2字节)*/
8:
9: pointerGeneration = pointerXdata;
C:0x0003 AE0B MOV R6,0x0B
C:0x0005 AF0C MOV R7,0x0C
C:0x0007 AA06 MOV R2,0x06
C:0x0009 A907 MOV R1,0x07
C:0x000B 750801 MOV 0x08,#0x01
C:0x000E 8A09 MOV 0x09,R2
C:0x0010 890A MOV 0x0A,R1
10: pointerGeneration = pointerIdata;
C:0x0012 A90D MOV R1,0x0D
C:0x0014 750800 MOV 0x08,#0x00
C:0x0017 750900 MOV 0x09,#0x00
C:0x001A 890A MOV 0x0A,R1
11: pointerGeneration = pointerCode;
12:
C:0x001C AE0E MOV R6,0x0E
C:0x001E AF0F MOV R7,0x0F
C:0x0020 AA06 MOV R2,0x06
C:0x0022 A907 MOV R1,0x07
C:0x0024 7508FF MOV 0x08,#0xFF
C:0x0027 8A09 MOV 0x09,R2
C:0x0029 890A MOV 0x0A,R1
13: pointerGeneration = 4;
14:
C:0x002B 750800 MOV 0x08,#0x00
C:0x002E 750900 MOV 0x09,#0x00
C:0x0031 750A04 MOV 0x0A,#0x04
15: pointerXdata = pointerGeneration;
C:0x0034 AB08 MOV R3,0x08
C:0x0036 AA09 MOV R2,0x09
C:0x0038 A90A MOV R1,0x0A
C:0x003A AE02 MOV R6,0x02
C:0x003C AF01 MOV R7,0x01
C:0x003E 8E0B MOV 0x0B,R6
C:0x0040 8F0C MOV 0x0C,R7
16: pointerIdata = pointerGeneration;
C:0x0042 AB08 MOV R3,0x08
C:0x0044 AA09 MOV R2,0x09
C:0x0046 A90A MOV R1,0x0A
C:0x0048 AF01 MOV R7,0x01
C:0x004A 8F0D MOV 0x0D,R7
17: pointerCode = pointerGeneration;
C:0x004C AB08 MOV R3,0x08
C:0x004E AA09 MOV R2,0x09
C:0x0050 A90A MOV R1,0x0A
C:0x0052 AE02 MOV R6,0x02
C:0x0054 AF01 MOV R7,0x01
C:0x0056 8E0E MOV 0x0E,R6
C:0x0058 8F0F MOV 0x0F,R7
18: }
19:
C:0x005A 22 RET
99: MOV R0,#IDATALEN - 1
C:0x005B 787F MOV R0,#0x7F
100: CLR A
C:0x005D E4 CLR A
101: IDATALOOP: MOV @R0,A
C:0x005E F6 MOV @R0,A
102: DJNZ R0,IDATALOOP
C:0x005F D8FD DJNZ R0,IDATALOOP(C:005E)
151: MOV SP,#?STACK-1
152: ; This code is required if you use L51_BANK.A51 with Banking Mode 4
153: ; EXTRN CODE (?B_SWITCH0)
154: ; CALL ?B_SWITCH0 ; init bank mechanism to code bank 0
C:0x0061 75810F MOV SP(0x81),#0x0F
155: LJMP ?C_START
C:0x0064 020067 LJMP main(C:0067)
20: int main()
C:0x0067 020003 LJMP pointerCover(C:0003)