This is part of a demo / illustration of how C++ code can be used on microcontrollers.
Microcontroller in this example is Microchip 16F84, look for word processor.
This is the source code.
// test C prog for picc compiler
// 10:12 AM 3/12/2011
// 10:53 AM 3/12/2011
//extern int exti;
// extern void printf;
#define bsize 4
int board [bsize][bsize];
// extern func int putout(int s);
int y = 20;
int x = 100;
int funcmjh (int z) {
return (-(5 * z));
}
main() {
x = y ;
for ( x=y=3; (x+y)<20 ; x++, y--){
// x=exti;
y = funcmjh(x);
// putout(y);
// printf(&y);
}
for (x=0; x<(bsize+1); x++){
for (y=0; y<(bsize+1); y++){
board[x][y] = 0;
}
}
}
And this is the processed C++ code with assembler code displayed.
HI-TECH Software PIC LITE Macro Assembler V9.83 build 10920
Sun Jan 01 18:36:34 2012
HI-TECH Software Omniscient Code Generator (Lite mode) build 10920
1 0000 opt subtitle "HI-TECH Software Omniscient Code Generator (Lite mode) build 10920"
2
3 opt pagewidth 120
4
5 opt lm
6
7 processor 16F84
8 clrc macro
9 bcf 3,0
10 0000 endm
11 clrz macro
12 bcf 3,2
13 0000 endm
14 setc macro
15 bsf 3,0
16 0000 endm
17 setz macro
18 bsf 3,2
19 0000 endm
20 skipc macro
21 btfss 3,0
22 0000 endm
23 skipz macro
24 btfss 3,2
25 0000 endm
26 skipnc macro
27 btfsc 3,0
28 0000 endm
29 skipnz macro
30 btfsc 3,2
31 0000 endm
32 0000 indf equ 0
33 0000 indf0 equ 0
34 0002 pc equ 2
35 0002 pcl equ 2
36 0003 status equ 3
37 0004 fsr equ 4
38 0004 fsr0 equ 4
39 0001 c equ 1
40 0000 z equ 0
41 000A pclath equ 10
42 FNCALL _main,_funcmjh
43 FNCALL _funcmjh,___wmul
44 FNROOT _main
45 global _x
46 global _y
47 psect idataBANK0,class=CODE,space=0,delta=2
48 global __pidataBANK0
49 02F5 __pidataBANK0:
50 file "test1.c"
51 line 14
52
53 ;initializer for _x
54 02F5 3464 retlw 064h
55 02F6 3400 retlw 0
56
57 line 13
58
59 ;initializer for _y
60 02F7 3414 retlw 014h
61 02F8 3400 retlw 0
62
63 global _board
64 global _EEADR
65 0009 _EEADR set 9
66 global _EEDATA
67 0008 _EEDATA set 8
68 global _CARRY
69 0018 _CARRY set 24
70 global _GIE
71 005F _GIE set 95
72 global _EECON1
73 0088 _EECON1 set 136
74 global _EECON2
75 0089 _EECON2 set 137
76 global _RD
77 0440 _RD set 1088
78 global _WR
79 0441 _WR set 1089
80 global _WREN
81 0442 _WREN set 1090
82 file "test1.as"
83 line #
84 psect cinit,class=CODE,delta=2
85 global start_initialization
86 0301 start_initialization:
87
88 psect bssBANK0,class=BANK0,space=1
89 global __pbssBANK0
90 000C __pbssBANK0:
91 000C _board:
92 000C ds 32
93
94 psect dataBANK0,class=BANK0,space=1
95 global __pdataBANK0
96 003A __pdataBANK0:
97 file "test1.c"
98 line 14
99 003A _x:
100 003A ds 2
101
102 psect dataBANK0
103 file "test1.c"
104 line 13
105 003C _y:
106 003C ds 2
107
108 psect clrtext,class=CODE,delta=2
109 global clear_ram
110 ; Called with FSR containing the base address, and
111 ; W with the last address+1
112 02F9 clear_ram:
113 02F9 0064 clrwdt ;clear the watchdog before getting into this loop
114 02FA clrloop:
115 02FA 0180 clrf indf ;clear RAM location pointed to by FSR
116 02FB 0A84 incf fsr,f ;increment pointer
117 02FC 0604 xorwf fsr,w ;XOR with final address
118 02FD 1903 btfsc status,2 ;have we reached the end yet?
119 02FE 3400 retlw 0 ;all done for this memory range, return
120 02FF 0604 xorwf fsr,w ;XOR again to restore value
121 0300 2AFA goto clrloop ;do the next byte
122
123 ; Clear objects allocated to BANK0
124 psect cinit,class=CODE,delta=2
125 0301 1383 bcf status, 7 ;select IRP bank0
126 0302 300C movlw low(__pbssBANK0)
127 0303 0084 movwf fsr
128 0304 302C movlw low((__pbssBANK0)+020h)
129 0305 22F9 fcall clear_ram
130 ; Initialize objects allocated to BANK0
131 global __pidataBANK0
132 psect cinit,class=CODE,delta=2
133 0306 22F5 fcall __pidataBANK0+0 ;fetch initializer
134 0307 00BA movwf __pdataBANK0+0&07fh
135 0308 22F6 fcall __pidataBANK0+1 ;fetch initializer
136 0309 00BB movwf __pdataBANK0+1&07fh
137 030A 22F7 fcall __pidataBANK0+2 ;fetch initializer
138 030B 00BC movwf __pdataBANK0+2&07fh
139 030C 22F8 fcall __pidataBANK0+3 ;fetch initializer
140 030D 00BD movwf __pdataBANK0+3&07fh
141 psect cinit,class=CODE,delta=2
142 global end_of_initialization
143
144 ;End of C runtime variable initialization code
145
146 030E end_of_initialization:
147 030E 0183 clrf status
148 030F 2B55 ljmp _main ;jump to C main() function
149 psect cstackCOMMON,class=COMMON,space=1
150 global __pcstackCOMMON
151 0000 __pcstackCOMMON:
152 global ??___wmul
153 0000 ??___wmul: ; 0 bytes @ 0x0
154 psect cstackBANK0,class=BANK0,space=1
155 global __pcstackBANK0
156 002C __pcstackBANK0:
157 global ?_main
158 002C ?_main: ; 2 bytes @ 0x0
159 global ?___wmul
160 002C ?___wmul: ; 2 bytes @ 0x0
161 global ___wmul@multiplier
162 002C ___wmul@multiplier: ; 2 bytes @ 0x0
163 002C ds 2
164 global ___wmul@multiplicand
165 002E ___wmul@multiplicand: ; 2 bytes @ 0x2
166 002E ds 2
167 global ___wmul@product
168 0030 ___wmul@product: ; 2 bytes @ 0x4
169 0030 ds 2
170 global ?_funcmjh
171 0032 ?_funcmjh: ; 2 bytes @ 0x6
172 global funcmjh@z
173 0032 funcmjh@z: ; 2 bytes @ 0x6
174 0032 ds 2
175 global ??_funcmjh
176 0034 ??_funcmjh: ; 0 bytes @ 0x8
177 0034 ds 2
178 global ??_main
179 0036 ??_main: ; 0 bytes @ 0xA
180 0036 ds 4
181 ;;Data sizes: Strings 0, constant 0, data 4, bss 32, persistent 0 stack 0
182 ;;Auto spaces: Size Autos Used
183 ;; COMMON 0 0 0
184 ;; BANK0 66 14 50
185
186 ;;
187 ;; Pointer list with targets:
188
189 ;; ?_funcmjh int size(1) Largest target is 0
190 ;;
191 ;; ?___wmul unsigned int size(1) Largest target is 0
192 ;;
193
194
195 ;;
196 ;; Critical Paths under _main in COMMON
197 ;;
198 ;; None.
199 ;;
200 ;; Critical Paths under _main in BANK0
201 ;;
202 ;; _main->_funcmjh
203 ;; _funcmjh->___wmul
204
205 ;;
206 ;;Main: autosize = 0, tempsize = 4, incstack = 0, save=0
207 ;;
208
209 ;;
210 ;;Call Graph Tables:
211 ;;
212 ;; ---------------------------------------------------------------------------------
213 ;; (Depth) Function Calls Base Space Used Autos Params Refs
214 ;; ---------------------------------------------------------------------------------
215 ;; (0) _main 4 4 0 114
216 ;; 10 BANK0 4 4 0
217 ;; _funcmjh
218 ;; ---------------------------------------------------------------------------------
219 ;; (1) _funcmjh 4 2 2 114
220 ;; 6 BANK0 4 2 2
221 ;; ___wmul
222 ;; ---------------------------------------------------------------------------------
223 ;; (2) ___wmul 6 2 4 92
224 ;; 0 BANK0 6 2 4
225 ;; ---------------------------------------------------------------------------------
226 ;; Estimated maximum stack depth 2
227 ;; ---------------------------------------------------------------------------------
228
229 ;; Call Graph Graphs:
230
231 ;; _main (ROOT)
232 ;; _funcmjh
233 ;; ___wmul
234 ;;
235
236 ;; Address spaces:
237
238 ;;Name Size Autos Total Cost Usage
239 ;;SFR1 0 0 0 2 0.0%
240 ;;BITSFR1 0 0 0 2 0.0%
241 ;;CODE 0 0 0 0 0.0%
242 ;;DATA 0 0 34 6 0.0%
243 ;;ABS 0 0 32 4 0.0%
244 ;;NULL 0 0 0 0 0.0%
245 ;;STACK 0 0 2 2 0.0%
246 ;;BANK0 42 E 32 3 75.8%
247 ;;BITBANK0 42 0 0 5 0.0%
248 ;;SFR0 0 0 0 1 0.0%
249 ;;BITSFR0 0 0 0 1 0.0%
250 ;;COMMON 0 0 0 1 0.0%
251 ;;BITCOMMON 0 0 0 0 0.0%
252 ;;EEDATA 40 0 0 0 0.0%
253
254 global _main
255 psect maintext,global,class=CODE,delta=2
256 global __pmaintext
257 0355 __pmaintext:
258
259 ;; *************** function _main *****************
260 ;; Defined at:
261 ;; line 22 in file "test1.c"
262 ;; Parameters: Size Location Type
263 ;; None
264 ;; Auto vars: Size Location Type
265 ;; None
266 ;; Return value: Size Location Type
267 ;; 2 11[BANK0 ] int
268 ;; Registers used:
269 ;; wreg, fsr0l, fsr0h, status,2, status,0, btemp+1, pclath, cstack
270 ;; Tracked objects:
271 ;; On entry : 17F/0
272 ;; On exit : 0/0
273 ;; Unchanged: 0/0
274 ;; Data sizes: COMMON BANK0
275 ;; Params: 0 0
276 ;; Locals: 0 0
277 ;; Temps: 0 4
278 ;; Totals: 0 4
279 ;;Total ram usage: 4 bytes
280 ;; Hardware stack levels required when called: 2
281 ;; This function calls:
282 ;; _funcmjh
283 ;; This function is called by:
284 ;; Startup code after reset
285 ;; This function uses a non-reentrant model
286 ;;
287 psect maintext
288 file "test1.c"
289 line 22
290 global __size_of_main
291 00AB __size_of_main equ __end_of_main-_main
292
293 0355 _main:
294 opt stack 6
295 ; Regs used in _main: [wreg-fsr0h+status,2+status,0+btemp+1+pclath+cstack]
296 line 26
297
298 0355 l1530:
299 ;test1.c: 26: x = y ;
300 0355 1283 bcf status, 5 ;RP0=0, select bank0
301 0356 083D movf (_y+1),w
302 0357 01BB clrf (_x+1)
303 0358 07BB addwf (_x+1)
304 0359 083C movf (_y),w
305 035A 01BA clrf (_x)
306 035B 07BA addwf (_x)
307
308 line 28
309 ;test1.c: 28: for ( x=y=3; (x+y)<20 ; x++, y--){
310 035C 3003 movlw low(03h)
311 035D 00BC movwf (_y)
312 035E 3000 movlw high(03h)
313 035F 00BD movwf ((_y))+1
314 0360 083D movf ((_y+1)),w
315 0361 01BB clrf (_x+1)
316 0362 07BB addwf (_x+1)
317 0363 083C movf ((_y)),w
318 0364 01BA clrf (_x)
319 0365 07BA addwf (_x)
320
321 0366 2B83 goto l1538
322
323 0367 l13:
324 line 30
325
326 0367 l1532:
327 ;test1.c: 30: y = funcmjh(x);
328 0367 1283 bcf status, 5 ;RP0=0, select bank0
329 0368 083B movf (_x+1),w
330 0369 01B3 clrf (?_funcmjh+1)
331 036A 07B3 addwf (?_funcmjh+1)
332 036B 083A movf (_x),w
333 036C 01B2 clrf (?_funcmjh)
334 036D 07B2 addwf (?_funcmjh)
335
336 036E 2310 fcall _funcmjh
337 036F 1283 bcf status, 5 ;RP0=0, select bank0
338 0370 0833 movf (1+(?_funcmjh)),w
339 0371 01BD clrf (_y+1)
340 0372 07BD addwf (_y+1)
341 0373 0832 movf (0+(?_funcmjh)),w
342 0374 01BC clrf (_y)
343 0375 07BC addwf (_y)
344
345 line 28
346
347 0376 l1534:
348 0376 3001 movlw low(01h)
349 0377 07BA addwf (_x),f
350 0378 1803 skipnc
351 0379 0ABB incf (_x+1),f
352 037A 3000 movlw high(01h)
353 037B 07BB addwf (_x+1),f
354
355 037C l1536:
356 037C 30FF movlw low(-1)
357 037D 07BC addwf (_y),f
358 037E 1803 skipnc
359 037F 0ABD incf (_y+1),f
360 0380 30FF movlw high(-1)
361 0381 07BD addwf (_y+1),f
362 0382 2B83 goto l1538
363
364 0383 l12:
365
366 0383 l1538:
367 0383 083C movf (_y),w
368 0384 073A addwf (_x),w
369 0385 00B6 movwf (??_main+0)+0
370 0386 083D movf (_y+1),w
371 0387 1803 skipnc
372 0388 0A3D incf (_y+1),w
373 0389 073B addwf (_x+1),w
374 038A 00B7 movwf 1+(??_main+0)+0
375 038B 0837 movf 1+(??_main+0)+0,w
376 038C 3A80 xorlw 80h
377 038D 00CF movwf btemp+1
378 038E 3080 movlw (high(014h))^80h
379 038F 024F subwf btemp+1,w
380 0390 1D03 skipz
381 0391 2B94 goto u2325
382 0392 3014 movlw low(014h)
383 0393 0236 subwf 0+(??_main+0)+0,w
384 0394 u2325:
385
386 0394 1C03 skipc
387 0395 2B97 goto u2321
388 0396 2B98 goto u2320
389 0397 u2321:
390 0397 2B67 goto l1532
391 0398 u2320:
392 0398 2B99 goto l1540
393
394 0399 l14:
395 line 36
396
397 0399 l1540:
398 ;test1.c: 34: }
399 ;test1.c: 36: for (x=0; x<(4+1); x++){
400 0399 1283 bcf status, 5 ;RP0=0, select bank0
401 039A 01BA clrf (_x)
402 039B 01BB clrf (_x+1)
403
404 039C l1542:
405 039C 083B movf (_x+1),w
406 039D 3A80 xorlw 80h
407 039E 00CF movwf btemp+1
408 039F 3080 movlw (high(05h))^80h
409 03A0 024F subwf btemp+1,w
410 03A1 1D03 skipz
411 03A2 2BA5 goto u2335
412 03A3 3005 movlw low(05h)
413 03A4 023A subwf (_x),w
414 03A5 u2335:
415
416 03A5 1C03 skipc
417 03A6 2BA8 goto u2331
418 03A7 2BA9 goto u2330
419 03A8 u2331:
420 03A8 2BAB goto l1546
421 03A9 u2330:
422 03A9 2BFF goto l19
423
424 03AA l1544:
425 03AA 2BFF goto l19
426
427 03AB l15:
428 line 37
429
430 03AB l1546:
431 ;test1.c: 37: for (y=0; y<(4+1); y++){
432 03AB 1283 bcf status, 5 ;RP0=0, select bank0
433 03AC 01BC clrf (_y)
434 03AD 01BD clrf (_y+1)
435
436 03AE l1548:
437 03AE 083D movf (_y+1),w
438 03AF 3A80 xorlw 80h
439 03B0 00CF movwf btemp+1
440 03B1 3080 movlw (high(05h))^80h
441 03B2 024F subwf btemp+1,w
442 03B3 1D03 skipz
443 03B4 2BB7 goto u2345
444 03B5 3005 movlw low(05h)
445 03B6 023C subwf (_y),w
446 03B7 u2345:
447
448 03B7 1C03 skipc
449 03B8 2BBA goto u2341
450 03B9 2BBB goto u2340
451 03BA u2341:
452 03BA 2BBD goto l1552
453 03BB u2340:
454 03BB 2BEA goto l1558
455
456 03BC l1550:
457 03BC 2BEA goto l1558
458
459 03BD l17:
460 line 38
461
462 03BD l1552:
463 ;test1.c: 38: board[x][y] = 0;
464 03BD 1283 bcf status, 5 ;RP0=0, select bank0
465 03BE 083A movf (_x),w
466 03BF 00B6 movwf (??_main+0)+0
467 03C0 3003 movlw 03h
468 03C1 u2355:
469 03C1 1003 clrc
470 03C2 0DB6 rlf (??_main+0)+0,f
471 03C3 3EFF addlw -1
472 03C4 1D03 skipz
473 03C5 2BC1 goto u2355
474 03C6 300C movlw (_board)&0ffh
475 03C7 0736 addwf 0+(??_main+0)+0,w
476 03C8 00B7 movwf (??_main+1)+0
477 03C9 083C movf (_y),w
478 03CA 00B8 movwf (??_main+2)+0
479 03CB 0738 addwf (??_main+2)+0,w
480 03CC 0737 addwf 0+(??_main+1)+0,w
481 03CD 00B9 movwf (??_main+3)+0
482 03CE 0839 movf 0+(??_main+3)+0,w
483 03CF 0084 movwf fsr0
484 03D0 3000 movlw low(0)
485 03D1 1383 bcf status, 7 ;select IRP bank0
486 03D2 0080 movwf indf
487 03D3 0A84 incf fsr0,f
488 03D4 3000 movlw high(0)
489 03D5 0080 movwf indf
490 line 37
491
492 03D6 l1554:
493 03D6 3001 movlw low(01h)
494 03D7 07BC addwf (_y),f
495 03D8 1803 skipnc
496 03D9 0ABD incf (_y+1),f
497 03DA 3000 movlw high(01h)
498 03DB 07BD addwf (_y+1),f
499
500 03DC l1556:
501 03DC 083D movf (_y+1),w
502 03DD 3A80 xorlw 80h
503 03DE 00CF movwf btemp+1
504 03DF 3080 movlw (high(05h))^80h
505 03E0 024F subwf btemp+1,w
506 03E1 1D03 skipz
507 03E2 2BE5 goto u2365
508 03E3 3005 movlw low(05h)
509 03E4 023C subwf (_y),w
510 03E5 u2365:
511
512 03E5 1C03 skipc
513 03E6 2BE8 goto u2361
514 03E7 2BE9 goto u2360
515 03E8 u2361:
516 03E8 2BBD goto l1552
517 03E9 u2360:
518 03E9 2BEA goto l1558
519
520 03EA l18:
521 line 36
522
523 03EA l1558:
524 03EA 3001 movlw low(01h)
525 03EB 1283 bcf status, 5 ;RP0=0, select bank0
526 03EC 07BA addwf (_x),f
527 03ED 1803 skipnc
528 03EE 0ABB incf (_x+1),f
529 03EF 3000 movlw high(01h)
530 03F0 07BB addwf (_x+1),f
531
532 03F1 l1560:
533 03F1 083B movf (_x+1),w
534 03F2 3A80 xorlw 80h
535 03F3 00CF movwf btemp+1
536 03F4 3080 movlw (high(05h))^80h
537 03F5 024F subwf btemp+1,w
538 03F6 1D03 skipz
539 03F7 2BFA goto u2375
540 03F8 3005 movlw low(05h)
541 03F9 023A subwf (_x),w
542 03FA u2375:
543
544 03FA 1C03 skipc
545 03FB 2BFD goto u2371
546 03FC 2BFE goto u2370
547 03FD u2371:
548 03FD 2BAB goto l1546
549 03FE u2370:
550 03FE 2BFF goto l19
551
552 03FF l16:
553 line 44
554
555 03FF l19:
556 global start
557 03FF 2800 ljmp start
558 opt stack 0
559 GLOBAL __end_of_main
560 0400 __end_of_main:
561 ;; =============== function _main ends ============
562
563 signat _main,90
564 global _funcmjh
565 psect text164,local,class=CODE,delta=2
566 global __ptext164
567 0310 __ptext164:
568
569 ;; *************** function _funcmjh *****************
570 ;; Defined at:
571 ;; line 16 in file "test1.c"
572 ;; Parameters: Size Location Type
573 ;; z 2 6[BANK0 ] int
574 ;; Auto vars: Size Location Type
575 ;; None
576 ;; Return value: Size Location Type
577 ;; 2 6[BANK0 ] int
578 ;; Registers used:
579 ;; wreg, status,2, status,0, pclath, cstack
580 ;; Tracked objects:
581 ;; On entry : 0/0
582 ;; On exit : 0/0
583 ;; Unchanged: 0/0
584 ;; Data sizes: COMMON BANK0
585 ;; Params: 0 2
586 ;; Locals: 0 0
587 ;; Temps: 0 2
588 ;; Totals: 0 4
589 ;;Total ram usage: 4 bytes
590 ;; Hardware stack levels used: 1
591 ;; Hardware stack levels required when called: 1
592 ;; This function calls:
593 ;; ___wmul
594 ;; This function is called by:
595 ;; _main
596 ;; This function uses a non-reentrant model
597 ;;
598 psect text164
599 file "test1.c"
600 line 16
601 global __size_of_funcmjh
602 001A __size_of_funcmjh equ __end_of_funcmjh-_funcmjh
603
604 0310 _funcmjh:
605 opt stack 6
606 ; Regs used in _funcmjh: [wreg+status,2+status,0+pclath+cstack]
607 line 17
608
609 0310 l1526:
610 ;test1.c: 17: return (-(5 * z));
611 0310 1283 bcf status, 5 ;RP0=0, select bank0
612 0311 0833 movf (funcmjh@z+1),w
613 0312 01AD clrf (?___wmul+1)
614 0313 07AD addwf (?___wmul+1)
615 0314 0832 movf (funcmjh@z),w
616 0315 01AC clrf (?___wmul)
617 0316 07AC addwf (?___wmul)
618
619 0317 3005 movlw low(05h)
620 0318 00AE movwf 0+(?___wmul)+02h
621 0319 3000 movlw high(05h)
622 031A 00AF movwf (0+(?___wmul)+02h)+1
623 031B 232A fcall ___wmul
624 031C 1283 bcf status, 5 ;RP0=0, select bank0
625 031D 092C comf (0+(?___wmul)),w
626 031E 00B4 movwf (??_funcmjh+0)+0
627 031F 092D comf (1+(?___wmul)),w
628 0320 00B5 movwf ((??_funcmjh+0)+0+1)
629 0321 0AB4 incf (??_funcmjh+0)+0,f
630 0322 1903 skipnz
631 0323 0AB5 incf ((??_funcmjh+0)+0+1),f
632 0324 0834 movf 0+(??_funcmjh+0)+0,w
633 0325 00B2 movwf (?_funcmjh)
634 0326 0835 movf 1+(??_funcmjh+0)+0,w
635 0327 00B3 movwf (?_funcmjh+1)
636 0328 2B29 goto l9
637
638 0329 l1528:
639 line 18
640
641 0329 l9:
642 0329 0008 return
643 opt stack 0
644 GLOBAL __end_of_funcmjh
645 032A __end_of_funcmjh:
646 ;; =============== function _funcmjh ends ============
647
648 signat _funcmjh,4218
649 global ___wmul
650 psect text165,local,class=CODE,delta=2
651 global __ptext165
652 032A __ptext165:
653
654 ;; *************** function ___wmul *****************
655 ;; Defined at:
656 ;; line 3 in file "C:\Program Files\HI-TECH Software\PICC\9.83\sources\wmul.c"
657 ;; Parameters: Size Location Type
658 ;; multiplier 2 0[BANK0 ] unsigned int
659 ;; multiplicand 2 2[BANK0 ] unsigned int
660 ;; Auto vars: Size Location Type
661 ;; product 2 4[BANK0 ] unsigned int
662 ;; Return value: Size Location Type
663 ;; 2 0[BANK0 ] unsigned int
664 ;; Registers used:
665 ;; wreg, status,2, status,0
666 ;; Tracked objects:
667 ;; On entry : 0/0
668 ;; On exit : 0/0
669 ;; Unchanged: 0/0
670 ;; Data sizes: COMMON BANK0
671 ;; Params: 0 4
672 ;; Locals: 0 2
673 ;; Temps: 0 0
674 ;; Totals: 0 6
675 ;;Total ram usage: 6 bytes
676 ;; Hardware stack levels used: 1
677 ;; This function calls:
678 ;; Nothing
679 ;; This function is called by:
680 ;; _funcmjh
681 ;; This function uses a non-reentrant model
682 ;;
683 psect text165
684 file "C:\Program Files\HI-TECH Software\PICC\9.83\sources\wmul.c"
685 line 3
686 global __size_of___wmul
687 002B __size_of___wmul equ __end_of___wmul-___wmul
688
689 032A ___wmul:
690 opt stack 6
691 ; Regs used in ___wmul: [wreg+status,2+status,0]
692 line 4
693
694 032A l1514:
695 032A 1283 bcf status, 5 ;RP0=0, select bank0
696 032B 01B0 clrf (___wmul@product)
697 032C 01B1 clrf (___wmul@product+1)
698 032D 2B2E goto l1516
699 line 6
700
701 032E l236:
702 line 7
703
704 032E l1516:
705 032E 1C2C btfss (___wmul@multiplier),(0)&7
706 032F 2B31 goto u2281
707 0330 2B32 goto u2280
708 0331 u2281:
709 0331 2B38 goto l237
710 0332 u2280:
711 line 8
712
713 0332 l1518:
714 0332 082E movf (___wmul@multiplicand),w
715 0333 07B0 addwf (___wmul@product),f
716 0334 1803 skipnc
717 0335 0AB1 incf (___wmul@product+1),f
718 0336 082F movf (___wmul@multiplicand+1),w
719 0337 07B1 addwf (___wmul@product+1),f
720
721 0338 l237:
722 line 9
723 0338 3001 movlw 01h
724
725 0339 u2295:
726 0339 1003 clrc
727 033A 0DAE rlf (___wmul@multiplicand),f
728 033B 0DAF rlf (___wmul@multiplicand+1),f
729 033C 3EFF addlw -1
730 033D 1D03 skipz
731 033E 2B39 goto u2295
732 line 10
733
734 033F l1520:
735 033F 3001 movlw 01h
736
737 0340 u2305:
738 0340 1003 clrc
739 0341 0CAD rrf (___wmul@multiplier+1),f
740 0342 0CAC rrf (___wmul@multiplier),f
741 0343 3EFF addlw -1
742 0344 1D03 skipz
743 0345 2B40 goto u2305
744 line 11
745 0346 082D movf ((___wmul@multiplier+1)),w
746 0347 042C iorwf ((___wmul@multiplier)),w
747 0348 1D03 skipz
748 0349 2B4B goto u2311
749 034A 2B4C goto u2310
750 034B u2311:
751 034B 2B2E goto l1516
752 034C u2310:
753 034C 2B4D goto l1522
754
755 034D l238:
756 line 12
757
758 034D l1522:
759 034D 0831 movf (___wmul@product+1),w
760 034E 01AD clrf (?___wmul+1)
761 034F 07AD addwf (?___wmul+1)
762 0350 0830 movf (___wmul@product),w
763 0351 01AC clrf (?___wmul)
764 0352 07AC addwf (?___wmul)
765
766 0353 2B54 goto l239
767
768 0354 l1524:
769 line 13
770
771 0354 l239:
772 0354 0008 return
773 opt stack 0
774 GLOBAL __end_of___wmul
775 0355 __end_of___wmul:
776 ;; =============== function ___wmul ends ============
777
778 signat ___wmul,8314
779 psect text166,local,class=CODE,delta=2
780 global __ptext166
781 0000 __ptext166:
782 global btemp
783 004E btemp set 04Eh
784
785 DABS 1,78,2 ;btemp
786 global wtemp0
787 004E wtemp0 set btemp
HI-TECH Software PICC Macro Assembler V9.83 build 10920
Symbol Table Sun Jan 01 18:36:34 2012
l9 0329 _x 003A _y 003C l12 0383
l13 0367 l14 0399 l15 03AB l16 03FF
l17 03BD l18 03EA l19 03FF _RD 0440
_WR 0441 fsr 0004 ___wmul@multiplicand 002E l236 032E
l237 0338 l238 034D l239 0354 _GIE 005F
fsr0 0004 indf 0000 l1520 033F l1522 034D
l1514 032A l1530 0355 l1524 0354 l1516 032E
l1540 0399 l1532 0367 l1518 0332 l1526 0310
l1550 03BC l1542 039C l1534 0376 l1528 0329
l1560 03F1 l1552 03BD l1544 03AA l1536 037C
l1554 03D6 l1546 03AB l1538 0383 l1556 03DC
l1548 03AE l1558 03EA u2310 034C u2311 034B
u2320 0398 u2305 0340 u2321 0397 u2330 03A9
u2331 03A8 u2340 03BB u2341 03BA u2325 0394
u2335 03A5 u2280 0332 u2360 03E9 u2281 0331
u2361 03E8 u2345 03B7 u2370 03FE u2371 03FD
u2355 03C1 u2365 03E5 u2295 0339 u2375 03FA
_WREN 0442 _main 0355 btemp 004E start 0000
?_main 002C _EEADR 0009 _CARRY 0018 _board 000C
__end_of_funcmjh 032A status 0003 wtemp0 004E __end_of_main 0400
??_main 0036 _EEDATA 0008 _EECON1 0088 _EECON2 0089
___wmul 032A clrloop 02FA ??_funcmjh 0034 __pcstackCOMMON 0000
__pidataBANK0 02F5 __pbssBANK0 000C __pmaintext 0355 ?___wmul 002C
__size_of___wmul 002B _funcmjh 0310 end_of_initialization 030E __end_of___wmul 0355
start_initialization 0301 ??___wmul 0000 __pdataBANK0 003A __pcstackBANK0 002C
__ptext164 0310 __ptext165 032A __ptext166 0000 ?_funcmjh 0032
___wmul@product 0030 ___wmul@multiplier 002C __size_of_funcmjh 001A __size_of_main 00AB
clear_ram 02F9 funcmjh@z 0032