📄 pyzc4.lst
字号:
155 2 if(++begin_trans_buff>TRANSMIT_BUF_SIZE - 1)begin_trans_buff=0;
0063 1703 R incb begin_trans_buff
0065 991303 R cmpb begin_trans_buff,#13H
0068 DA02 ble @0008
006A 1103 R clrb begin_trans_buff
006C @0008:
156 2 clrbit(sp_status_image,TI_BIT); /* clear TI bit in status_image. */
006C 71DF02 R andb sp_status_image,#0DFH
006F @0007:
157 2 }
158 1 }
006F F0 ret
; Function Statistics for: transmit
; Code Size : 29 Parameter Count:
; Stack Size: Parameter Size :
; OReg Size : Stack Depth :
159
16 int putchar(int c)
161 {
0070 putchar:
0070 C800 E push ?FRAME01
0072 A01800 E ld ?FRAME01,SP
0075 2000 br @000B
0077 @000A:
162 1 /* remain in loop while the buffer is full. This is done by checking
163 1 the end of buffer index to make sure it does not overrun the
164 1 beginning of buffer index. The while instruction checks the case
165 1 when the end index is one less then the beginning index and at the
166 1 end of the buffer when the beginning index may be equal to 0 and
167 1 the end buffer index may be at the buffer end. */
168 1
169 1 while((end_trans_buff+1==begin_trans_buff)||
17 1 (end_trans_buff==TRANSMIT_BUF_SIZE -1 && !begin_trans_buff));
0077 @000B:
0077 BC041C R ldbse Tmp0,end_trans_buff
007A 071C inc Tmp0
007C BC031E R ldbse Tmp2,begin_trans_buff
007F 881E1C cmp Tmp0,Tmp2
0082 DFF3 be @000A
0084 991304 R cmpb end_trans_buff,#13H
0087 D705 bne @000D
0089 980300 R cmpb R0,begin_trans_buff
008C DFE9 be @000A
008E @000D:
171 1
172 1 trans_buff[end_trans_buff]=c; /* put character in buffer */
008E B300041C E ldb Tmp0,c[?FRAME01]
0092 BC041E R ldbse Tmp2,end_trans_buff
0095 C71F00001C R stb Tmp0,trans_buff[Tmp2]
173 1 if(++end_trans_buff>TRANSMIT_BUF_SIZE - 1) /* make buffer appear */
009A 1704 R incb end_trans_buff
009C 991304 R cmpb end_trans_buff,#13H
009F DA02 ble @000E
C196 Compiler pyzc4 15-Dec-106 17:34:24 Page 6
Assembly Listing of Object Code
174 1 end_trans_buff=0; /* circular. */
00A1 1104 R clrb end_trans_buff
00A3 @000E:
175 1 if(checkbit(sp_status_image, TI_BIT))
00A3 5120021C R andb Tmp0,sp_status_image,#2
00A7 981C00 cmpb R0,Tmp0
00AA DF03 be @000F
176 1 {
177 2 setbit(int_pend, SERIAL_INT); /* If transmit buffer
00AC 914000 E orb int_pending,#4
00AF @000F:
178 2 was empty, then cause
179 2 an interrupt to start
18 2 transmitting. */
181 2 }
182 1 }
00AF CC00 E pop ?FRAME01
00B1 F0 ret
; Function Statistics for: putchar
; Code Size : 66 Parameter Count: 1
; Stack Size: Parameter Size : 2
; OReg Size : Stack Depth : 2
183
184 unsigned char getchar()
185 {
00B2 getchar:
00B2 2000 br @0012
00B4 @0011:
186 1 while(begin_rec_buff==end_rec_buff); /* remain in loop while there is
00B4 @0012:
00B4 980506 R cmpb begin_rec_buff,end_rec_buff
00B7 DFFB be @0011
187 1 not a character avaliable. */
188 1 if(++begin_rec_buff>RECEIVE_BUF_SIZE - 1) /* make buffer appear */
00B9 1706 R incb begin_rec_buff
00BB 991306 R cmpb begin_rec_buff,#13H
00BE DA02 ble @0014
189 1 begin_rec_buff=0; /* circular. */
00C0 1106 R clrb begin_rec_buff
00C2 @0014:
19 1 return(receive_buff[begin_rec_buff]); /* return the character in
00C2 BC061C R ldbse Tmp0,begin_rec_buff
00C5 B31D14001C R ldb Tmp0,receive_buff[Tmp0]
00CA 2000 br @001
191 1 buffer. */
192 1 }
00CC @001:
00CC F0 ret
; Function Statistics for: getchar
; Code Size : 27 Parameter Count:
; Stack Size: Parameter Size :
; OReg Size : Stack Depth :
C196 Compiler pyzc4 15-Dec-106 17:34:24 Page 7
Assembly Listing of Object Code
193
194 void receive(void) /* serial interrupt routine */
195 {
00CD receive:
00CD C800 R push ?OVRBASE
196 1 unsigned char c;
197 1 sp_status_image |= sp_stat; /* image sp_stat into status_image */
00CF 900002 E orb sp_status_image,sp_stat
198 1
199 1 /* If the input buffer is full, the last character can be handled
2 1 as desired. */
2 1
2 1 if(end_rec_buff+1==begin_rec_buff || (end_rec_buff==RECEIVE_BUF_SIZE-1 &&
2 1 !begin_rec_buff))
00D2 BC051C R ldbse Tmp0,end_rec_buff
00D5 071C inc Tmp0
00D7 BC061E R ldbse Tmp2,begin_rec_buff
00DA 881E1C cmp Tmp0,Tmp2
00DD DF0A be @0017
00DF 991305 R cmpb end_rec_buff,#13H
00E2 D707 bne @0016
00E4 980600 R cmpb R0,begin_rec_buff
00E7 D702 bne @0016
00E9 @0017:
2 1 {
2 2 ; /* input overrun code */
2 2 }
2 1 else
00E9 20AB br @0018
00EB @0016:
2 1 {
2 2
21 2 /* The next statement makes the buffer circular by starting over when the
211 2 index reaches the end of the buffer. */
212 2
213 2 if(++end_rec_buff > RECEIVE_BUF_SIZE - 1) end_rec_buff=0;
00EB 1705 R incb end_rec_buff
00ED 991305 R cmpb end_rec_buff,#13H
00F0 DA02 ble @0019
00F2 1105 R clrb end_rec_buff
00F4 @0019:
214 2 receive_buff[end_rec_buff]=sbuf; /* place character in
00F4 BC051C R ldbse Tmp0,end_rec_buff
00F7 C71D140000 E stb sbuf,receive_buff[Tmp0]
215 2 buffer */
216 2 if(receive_buff[end_rec_buff]==0x45 && receive_buff[(end_rec_buff+RECEIVE_BUF_SIZE-1)%RECEIVE_BUF
-_SIZE]==0x00 && receive_buff[(end_rec_buff+RECEIVE_BUF_SIZE-5)%RECEIVE_BUF_SIZE]==0x53)
00FC B31D14001C R ldb Tmp0,receive_buff[Tmp0]
0101 99451C cmpb Tmp0,#45H
0104 D773 bne @001A
0106 BC051C R ldbse Tmp0,end_rec_buff
0109 6513001C add Tmp0,#13H
010D 061C ext Tmp0
010F FE8D14001C div Tmp0,#14H
0114 9B1F140000 R cmpb R0,receive_buff[Tmp2]
0119 D75E bne @001A
C196 Compiler pyzc4 15-Dec-106 17:34:24 Page 8
Assembly Listing of Object Code
011B BC051C R ldbse Tmp0,end_rec_buff
011E 650F001C add Tmp0,#0FH
0122 061C ext Tmp0
0124 FE8D14001C div Tmp0,#14H
0129 B31F14001E R ldb Tmp2,receive_buff[Tmp2]
012E 99531E cmpb Tmp2,#53H
0131 D746 bne @001A
217 2 {
218 3 triggle_in=1;
0133 B10103 R ldb triggle_in,#1
219 3 ++mess[9];
0136 B30109001C R ldb Tmp0,mess+9
013B 171C incb Tmp0
013D C70109001C R stb Tmp0,mess+9
22 3 pwm0_byte=receive_buff[(end_rec_buff+RECEIVE_BUF_SIZE-4)%RECEIVE_BUF_SIZE];
0142 BC051C R ldbse Tmp0,end_rec_buff
0145 4510001C20 add Tmp4,Tmp0,#1
014A 0620 ext Tmp4
014C FE8D140020 div Tmp4,#14H
0151 B323140007 R ldb pwm0_byte,receive_buff[Tmp6]
221 3 ioport1_byte=receive_buff[(end_rec_buff+RECEIVE_BUF_SIZE-3)%RECEIVE_BUF_SIZE];
0156 6511001C add Tmp0,#11H
015A 061C ext Tmp0
015C FE8D14001C div Tmp0,#14H
0161 B31F140008 R ldb ioport1_byte,receive_buff[Tmp2]
222 3 hso_byte=receive_buff[(end_rec_buff+RECEIVE_BUF_SIZE-2)%RECEIVE_BUF_SIZE];
0166 BC051C R ldbse Tmp0,end_rec_buff
0169 6512001C add Tmp0,#12H
016D 061C ext Tmp0
016F FE8D14001C div Tmp0,#14H
0174 B31F140009 R ldb hso_byte,receive_buff[Tmp2]
0179 @001A:
223 3 }
224 2 c=getchar(); //Discard a char,since now deal it in serial_in_interrupt.
0179 2F37 call getchar
017B B01C00 R ldb c,Tmp0
225 2 if(checkbit(sp_status_image, FE_BIT))
017E 5110021C R andb Tmp0,sp_status_image,#1
0182 981C00 cmpb R0,Tmp0
0185 DF03 be @001B
226 2 {
227 3 ; /* User code for framing error */
228 3 clrbit(sp_status_image, FE_BIT);
0187 71EF02 R andb sp_status_image,#0EFH
018A @001B:
229 3 }
23 2 if(checkbit(sp_status_image, OE_BIT))
018A 5104021C R andb Tmp0,sp_status_image,#4
018E 981C00 cmpb R0,Tmp0
0191 DF03 be @001C
231 2 {
232 3 ; /* User code for overrun error */
233 3 clrbit(sp_status_image, OE_BIT);
0193 71FB02 R andb sp_status_image,#0FBH
0196 @001C:
0196 @0018:
C196 Compiler pyzc4 15-Dec-106 17:34:24 Page 9
Assembly Listing of Object Code
234 3 }
235 2 }
236 1 clrbit(sp_status_image,RI_BIT); /* clear RI bit in status_image. */
0196 71BF02 R andb sp_status_image,#0BFH
237 1 }
0199 CC00 R pop ?OVRBASE
019B F0 ret
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -