📄 wuximoto.lst
字号:
149 1 sp_status_image */
15 1
151 1 /* transmit a character if there is a character in the buffer
152 1 else leave TI_BIT set in image for putchar to enable interrupts */
153 1 if(begin_trans_buff!=end_trans_buff)
0068 980403 R cmpb begin_trans_buff,end_trans_buff
006B DF14 be @0009
154 1 {
155 2 sbuf=trans_buff[begin_trans_buff]; /* transmit character */
006D BC031C R ldbse Tmp0,begin_trans_buff
0070 B31D000000 E ldb sbuf,trans_buff[Tmp0]
156 2
157 2 /* The next statement makes the buffer circular by starting over when the
158 2 index reaches the end of the buffer. */
159 2
16 2 if(++begin_trans_buff>TRANSMIT_BUF_SIZE - 1)begin_trans_buff=0;
0075 1703 R incb begin_trans_buff
0077 991303 R cmpb begin_trans_buff,#13H
007A DA02 ble @000A
007C 1103 R clrb begin_trans_buff
007E @000A:
161 2 clrbit(sp_status_image,TI_BIT); /* clear TI bit in status_image. */
007E 71DF02 R andb sp_status_image,#0DFH
0081 @0009:
162 2 }
163 1 }
0081 F0 ret
; Function Statistics for: transmit
; Code Size : 29 Parameter Count:
; Stack Size: Parameter Size :
; OReg Size : Stack Depth :
164
165 int putchar(int c)
166 {
0082 putchar:
0082 C800 E push ?FRAME01
0084 A01800 E ld ?FRAME01,SP
0087 2000 br @000D
0089 @000C:
167 1 /* remain in loop while the buffer is full. This is done by checking
168 1 the end of buffer index to make sure it does not overrun the
169 1 beginning of buffer index. The while instruction checks the case
17 1 when the end index is one less then the beginning index and at the
171 1 end of the buffer when the beginning index may be equal to 0 and
172 1 the end buffer index may be at the buffer end. */
173 1
174 1 while((end_trans_buff+1==begin_trans_buff)||
175 1 (end_trans_buff==TRANSMIT_BUF_SIZE -1 && !begin_trans_buff));
0089 @000D:
0089 BC041C R ldbse Tmp0,end_trans_buff
008C 071C inc Tmp0
008E BC031E R ldbse Tmp2,begin_trans_buff
0091 881E1C cmp Tmp0,Tmp2
0094 DFF3 be @000C
C196 Compiler wuximoto 28-Jun-107 11:05:25 Page 6
Assembly Listing of Object Code
0096 991304 R cmpb end_trans_buff,#13H
0099 D705 bne @000F
009B 980300 R cmpb R0,begin_trans_buff
009E DFE9 be @000C
00A0 @000F:
176 1
177 1 trans_buff[end_trans_buff]=c; /* put character in buffer */
00A0 B300041C E ldb Tmp0,c[?FRAME01]
00A4 BC041E R ldbse Tmp2,end_trans_buff
00A7 C71F00001C R stb Tmp0,trans_buff[Tmp2]
178 1 if(++end_trans_buff>TRANSMIT_BUF_SIZE - 1) /* make buffer appear */
00AC 1704 R incb end_trans_buff
00AE 991304 R cmpb end_trans_buff,#13H
00B1 DA02 ble @001
179 1 end_trans_buff=0; /* circular. */
00B3 1104 R clrb end_trans_buff
00B5 @001:
18 1 if(checkbit(sp_status_image, TI_BIT))
00B5 5120021C R andb Tmp0,sp_status_image,#2
00B9 981C00 cmpb R0,Tmp0
00BC DF03 be @0011
181 1 {
182 2 setbit(int_pend, SERIAL_INT); /* If transmit buffer
00BE 914000 E orb int_pending,#4
00C1 @0011:
183 2 was empty, then cause
184 2 an interrupt to start
185 2 transmitting. */
186 2 }
187 1 }
00C1 CC00 E pop ?FRAME01
00C3 F0 ret
; Function Statistics for: putchar
; Code Size : 66 Parameter Count: 1
; Stack Size: Parameter Size : 2
; OReg Size : Stack Depth : 2
188
189 unsigned char getchar()
19 {
00C4 getchar:
00C4 2000 br @0014
00C6 @0013:
191 1 while(begin_rec_buff==end_rec_buff); /* remain in loop while there is
00C6 @0014:
00C6 980506 R cmpb begin_rec_buff,end_rec_buff
00C9 DFFB be @0013
192 1 not a character avaliable. */
193 1 if(++begin_rec_buff>RECEIVE_BUF_SIZE - 1) /* make buffer appear */
00CB 1706 R incb begin_rec_buff
00CD 991306 R cmpb begin_rec_buff,#13H
00D0 DA02 ble @0016
194 1 begin_rec_buff=0; /* circular. */
00D2 1106 R clrb begin_rec_buff
00D4 @0016:
C196 Compiler wuximoto 28-Jun-107 11:05:25 Page 7
Assembly Listing of Object Code
195 1 return(receive_buff[begin_rec_buff]); /* return the character in
00D4 BC061C R ldbse Tmp0,begin_rec_buff
00D7 B31D14001C R ldb Tmp0,receive_buff[Tmp0]
00DC 2000 br @0012
196 1 buffer. */
197 1 }
00DE @0012:
00DE F0 ret
; Function Statistics for: getchar
; Code Size : 27 Parameter Count:
; Stack Size: Parameter Size :
; OReg Size : Stack Depth :
198
199 void receive(void) /* serial interrupt routine */
2 {
00DF receive:
00DF C800 R push ?OVRBASE
2 1 unsigned char c;
2 1 sp_status_image |= sp_stat; /* image sp_stat into status_image */
00E1 900002 E orb sp_status_image,sp_stat
2 1
2 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))
00E4 BC051C R ldbse Tmp0,end_rec_buff
00E7 071C inc Tmp0
00E9 BC061E R ldbse Tmp2,begin_rec_buff
00EC 881E1C cmp Tmp0,Tmp2
00EF DF0A be @0019
00F1 991305 R cmpb end_rec_buff,#13H
00F4 D707 bne @0018
00F6 980600 R cmpb R0,begin_rec_buff
00F9 D702 bne @0018
00FB @0019:
2 1 {
21 2 ; /* input overrun code */
211 2 }
212 1 else
00FB 20AB br @001A
00FD @0018:
213 1 {
214 2
215 2 /* The next statement makes the buffer circular by starting over when the
216 2 index reaches the end of the buffer. */
217 2
218 2 if(++end_rec_buff > RECEIVE_BUF_SIZE - 1) end_rec_buff=0;
00FD 1705 R incb end_rec_buff
00FF 991305 R cmpb end_rec_buff,#13H
0102 DA02 ble @001B
0104 1105 R clrb end_rec_buff
0106 @001B:
219 2 receive_buff[end_rec_buff]=sbuf; /* place character in
C196 Compiler wuximoto 28-Jun-107 11:05:25 Page 8
Assembly Listing of Object Code
0106 BC051C R ldbse Tmp0,end_rec_buff
0109 C71D140000 E stb sbuf,receive_buff[Tmp0]
22 2 buffer */
221 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)
010E B31D14001C R ldb Tmp0,receive_buff[Tmp0]
0113 99451C cmpb Tmp0,#45H
0116 D773 bne @001C
0118 BC051C R ldbse Tmp0,end_rec_buff
011B 6513001C add Tmp0,#13H
011F 061C ext Tmp0
0121 FE8D14001C div Tmp0,#14H
0126 9B1F140000 R cmpb R0,receive_buff[Tmp2]
012B D75E bne @001C
012D BC051C R ldbse Tmp0,end_rec_buff
0130 650F001C add Tmp0,#0FH
0134 061C ext Tmp0
0136 FE8D14001C div Tmp0,#14H
013B B31F14001E R ldb Tmp2,receive_buff[Tmp2]
0140 99531E cmpb Tmp2,#53H
0143 D746 bne @001C
222 2 {
223 3 triggle_in=1;
0145 B10103 R ldb triggle_in,#1
224 3 ++mess[9];
0148 B30109001C R ldb Tmp0,mess+9
014D 171C incb Tmp0
014F C70109001C R stb Tmp0,mess+9
225 3 pwm0_byte=receive_buff[(end_rec_buff+RECEIVE_BUF_SIZE-4)%RECEIVE_BUF_SIZE];
0154 BC051C R ldbse Tmp0,end_rec_buff
0157 4510001C20 add Tmp4,Tmp0,#1
015C 0620 ext Tmp4
015E FE8D140020 div Tmp4,#14H
0163 B323140007 R ldb pwm0_byte,receive_buff[Tmp6]
226 3 ioport1_byte=receive_buff[(end_rec_buff+RECEIVE_BUF_SIZE-3)%RECEIVE_BUF_SIZE];
0168 6511001C add Tmp0,#11H
016C 061C ext Tmp0
016E FE8D14001C div Tmp0,#14H
0173 B31F140008 R ldb ioport1_byte,receive_buff[Tmp2]
227 3 hso_byte=receive_buff[(end_rec_buff+RECEIVE_BUF_SIZE-2)%RECEIVE_BUF_SIZE];
0178 BC051C R ldbse Tmp0,end_rec_buff
017B 6512001C add Tmp0,#12H
017F 061C ext Tmp0
0181 FE8D14001C div Tmp0,#14H
0186 B31F140009 R ldb hso_byte,receive_buff[Tmp2]
018B @001C:
228 3 }
229 2 c=getchar(); //Discard a char,since now deal it in serial_in_interrupt.
018B 2F37 call getchar
018D B01C00 R ldb c,Tmp0
23 2 if(checkbit(sp_status_image, FE_BIT))
0190 5110021C R andb Tmp0,sp_status_image,#1
0194 981C00 cmpb R0,Tmp0
0197 DF03 be @001D
231 2 {
232 3 ; /* User code for framing error */
C196 Compiler wuximoto 28-Jun-107 11:05:25 Page 9
Assembly Listing of Object Code
233 3 clrbit(sp_status_image, FE_BIT);
0199 71EF02 R andb sp_status_image,#0EFH
019C @001D:
234 3 }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -