📄 parser.lst
字号:
RC51 COMPILER V03.03.29, PARSER 06/03/03 11:10:05 PAGE 1
QCW(0x00002F32)
WIN32 RC51 COMPILER V03.03.29, COMPILATION OF MODULE PARSER
OBJECT MODULE PLACED IN d:\data\msc1210\ride\mvp\parser.obj
COMPILER INVOKED BY: RC51.EXE D:\DATA\MSC1210\RIDE\MVP\PARSER.C OBJECT(D:\DATA\M
-SC1210\RIDE\MVP\PARSER.OBJ) PIN(D:\RIDE\INC) PIN(D:\RIDE\INC\51\TI\
-) NOAM SUE_OPT PR(D:\DATA\MSC1210\RIDE\MVP\PARSER.LST) CD SB OE(1)
-SM FP(NOFLOAT) PW(80) MAXWAR(200) NOIS UNSIGNEDCHAR ET(CHAR)
stmt level source
1 // Parser
2 #include <REG1210.H>
3 #include "mvp.h"
WARNING C179 IN LINE 183 OF mvp.h : 'msg' : mspace on parameter ignored
4 unsigned char k1,k2,k3,vdds;
5 unsigned char data i,j,k, count;
6 void bakekey(void)
7 { unsigned char c;
8 1 if (high(k1)) { //Pre-bake: Program Slave CPU with AA and check
- result
9 2 c=resetpfpm(); if (c!=0) {putstr("\nReset Error");}
WARNING C090 IN LINE 9 OF parser.c : Call to function 'resetpfpm' without proto
-type
10 2 c=util(CPUS,0x0f); putok(c); putcr();
11 2 if (c==0) {led(GREEN,ON); led(RED,OFF);} else {led(GREEN,OFF); l
-ed(RED,ON);}
12 2 release();
WARNING C090 IN LINE 12 OF parser.c : Call to function 'release' without protot
-ype
13 2 if (c==0) beep(700,100); else beep(1000,100);
14 2 nokey();
15 2 }
16 1 if (high(k2)) { //After-bake: Slave Retention Check only
17 2 c=resetpfpm(); if (c!=0) {putstr("\nReset Error");}
18 2 c=util(CPUS,0x0c); putok(c); putcr();
19 2 if (c==0) {led(GREEN,ON); led(RED,OFF);} else {led(GREEN,OFF); l
-ed(RED,ON);}
20 2 release();
21 2 if (c==0) beep(700,100); else beep(1000,100);
22 2 nokey();
23 2 }
24 1 if(high(k3)) { // After-bake: Slave Retention Check and March Te
-st
25 2 c=resetpfpm(); if (c!=0) {putstr("\nReset Error");}
26 2 c|=util(CPUS,0x0d); putok(c); putcr();
27 2 if (c==0) {led(GREEN,ON); led(RED,OFF);} else {led(GREEN,OFF); l
-ed(RED,ON);}
28 2 release();
29 2 if (c==0) beep(700,100); else beep(1000,100);
30 2 nokey();
31 2 }
32 1 }
33 void pgmkey(void)
34 { unsigned char c;
35 1 if(high(k1)) { // Program from CPUA to CPUS
36 2 c=resetpfpm(); if (c!=0) {putstr("\nReset Error");}
37 2 putstr("Copy buffer->target ");
38 2 c|=util(CPUS,0x02); putok(c); putcr();
39 2 if (c==0) {led(GREEN,ON); led(RED,OFF);} else {led(GREEN,OFF); l
-ed(RED,ON);}
40 2 release();
41 2 if (c==0) beep(700,100); else beep(1000,100);
42 2 nokey();
43 2 }
44 1 if(high(k2)) { // Program from CPUS to CPUA
45 2 c=resetpfpm(); if (c!=0) {putstr("\nReset Error");}
46 2 putstr("Copy target->buffer");
47 2 c|=util(CPUA,0x02); putok(c); putcr();
48 2 if (c==0) {led(GREEN,ON); led(RED,OFF);} else {led(GREEN,OFF); l
-ed(RED,ON);}
49 2 release();
50 2 if (c==0) beep(700,100); else beep(1000,100);
51 2 nokey();
52 2 }
53 1 if(high(k3)) { //
54 2 c=resetpfpm(); if (c!=0) {putstr("\nReset Error");}
55 2 putstr("Secure ");
56 2 c|=util(CPUS,0x01); putok(c); putcr();
57 2 if (c==0) {led(GREEN,ON); led(RED,OFF);} else {led(GREEN,OFF); l
-ed(RED,ON);}
58 2 release();
59 2 if (c==0) beep(700,100); else beep(1000,100);
60 2 nokey();
61 2 }
62 1 }
63 unsigned char fxn_number(unsigned char k)
64 { unsigned char fxn;
65 1 if (k=='U') fxn=rx_hex_echo();
66 1 if (k=='C') fxn=0x02;//Copy
67 1 if (k=='B') fxn=0x04;//Blank
68 1 if (k=='V') fxn=0x03;//Verify
69 1 if (k=='X') fxn=0x01;//Secure
70 1 if (k=='K') fxn=0x05;//Mass Erase
71 1 if (k=='I') fxn=0xff;//Info
72 1 return(fxn);
73 1 }
74 void cmd_parser(void)
75 { unsigned char kk,extend, cpu,c,b,t,d,r,err,done, trial,d10,d1, f
-xn;
76 1 unsigned int a;
77 1 cpu=nvcp->cpu;
78 1 //if (nvcp->cpu==CPUA) putstr("CPUA");
79 1 //if (nvcp->cpu==CPUS) putstr("CPUS");
80 1 // Note F1 is used for Echo Control Flag
81 1 while (SET){
82 2 putcr();
83 2 tx_byte('>');
84 2 while(1){
85 3 if (!rxmt) break; // Found Terminal Key Input
86 3 if (nvcp->mode==Bake)bakekey();
87 3 if (nvcp->mode==Program)pgmkey();
88 3 }
89 2 k=rx_byte_echo(); //get & parse command
90 2 extend=0;
91 2 if (k=='E') {
92 3 F1 = !F1;
93 3 } else if (k=='R') { //RR RW: dummy commands
94 3 if (rx_byte_echo()=='W') {
95 4 rx_hex_echo();
96 4 rx_hex_echo();
97 4 } else {
98 4 //tx_hex(rx_hex_echo());
99 4 tx_hex(fpm(cpu|SRD,rx_hex_echo(),0));
100 4 }
101 3 } else if (k=='H') { //Help Screen
102 3 screen();
WARNING C090 IN LINE 102 OF parser.c : Call to function 'screen' without protot
-ype
103 3 } else if (k=='M') {
104 3 putok(fpm(cpu|FME,rx_hex_double_echo(),0xff)); //Mnnnn: Mass Er
-ase
105 3 } else if (k=='L') {
106 3 done=0; while(!done){
107 4 while(rx_byte_echo()!=':'){;}
108 4 c=0; err=0; i=0;
109 4 b=rx_hex_echo(); c+=b; //bytecount
110 4 a=rx_hex_double_echo(); d=a; t=a>>8; c=c+d+t; // address
111 4 t=rx_hex_echo(); c+=t; // type
112 4 while(i!=b){
113 5 d=rx_hex_echo(); c+=d; trial=0;
114 5 while(trial!=99){
115 6 fpm(cpu|FWR,a,d);
116 6 if (d!=fpm(cpu|FRD,a,0)) { trial++;
117 7 if (trial>3) {err=1; trial=99;}
118 7 } else trial=99;
119 6 } a++; i++;
120 5 }
121 4 c+=rx_hex_echo(); r='.';
122 4 if (err!=0) {r='X'; done=1;} else if(c!=0) {r='E'; done=1;}
123 4 else if(t==1) {r='T'; done=1;}
124 4 tx_byte(r);
125 4 }
126 3 beep(700,100);
127 3 } else if (k=='a') {
128 3 resetpfpm(); display(cpu,k,rx_hex_double_echo()); release();
129 3 } else if (k=='>' || k=='<' || k=='r' ) {
130 3 resetpfpm(); display(cpu,k,0); release();
131 3 } else if (k=='Z') {
132 3 release();
133 3 beep(700,100);
134 3 } else if (k=='F') { //Flash RD/WR
135 3 c=resetpfpm(); if (c!=0) {putstr("\nReset Error");}
136 3 kk=rx_byte_echo();
137 3 if (kk=='R' && cpu != CPUBOTH) tx_hex(fpm(cpu|FRD,rx_hex_double
-_echo(),0));
138 3 else if(kk=='W') putok(fpm(cpu|FWR,rx_hex_double_echo(),rx_hex_
-echo()));
139 3 else if(kk=='P') putok(fpm(cpu|FPE,rx_hex_double_echo(),0xff));
-
140 3 release();
141 3 /*} else if (k=='S') { //SFR RD/WR
142 3 kk=rx_byte_echo();
143 3 if (kk=='R' && cpu != CPUBOTH) tx_hex(fpm(cpu|SRD,rx_hex_echo()
-,0));
144 3 else if (kk=='W') tx_hex(fpm(cpu|SWR,rx_hex_echo(),rx_hex_echo(
-))); */
145 3 } else if (k=='U' || k=='C' || k=='B' || k=='V'|| k=='X'|| k=='K
-' || k=='I') {
146 3 c=resetpfpm();
147 3 if (c!=0) {putstr("\nReset Error");} else {
148 4 if (cpu==CPUS) {
149 5 if (target.exist==0xff) {
150 6 putstr(" Target Device Not Found");
151 6 } else if (target.exist==0) {
152 6 putstr(" Target Unknown HWPC/ID=");
153 6 tx_hex(target.HWPC1);
154 6 tx_hex(target.HWPC0);
155 6 tx_hex(target.HWID);
156 6 } else {
157 6 c=util(cpu,fxn_number(k));
158 6 putstr(" MSC");
159 6 if (target.part==MSC1210) putstr("1210Y");
160 6 if (target.part==MSC1211) putstr("1211Y");
161 6 if (target.part==MSC1212) putstr("1212Y");
162 6 tx_byte(target.y+'0'); putspace1();
163 6 d10=target.kbyte/10; d1=target.kbyte-d10*10;
164 6 tx_byte(d10+'0');tx_byte(d1+'0'); putstr("kByte ");
165 6 if (target.secure==1) putstr("SECURED ");
166 6 putok(c); putcr();
167 6 }
168 5 } else c=util(cpu,fxn_number(k)); // Aux Functions
169 4 if (c==0) {led(GREEN,ON); led(RED,OFF);} else {led(GREEN,OFF);
- led(RED,ON);}
170 4 release();
171 4 if (c==0) beep(700,100); else beep(1000,100);
172 4 beep(700,100);
173 4 }
174 3 } else if (k=='S') { // Slave CPU Command
175 3 cpu=CPUS; extend=1;
176 3 } else if (k=='A') { // Aux CPU Command
177 3 cpu=CPUA; extend=1;
178 3 } else if (k=='T') { // Both Slave and Aux CPU Command
179 3 cpu=CPUBOTH; extend=1;
180 3 } else if (k=='I') {
181 3 }
182 2 if (extend==1){
183 3 EAI=0; EA=0;
184 3 write_flash_chk(&(nvnp->cpu),cpu,FDM);
WARNING C207 IN LINE 184 OF parser.c : suspicious pointer conversion
185 3 EAI=1; EA=1; updatenv();
WARNING C090 IN LINE 185 OF parser.c : Call to function 'updatenv' without prot
-otype
186 3 }
187 2 }
188 1 }
WARNING C092 IN LINE 75 OF parser.c : 'fxn' is declared but not used
189 unsigned char adc_delay=0;
190 void aux_int_isr(void) interrupt 6
191 {
192 1 if (PAI==5) { // MSINT
193 2 PAI=MSINT; //Dummy read (PAI is read only)
194 2 if (t0!=0) t0--; //GP Timer
195 2 if (t1!=0) {
196 3 t1--;
197 3 if(PWM!=0) PWM -= 1;
198 3 } else PWMCON=0; //Tone Timer
199 2 if (t2!=0) t2--;
200 2 }
201 1 if (PAI==6) { // ADCINT
202 2 if (adc_delay==3){
203 3 if (ADMUX == 0x08) {k1=ADRESH; ADMUX=0x18; }
204 3 else if (ADMUX == 0x18) {k2=ADRESH; ADMUX=0x28; }
205 3 else if (ADMUX == 0x28) {k3=ADRESH; ADMUX=0x78; }
206 3 else if (ADMUX == 0x78) {vdds=ADRESH; ADMUX=0x08; }
207 3 adc_delay=0;
208 3 } else adc_delay++;
209 2 PAI=ADRESL; //Dummy read
210 2 }
211 1 AI=0;
212 1 }
WARNING C233 IN LINE 212 OF parser.c : using absolute registers together with i
-nterrupts can cause register corruptions (mixup of register banks)
- 213
214
215
RC51 COMPILER V03.03.29, PARSER 06/03/03 11:10:06 PAGE 2
ASSEMBLY LISTING OF GENERATED OBJECT CODE
; FUNCTION bakekey (BEGIN)
; SOURCE LINE # 8
0000 AF00 R MOV R7,k1
0002 120000 R LCALL _high
0005 EF MOV A,R7
0006 6065 JZ ?NXT12
; SOURCE LINE # 9
0008 120000 R LCALL resetpfpm
000B 8F00 R MOV c,R7
000D E500 R MOV A,c
000F 6007 JZ ?NXT13
0011 7E00 R MOV R6,#HIGH(?STR?PARSER?BASE)
0013 7F00 R MOV R7,#LOW(?STR?PARSER?BASE)
0015 120000 R LCALL _putstr
0018 ?NXT13:
; SOURCE LINE # 10
0018 7F40 MOV R7,#040H
001A 7D0F MOV R5,#00FH
001C 120000 R LCALL _util
001F 8F00 R MOV c,R7
0021 AF00 R MOV R7,c
0023 120000 R LCALL _putok
0026 120000 R LCALL putcr
; SOURCE LINE # 11
0029 E500 R MOV A,c
002B 7010 JNZ ?ELSE14
002D 7F47 MOV R7,#047H
002F 7D31 MOV R5,#031H
0031 120000 R LCALL _led
0034 7F52 MOV R7,#052H
0036 7D30 MOV R5,#030H
0038 120000 R LCALL _led
003B 800E SJMP ?NXT14
003D ?ELSE14:
003D 7F47 MOV R7,#047H
003F 7D30 MOV R5,#030H
0041 120000 R LCALL _led
0044 7F52 MOV R7,#052H
0046 7D31 MOV R5,#031H
0048 120000 R LCALL _led
004B ?NXT14:
; SOURCE LINE # 12
004B 120000 R LCALL release
; SOURCE LINE # 13
004E E500 R MOV A,c
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -