1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
|
Microchip Technology PIC18 LITE Macro Assembler V1.44 build -154322312
Thu Feb 22 10:47:56 2018
Microchip Technology Omniscient Code Generator v1.44 (Free mode) build 201709140600
1 processor 18F45K22
2 fnconf rparam,??,?,0
3 opt pw 120
4 opt lm
5 psect cinit,global,reloc=2,class=CODE,delta=1
6 psect cstackCOMRAM,global,class=COMRAM,space=1,delta=1,noexec
7 psect text0,global,reloc=2,class=CODE,delta=1
8 psect text1,global,reloc=2,class=CODE,delta=1
9 psect text2,global,reloc=2,class=CODE,delta=1
10 psect text3,global,reloc=2,class=CODE,delta=1
11 psect text4,global,reloc=2,class=CODE,delta=1
12 psect text5,global,reloc=2,class=CODE,delta=1
13 psect text6,global,reloc=2,class=CODE,delta=1
14 psect intsave_regs,global,class=BIGRAM,space=1,delta=1,noexec
15 psect rparam,global,class=COMRAM,space=1,delta=1,noexec
16 0000
17 ; Version 1.44
18 ; Generated 14/09/2017 GMT
19 ;
20 ; Copyright © 2017, Microchip Technology Inc. and its subsidiaries ("Microchip")
21 ; All rights reserved.
22 ;
23 ; This software is developed by Microchip Technology Inc. and its subsidiaries ("Microch
+ ip").
24 ;
25 ; Redistribution and use in source and binary forms, with or without modification, are
26 ; permitted provided that the following conditions are met:
27 ;
28 ; 1. Redistributions of source code must retain the above copyright notice, this lis
+ t of
29 ; conditions and the following disclaimer.
30 ;
31 ; 2. Redistributions in binary form must reproduce the above copyright notice, this
+ list
32 ; of conditions and the following disclaimer in the documentation and/or other
33 ; materials provided with the distribution.
34 ;
35 ; 3. Microchip's name may not be used to endorse or promote products derived from th
+ is
36 ; software without specific prior written permission.
37 ;
38 ; THIS SOFTWARE IS PROVIDED BY MICROCHIP "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
39 ; INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS F
+ OR
40 ; PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MICROCHIP BE LIABLE FOR ANY DIRECT, INDIREC
+ T,
41 ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING BUT NOT LIMITED TO
42 ; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA OR PROFITS; OR BUSINESS
43 ; INTERRUPTION) HOWSOEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, ST
+ RICT
44 ; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE U
+ SE OF
45 ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
46 ;
47 ;
48 ; Code-generator required, PIC18F45K22 Definitions
49 ;
50 ; SFR Addresses
51 0000 _RCREG set 4014
52 0000 _TXREG set 4013
53 0000 _BAUDCONbits set 4024
54 0000 _SPBRG set 4015
55 0000 _RCSTAbits set 4011
56 0000 _TXSTAbits set 4012
57 0000 _RCIF set 31989
58 0000 _TXIF set 31988
59 0000 _TRISC6 set 31910
60 0000 _TRISC7 set 31911
61
62 ; #config settings
63 0000
64 psect cinit
65 007E60 __pcinit:
66 opt stack 0
67 007E60 start_initialization:
68 opt stack 0
69 007E60 __initialization:
70 opt stack 0
71 007E60 end_of_initialization:
72 opt stack 0
73 007E60 __end_of__initialization:
74 opt stack 0
75 007E60 0100 movlb 0
76 007E62 EF6A F03F goto _main ;jump to C main() function
77
78 psect cstackCOMRAM
79 000001 __pcstackCOMRAM:
80 opt stack 0
81 000001 putch@c:
82 opt stack 0
83 000001 midi_set_status@pkt:
84 opt stack 0
85 000001 midi_set_channel@pkt:
86 opt stack 0
87
88 ; 2 bytes @ 0x0
89 000001 ds 1
90 000002 eusart_write_midi@pkt:
91 opt stack 0
92
93 ; 2 bytes @ 0x1
94 000002 ds 1
95 000003 midi_set_status@status:
96 opt stack 0
97 000003 midi_set_channel@channel:
98 opt stack 0
99
100 ; 2 bytes @ 0x2
101 000003 ds 1
102 000004 ??_eusart_write_midi:
103 000004 ??_midi_set_status:
104
105 ; 1 bytes @ 0x3
106 000004 ds 1
107 000005 ??_midi_set_channel:
108
109 ; 1 bytes @ 0x4
110 000005 ds 1
111 000006 eusart_write_midi@length:
112 opt stack 0
113 000006 midi_note_on@pkt:
114 opt stack 0
115
116 ; 2 bytes @ 0x5
117 000006 ds 2
118 000008 eusart_write_midi@data:
119 opt stack 0
120 000008 midi_note_on@channel:
121 opt stack 0
122
123 ; 2 bytes @ 0x7
124 000008 ds 2
125 00000A midi_note_on@note:
126 opt stack 0
127
128 ; 1 bytes @ 0x9
129 00000A ds 1
130 00000B midi_note_on@velocity:
131 opt stack 0
132
133 ; 1 bytes @ 0xA
134 00000B ds 1
135 00000C ??_midi_note_on:
136
137 ; 1 bytes @ 0xB
138 00000C ds 2
139 00000E main@sample_message:
140 opt stack 0
141
142 ; 7 bytes @ 0xD
143 00000E ds 7
144
145 ;;
146 ;;Main: autosize = 0, tempsize = 0, incstack = 0, save=0
147 ;;
148 ;; *************** function _main *****************
149 ;; Defined at:
150 ;; line 105 in file "main.c"
151 ;; Parameters: Size Location Type
152 ;; None
153 ;; Auto vars: Size Location Type
154 ;; sample_messa 7 13[COMRAM] struct .
155 ;; Return value: Size Location Type
156 ;; 1 wreg void
157 ;; Registers used:
158 ;; wreg, fsr2l, fsr2h, status,2, status,0, cstack
159 ;; Tracked objects:
160 ;; On entry : 0/0
161 ;; On exit : 0/0
162 ;; Unchanged: 0/0
163 ;; Data sizes: COMRAM BANK0 BANK1 BANK2 BANK3 BANK4 BANK5
164 ;; Params: 0 0 0 0 0 0 0
165 ;; Locals: 7 0 0 0 0 0 0
166 ;; Temps: 0 0 0 0 0 0 0
167 ;; Totals: 7 0 0 0 0 0 0
168 ;;Total ram usage: 7 bytes
169 ;; Hardware stack levels required when called: 2
170 ;; This function calls:
171 ;; _eusart_init
172 ;; _eusart_write_midi
173 ;; _midi_note_on
174 ;; This function is called by:
175 ;; Startup code after reset
176 ;; This function uses a non-reentrant model
177 ;;
178
179 psect text0
180 007ED4 __ptext0:
181 opt stack 0
182 007ED4 _main:
183 opt stack 29
184
185 ;main.c: 107: midi_message_t sample_message;
186 ;main.c: 108: midi_note_on(&sample_message, 0x0, 0x3C, 0x7F);
187
188 ;incstack = 0
189 007ED4 0E0E movlw low main@sample_message
190 007ED6 6E06 movwf midi_note_on@pkt,c
191 007ED8 0E00 movlw high main@sample_message
192 007EDA 6E07 movwf midi_note_on@pkt+1,c
193 007EDC 0E00 movlw 0
194 007EDE 6E09 movwf midi_note_on@channel+1,c
195 007EE0 0E00 movlw 0
196 007EE2 6E08 movwf midi_note_on@channel,c
197 007EE4 0E3C movlw 60
198 007EE6 6E0A movwf midi_note_on@note,c
199 007EE8 0E7F movlw 127
200 007EEA 6E0B movwf midi_note_on@velocity,c
201 007EEC EC81 F03F call _midi_note_on ;wreg free
202
203 ;main.c: 110: eusart_init();
204 007EF0 EC39 F03F call _eusart_init ;wreg free
205 007EF4
206 ;main.c: 114: eusart_write_midi(&sample_message);
207 007EF4 0E0E movlw low main@sample_message
208 007EF6 6E02 movwf eusart_write_midi@pkt,c
209 007EF8 0E00 movlw high main@sample_message
210 007EFA 6E03 movwf eusart_write_midi@pkt+1,c
211 007EFC ECBC F03F call _eusart_write_midi ;wreg free
212 007F00 D7F9 goto l19
213 007F02 __end_of_main:
214 opt stack 0
215
216 ;; *************** function _midi_note_on *****************
217 ;; Defined at:
218 ;; line 64 in file "midi.c"
219 ;; Parameters: Size Location Type
220 ;; pkt 2 5[COMRAM] PTR struct .
221 ;; -> main@sample_message(7),
222 ;; channel 2 7[COMRAM] unsigned int
223 ;; note 1 9[COMRAM] enum E31
224 ;; velocity 1 10[COMRAM] unsigned char
225 ;; Auto vars: Size Location Type
226 ;; None
227 ;; Return value: Size Location Type
228 ;; 2 5[COMRAM] int
229 ;; Registers used:
230 ;; wreg, fsr2l, fsr2h, status,2, status,0, cstack
231 ;; Tracked objects:
232 ;; On entry : 0/0
233 ;; On exit : 0/0
234 ;; Unchanged: 0/0
235 ;; Data sizes: COMRAM BANK0 BANK1 BANK2 BANK3 BANK4 BANK5
236 ;; Params: 6 0 0 0 0 0 0
237 ;; Locals: 0 0 0 0 0 0 0
238 ;; Temps: 2 0 0 0 0 0 0
239 ;; Totals: 8 0 0 0 0 0 0
240 ;;Total ram usage: 8 bytes
241 ;; Hardware stack levels used: 1
242 ;; Hardware stack levels required when called: 1
243 ;; This function calls:
244 ;; _midi_set_channel
245 ;; _midi_set_status
246 ;; This function is called by:
247 ;; _main
248 ;; This function uses a non-reentrant model
249 ;;
250
251 psect text1
252 007F02 __ptext1:
253 opt stack 0
254 007F02 _midi_note_on:
255 opt stack 29
256
257 ;midi.c: 66: if (pkt == (0)) {
258
259 ;incstack = 0
260 007F02 5006 movf midi_note_on@pkt,w,c
261 007F04 1007 iorwf midi_note_on@pkt+1,w,c
262 007F06 B4D8 btfsc status,2,c
263 007F08 0012 return
264
265 ;midi.c: 68: }
266 ;midi.c: 70: if (pkt->data == (0)) {
267
268 ;midi.c: 67: return -1;
269 ; Return value of _midi_note_on is never used
270 007F0A 0E03 movlw 3
271 007F0C 2406 addwf midi_note_on@pkt,w,c
272 007F0E 6E0C movwf ??_midi_note_on& (0+255),c
273 007F10 0E00 movlw 0
274 007F12 2007 addwfc midi_note_on@pkt+1,w,c
275 007F14 6E0D movwf (??_midi_note_on+1)& (0+255),c
276 007F16 500C movf ??_midi_note_on,w,c
277 007F18 100D iorwf ??_midi_note_on+1,w,c
278 007F1A B4D8 btfsc status,2,c
279 007F1C 0012 return
280
281 ;midi.c: 72: }
282 ;midi.c: 74: midi_set_status(pkt, NOTE_ON);
283
284 ;midi.c: 71: return -2;
285 ; Return value of _midi_note_on is never used
286 007F1E C006 F001 movff midi_note_on@pkt,midi_set_status@pkt
287 007F22 C007 F002 movff midi_note_on@pkt+1,midi_set_status@pkt+1
288 007F26 0E08 movlw 8
289 007F28 6E03 movwf midi_set_status@status,c
290 007F2A EC45 F03F call _midi_set_status ;wreg free
291
292 ;midi.c: 75: midi_set_channel(pkt, channel);
293 007F2E C006 F001 movff midi_note_on@pkt,midi_set_channel@pkt
294 007F32 C007 F002 movff midi_note_on@pkt+1,midi_set_channel@pkt+1
295 007F36 C008 F003 movff midi_note_on@channel,midi_set_channel@channel
296 007F3A C009 F004 movff midi_note_on@channel+1,midi_set_channel@channel+1
297 007F3E EC57 F03F call _midi_set_channel ;wreg free
298
299 ;midi.c: 77: pkt->data[0] = note;
300 007F42 EE20 F003 lfsr 2,3
301 007F46 5006 movf midi_note_on@pkt,w,c
302 007F48 26D9 addwf fsr2l,f,c
303 007F4A 5007 movf midi_note_on@pkt+1,w,c
304 007F4C 22DA addwfc fsr2h,f,c
305 007F4E C00A FFDF movff midi_note_on@note,indf2
306
307 ;midi.c: 78: pkt->data[1] = velocity;
308 007F52 EE20 F004 lfsr 2,4
309 007F56 5006 movf midi_note_on@pkt,w,c
310 007F58 26D9 addwf fsr2l,f,c
311 007F5A 5007 movf midi_note_on@pkt+1,w,c
312 007F5C 22DA addwfc fsr2h,f,c
313 007F5E C00B FFDF movff midi_note_on@velocity,indf2
314
315 ;midi.c: 81: pkt->data_size = 2;
316 007F62 EE20 F001 lfsr 2,1
317 007F66 5006 movf midi_note_on@pkt,w,c
318 007F68 26D9 addwf fsr2l,f,c
319 007F6A 5007 movf midi_note_on@pkt+1,w,c
320 007F6C 22DA addwfc fsr2h,f,c
321 007F6E 0E02 movlw 2
322 007F70 6EDE movwf postinc2,c
323 007F72 0E00 movlw 0
324 007F74 6EDD movwf postdec2,c
325 007F76 0012 return
326 007F78 __end_of_midi_note_on:
327 opt stack 0
328 indf2 equ 0xFDF
329 postinc2 equ 0xFDE
330 postdec2 equ 0xFDD
331 fsr2h equ 0xFDA
332 fsr2l equ 0xFD9
333 status equ 0xFD8
334
335 ;; *************** function _midi_set_status *****************
336 ;; Defined at:
337 ;; line 42 in file "midi.c"
338 ;; Parameters: Size Location Type
339 ;; pkt 2 0[COMRAM] PTR struct .
340 ;; -> main@sample_message(7),
341 ;; status 1 2[COMRAM] enum E40
342 ;; Auto vars: Size Location Type
343 ;; None
344 ;; Return value: Size Location Type
345 ;; 2 0[COMRAM] int
346 ;; Registers used:
347 ;; wreg, fsr2l, fsr2h, status,2, status,0
348 ;; Tracked objects:
349 ;; On entry : 0/0
350 ;; On exit : 0/0
351 ;; Unchanged: 0/0
352 ;; Data sizes: COMRAM BANK0 BANK1 BANK2 BANK3 BANK4 BANK5
353 ;; Params: 3 0 0 0 0 0 0
354 ;; Locals: 0 0 0 0 0 0 0
355 ;; Temps: 1 0 0 0 0 0 0
356 ;; Totals: 4 0 0 0 0 0 0
357 ;;Total ram usage: 4 bytes
358 ;; Hardware stack levels used: 1
359 ;; This function calls:
360 ;; Nothing
361 ;; This function is called by:
362 ;; _midi_note_on
363 ;; _midi_note_off
364 ;; This function uses a non-reentrant model
365 ;;
366
367 psect text2
368 007E8A __ptext2:
369 opt stack 0
370 007E8A _midi_set_status:
371 opt stack 29
372
373 ;midi.c: 44: if (pkt == (0)) {
374
375 ;incstack = 0
376 007E8A 5001 movf midi_set_status@pkt,w,c
377 007E8C 1002 iorwf midi_set_status@pkt+1,w,c
378 007E8E B4D8 btfsc status,2,c
379 007E90 0012 return
380
381 ;midi.c: 46: }
382 ;midi.c: 48: pkt->status = status & 0x0F;
383
384 ;midi.c: 45: return -1;
385 ; Return value of _midi_set_status is never used
386 007E92 C003 F004 movff midi_set_status@status,??_midi_set_status
387 007E96 0E0F movlw 15
388 007E98 1604 andwf ??_midi_set_status,f,c
389 007E9A C001 FFD9 movff midi_set_status@pkt,fsr2l
390 007E9E C002 FFDA movff midi_set_status@pkt+1,fsr2h
391 007EA2 50DF movf indf2,w,c
392 007EA4 1804 xorwf ??_midi_set_status,w,c
393 007EA6 0BF0 andlw -16
394 007EA8 1804 xorwf ??_midi_set_status,w,c
395 007EAA 6EDF movwf indf2,c
396 007EAC 0012 return
397 007EAE __end_of_midi_set_status:
398 opt stack 0
399 indf2 equ 0xFDF
400 postinc2 equ 0xFDE
401 postdec2 equ 0xFDD
402 fsr2h equ 0xFDA
403 fsr2l equ 0xFD9
404 status equ 0xFD8
405
406 ;; *************** function _midi_set_channel *****************
407 ;; Defined at:
408 ;; line 53 in file "midi.c"
409 ;; Parameters: Size Location Type
410 ;; pkt 2 0[COMRAM] PTR struct .
411 ;; -> main@sample_message(7),
412 ;; channel 2 2[COMRAM] unsigned int
413 ;; Auto vars: Size Location Type
414 ;; None
415 ;; Return value: Size Location Type
416 ;; 2 0[COMRAM] int
417 ;; Registers used:
418 ;; wreg, fsr2l, fsr2h, status,2, status,0
419 ;; Tracked objects:
420 ;; On entry : 0/0
421 ;; On exit : 0/0
422 ;; Unchanged: 0/0
423 ;; Data sizes: COMRAM BANK0 BANK1 BANK2 BANK3 BANK4 BANK5
424 ;; Params: 4 0 0 0 0 0 0
425 ;; Locals: 0 0 0 0 0 0 0
426 ;; Temps: 1 0 0 0 0 0 0
427 ;; Totals: 5 0 0 0 0 0 0
428 ;;Total ram usage: 5 bytes
429 ;; Hardware stack levels used: 1
430 ;; This function calls:
431 ;; Nothing
432 ;; This function is called by:
433 ;; _midi_note_on
434 ;; _midi_note_off
435 ;; This function uses a non-reentrant model
436 ;;
437
438 psect text3
439 007EAE __ptext3:
440 opt stack 0
441 007EAE _midi_set_channel:
442 opt stack 29
443
444 ;midi.c: 55: if (pkt == (0)) {
445
446 ;incstack = 0
447 007EAE 5001 movf midi_set_channel@pkt,w,c
448 007EB0 1002 iorwf midi_set_channel@pkt+1,w,c
449 007EB2 B4D8 btfsc status,2,c
450 007EB4 0012 return
451
452 ;midi.c: 57: }
453 ;midi.c: 59: pkt->channel = channel & 0x0F;
454
455 ;midi.c: 56: return -1;
456 ; Return value of _midi_set_channel is never used
457 007EB6 C003 F005 movff midi_set_channel@channel,??_midi_set_channel
458 007EBA 0E0F movlw 15
459 007EBC 1605 andwf ??_midi_set_channel,f,c
460 007EBE C001 FFD9 movff midi_set_channel@pkt,fsr2l
461 007EC2 C002 FFDA movff midi_set_channel@pkt+1,fsr2h
462 007EC6 3A05 swapf ??_midi_set_channel,f,c
463 007EC8 50DF movf indf2,w,c
464 007ECA 1805 xorwf ??_midi_set_channel,w,c
465 007ECC 0B0F andlw -241
466 007ECE 1805 xorwf ??_midi_set_channel,w,c
467 007ED0 6EDF movwf indf2,c
468 007ED2 0012 return
469 007ED4 __end_of_midi_set_channel:
470 opt stack 0
471 indf2 equ 0xFDF
472 postinc2 equ 0xFDE
473 postdec2 equ 0xFDD
474 fsr2h equ 0xFDA
475 fsr2l equ 0xFD9
476 status equ 0xFD8
477
478 ;; *************** function _eusart_write_midi *****************
479 ;; Defined at:
480 ;; line 81 in file "main.c"
481 ;; Parameters: Size Location Type
482 ;; pkt 2 1[COMRAM] PTR struct .
483 ;; -> main@sample_message(7),
484 ;; Auto vars: Size Location Type
485 ;; data 2 7[COMRAM] PTR unsigned char
486 ;; -> sample_message.data(4), main@sample_message(7),
487 ;; length 2 5[COMRAM] unsigned int
488 ;; Return value: Size Location Type
489 ;; 2 1[COMRAM] int
490 ;; Registers used:
491 ;; wreg, fsr2l, fsr2h, status,2, status,0, cstack
492 ;; Tracked objects:
493 ;; On entry : 0/0
494 ;; On exit : 0/0
495 ;; Unchanged: 0/0
496 ;; Data sizes: COMRAM BANK0 BANK1 BANK2 BANK3 BANK4 BANK5
497 ;; Params: 2 0 0 0 0 0 0
498 ;; Locals: 4 0 0 0 0 0 0
499 ;; Temps: 2 0 0 0 0 0 0
500 ;; Totals: 8 0 0 0 0 0 0
501 ;;Total ram usage: 8 bytes
502 ;; Hardware stack levels used: 1
503 ;; Hardware stack levels required when called: 1
504 ;; This function calls:
505 ;; _putch
506 ;; This function is called by:
507 ;; _main
508 ;; This function uses a non-reentrant model
509 ;;
510
511 psect text4
512 007F78 __ptext4:
513 opt stack 0
514 007F78 _eusart_write_midi:
515 opt stack 29
516
517 ;main.c: 83: if (pkt == (0)) {
518
519 ;incstack = 0
520 007F78 5002 movf eusart_write_midi@pkt,w,c
521 007F7A 1003 iorwf eusart_write_midi@pkt+1,w,c
522 007F7C B4D8 btfsc status,2,c
523 007F7E 0012 return
524
525 ;main.c: 85: }
526 ;main.c: 87: if (pkt->data == (0)) {
527
528 ;main.c: 84: return -1;
529 ; Return value of _eusart_write_midi is never used
530 007F80 0E03 movlw 3
531 007F82 2402 addwf eusart_write_midi@pkt,w,c
532 007F84 6E04 movwf ??_eusart_write_midi& (0+255),c
533 007F86 0E00 movlw 0
534 007F88 2003 addwfc eusart_write_midi@pkt+1,w,c
535 007F8A 6E05 movwf (??_eusart_write_midi+1)& (0+255),c
536 007F8C 5004 movf ??_eusart_write_midi,w,c
537 007F8E 1005 iorwf ??_eusart_write_midi+1,w,c
538 007F90 B4D8 btfsc status,2,c
539 007F92 0012 return
540
541 ;main.c: 89: }
542 ;main.c: 91: size_t length = pkt->data_size;
543
544 ;main.c: 88: return -2;
545 ; Return value of _eusart_write_midi is never used
546 007F94 EE20 F001 lfsr 2,1
547 007F98 5002 movf eusart_write_midi@pkt,w,c
548 007F9A 26D9 addwf fsr2l,f,c
549 007F9C 5003 movf eusart_write_midi@pkt+1,w,c
550 007F9E 22DA addwfc fsr2h,f,c
551 007FA0 CFDE F006 movff postinc2,eusart_write_midi@length
552 007FA4 CFDD F007 movff postdec2,eusart_write_midi@length+1
553
554 ;main.c: 92: uint8_t *data = pkt->data;
555 007FA8 0E03 movlw 3
556 007FAA 2402 addwf eusart_write_midi@pkt,w,c
557 007FAC 6E08 movwf eusart_write_midi@data,c
558 007FAE 0E00 movlw 0
559 007FB0 2003 addwfc eusart_write_midi@pkt+1,w,c
560 007FB2 6E09 movwf eusart_write_midi@data+1,c
561
562 ;main.c: 94: putch((char)((pkt->status << 4) | pkt->channel));
563 007FB4 C002 FFD9 movff eusart_write_midi@pkt,fsr2l
564 007FB8 C003 FFDA movff eusart_write_midi@pkt+1,fsr2h
565 007FBC 38DF swapf indf2,w,c
566 007FBE 0B0F andlw 15
567 007FC0 6E04 movwf ??_eusart_write_midi& (0+255),c
568 007FC2 C002 FFD9 movff eusart_write_midi@pkt,fsr2l
569 007FC6 C003 FFDA movff eusart_write_midi@pkt+1,fsr2h
570 007FCA 50DF movf indf2,w,c
571 007FCC 0B0F andlw 15
572 007FCE 6E05 movwf (??_eusart_write_midi+1)& (0+255),c
573 007FD0 3805 swapf ??_eusart_write_midi+1,w,c
574 007FD2 0BF0 andlw 240
575 007FD4 1004 iorwf ??_eusart_write_midi,w,c
576 007FD6 EC33 F03F call _putch
577
578 ;main.c: 96: while (length--) {
579 007FDA D009 goto l12
580 007FDC l832:
581
582 ;main.c: 97: putch((char) *(data++));
583 007FDC C008 FFD9 movff eusart_write_midi@data,fsr2l
584 007FE0 C009 FFDA movff eusart_write_midi@data+1,fsr2h
585 007FE4 50DF movf indf2,w,c
586 007FE6 EC33 F03F call _putch
587 007FEA 4A08 infsnz eusart_write_midi@data,f,c
588 007FEC 2A09 incf eusart_write_midi@data+1,f,c
589 007FEE l12:
590 007FEE 0606 decf eusart_write_midi@length,f,c
591 007FF0 A0D8 btfss status,0,c
592 007FF2 0607 decf eusart_write_midi@length+1,f,c
593 007FF4 2806 incf eusart_write_midi@length,w,c
594 007FF6 E1F2 bnz l832
595 007FF8 2807 incf eusart_write_midi@length+1,w,c
596 007FFA B4D8 btfsc status,2,c
597 007FFC 0012 return
598 007FFE D7EE goto l13
599 008000 __end_of_eusart_write_midi:
600 opt stack 0
601 indf2 equ 0xFDF
602 postinc2 equ 0xFDE
603 postdec2 equ 0xFDD
604 fsr2h equ 0xFDA
605 fsr2l equ 0xFD9
606 status equ 0xFD8
607
608 ;; *************** function _putch *****************
609 ;; Defined at:
610 ;; line 23 in file "rs232.c"
611 ;; Parameters: Size Location Type
612 ;; c 1 wreg unsigned char
613 ;; Auto vars: Size Location Type
614 ;; c 1 0[COMRAM] unsigned char
615 ;; Return value: Size Location Type
616 ;; 1 wreg void
617 ;; Registers used:
618 ;; wreg
619 ;; Tracked objects:
620 ;; On entry : 0/0
621 ;; On exit : 0/0
622 ;; Unchanged: 0/0
623 ;; Data sizes: COMRAM BANK0 BANK1 BANK2 BANK3 BANK4 BANK5
624 ;; Params: 0 0 0 0 0 0 0
625 ;; Locals: 1 0 0 0 0 0 0
626 ;; Temps: 0 0 0 0 0 0 0
627 ;; Totals: 1 0 0 0 0 0 0
628 ;;Total ram usage: 1 bytes
629 ;; Hardware stack levels used: 1
630 ;; This function calls:
631 ;; Nothing
632 ;; This function is called by:
633 ;; _eusart_write_midi
634 ;; _getche
635 ;; This function uses a non-reentrant model
636 ;;
637
638 psect text5
639 007E66 __ptext5:
640 opt stack 0
641 007E66 _putch:
642 opt stack 29
643
644 ;incstack = 0
645 ;putch@c stored from wreg
646 007E66 6E01 movwf putch@c,c
647 007E68
648 ;rs232.c: 25: while (!TXIF);
649 007E68 A89E btfss 3998,4,c ;volatile
650 007E6A D7FE goto l700
651
652 ;rs232.c: 26: TXREG = c;
653 007E6C C001 FFAD movff putch@c,4013 ;volatile
654 007E70 0012 return ;funcret
655 007E72 __end_of_putch:
656 opt stack 0
657 indf2 equ 0xFDF
658 postinc2 equ 0xFDE
659 postdec2 equ 0xFDD
660 fsr2h equ 0xFDA
661 fsr2l equ 0xFD9
662 status equ 0xFD8
663
664 ;; *************** function _eusart_init *****************
665 ;; Defined at:
666 ;; line 4 in file "rs232.c"
667 ;; Parameters: Size Location Type
668 ;; None
669 ;; Auto vars: Size Location Type
670 ;; None
671 ;; Return value: Size Location Type
672 ;; 1 wreg void
673 ;; Registers used:
674 ;; wreg, status,2
675 ;; Tracked objects:
676 ;; On entry : 0/0
677 ;; On exit : 0/0
678 ;; Unchanged: 0/0
679 ;; Data sizes: COMRAM BANK0 BANK1 BANK2 BANK3 BANK4 BANK5
680 ;; Params: 0 0 0 0 0 0 0
681 ;; Locals: 0 0 0 0 0 0 0
682 ;; Temps: 0 0 0 0 0 0 0
683 ;; Totals: 0 0 0 0 0 0 0
684 ;;Total ram usage: 0 bytes
685 ;; Hardware stack levels used: 1
686 ;; This function calls:
687 ;; Nothing
688 ;; This function is called by:
689 ;; _main
690 ;; This function uses a non-reentrant model
691 ;;
692
693 psect text6
694 007E72 __ptext6:
695 opt stack 0
696 007E72 _eusart_init:
697 opt stack 30
698
699 ;rs232.c: 7: TXSTAbits.SYNC = 0;
700
701 ;incstack = 0
702 007E72 98AC bcf 4012,4,c ;volatile
703
704 ;rs232.c: 8: TXSTAbits.TX9 = 0;
705 007E74 9CAC bcf 4012,6,c ;volatile
706
707 ;rs232.c: 11: RCSTAbits.SPEN = 1;
708 007E76 8EAB bsf 4011,7,c ;volatile
709
710 ;rs232.c: 12: SPBRG = 129;
711 007E78 0E81 movlw 129
712 007E7A 6EAF movwf 4015,c ;volatile
713
714 ;rs232.c: 13: TXSTAbits.BRGH = 1;
715 007E7C 84AC bsf 4012,2,c ;volatile
716
717 ;rs232.c: 14: BAUDCONbits.BRG16 = 0;
718 007E7E 96B8 bcf 4024,3,c ;volatile
719
720 ;rs232.c: 17: TRISC7 = 1;
721 007E80 8E94 bsf 3988,7,c ;volatile
722
723 ;rs232.c: 18: TRISC6 = 1;
724 007E82 8C94 bsf 3988,6,c ;volatile
725
726 ;rs232.c: 19: RCSTAbits.CREN = 1;
727 007E84 88AB bsf 4011,4,c ;volatile
728
729 ;rs232.c: 20: TXSTAbits.TXEN = 1;
730 007E86 8AAC bsf 4012,5,c ;volatile
731 007E88 0012 return ;funcret
732 007E8A __end_of_eusart_init:
733 opt stack 0
734 0000 indf2 equ 0xFDF
735 postinc2 equ 0xFDE
736 postdec2 equ 0xFDD
737 fsr2h equ 0xFDA
738 fsr2l equ 0xFD9
739 status equ 0xFD8
740 indf2 equ 0xFDF
741 postinc2 equ 0xFDE
742 postdec2 equ 0xFDD
743 fsr2h equ 0xFDA
744 fsr2l equ 0xFD9
745 status equ 0xFD8
746
747 psect rparam
748 0000 indf2 equ 0xFDF
749 postinc2 equ 0xFDE
750 postdec2 equ 0xFDD
751 fsr2h equ 0xFDA
752 fsr2l equ 0xFD9
753 status equ 0xFD8
Data Sizes:
Strings 0
Constant 0
Data 0
BSS 0
Persistent 0
Stack 0
Auto Spaces:
Space Size Autos Used
COMRAM 95 20 20
BANK0 160 0 0
BANK1 256 0 0
BANK2 256 0 0
BANK3 256 0 0
BANK4 256 0 0
BANK5 256 0 0
Pointer List with Targets:
midi_note_on@pkt PTR struct . size(2) Largest target is 7
-> main@sample_message(COMRAM[7]),
midi_set_channel@pkt PTR struct . size(2) Largest target is 7
-> main@sample_message(COMRAM[7]),
midi_set_status@pkt PTR struct . size(2) Largest target is 7
-> main@sample_message(COMRAM[7]),
eusart_write_midi@data PTR unsigned char size(2) Largest target is 7
-> sample_message.data(COMRAM[4]), main@sample_message(COMRAM[7]),
eusart_write_midi@pkt PTR struct . size(2) Largest target is 7
-> main@sample_message(COMRAM[7]),
Critical Paths under _main in COMRAM
_main->_midi_note_on
_midi_note_on->_midi_set_channel
_eusart_write_midi->_putch
Critical Paths under _main in BANK0
None.
Critical Paths under _main in BANK1
None.
Critical Paths under _main in BANK2
None.
Critical Paths under _main in BANK3
None.
Critical Paths under _main in BANK4
None.
Critical Paths under _main in BANK5
None.
Call Graph Tables:
---------------------------------------------------------------------------------
(Depth) Function Calls Base Space Used Autos Params Refs
---------------------------------------------------------------------------------
(0) _main 7 7 0 1590
13 COMRAM 7 7 0
_eusart_init
_eusart_write_midi
_midi_note_on
---------------------------------------------------------------------------------
(1) _midi_note_on 8 2 6 1264
5 COMRAM 8 2 6
_midi_set_channel
_midi_set_status
---------------------------------------------------------------------------------
(2) _midi_set_status 4 1 3 370
0 COMRAM 4 1 3
---------------------------------------------------------------------------------
(2) _midi_set_channel 5 1 4 370
0 COMRAM 5 1 4
---------------------------------------------------------------------------------
(1) _eusart_write_midi 8 6 2 270
1 COMRAM 8 6 2
_putch
---------------------------------------------------------------------------------
(2) _putch 1 1 0 15
0 COMRAM 1 1 0
---------------------------------------------------------------------------------
(1) _eusart_init 0 0 0 0
---------------------------------------------------------------------------------
Estimated maximum stack depth 2
---------------------------------------------------------------------------------
Call Graph Graphs:
_main (ROOT)
_eusart_init
_eusart_write_midi
_putch
_midi_note_on
_midi_set_channel
_midi_set_status
Address spaces:
Name Size Autos Total Cost Usage
BITCOMRAM 5F 0 0 0 0.0%
EEDATA 100 0 0 0 0.0%
NULL 0 0 0 0 0.0%
CODE 0 0 0 0 0.0%
COMRAM 5F 14 14 1 21.1%
STACK 0 0 0 2 0.0%
BITBANK0 A0 0 0 3 0.0%
BANK0 A0 0 0 4 0.0%
BITBANK1 100 0 0 5 0.0%
BANK1 100 0 0 6 0.0%
BITBANK2 100 0 0 7 0.0%
BANK2 100 0 0 8 0.0%
ABS 0 0 0 9 0.0%
BITBANK3 100 0 0 10 0.0%
BANK3 100 0 0 11 0.0%
BITBANK4 100 0 0 12 0.0%
BANK4 100 0 0 13 0.0%
BITBANK5 100 0 0 14 0.0%
BANK5 100 0 0 15 0.0%
BIGRAM 5FF 0 0 16 0.0%
DATA 0 0 0 17 0.0%
BITSFR_1 0 0 0 200 0.0%
SFR_1 0 0 0 200 0.0%
BITSFR 0 0 0 200 0.0%
SFR 0 0 0 200 0.0%
Microchip Technology PIC18 Macro Assembler V1.44 build -154322312
Symbol Table Thu Feb 22 10:47:56 2018
l12 7FEE l13 7FDC l19 7EF4
__CFG_CP0$OFF 000000 __CFG_CP1$OFF 000000 __CFG_LVP$ON 000000
l700 7E68 l832 7FDC __CFG_CPB$OFF 000000
__CFG_CPD$OFF 000000 _RCIF 007CF5 _TXIF 007CF4
_main 7ED4 midi_note_on@channel 0008 fsr2h 000FDA
indf2 000FDF fsr2l 000FD9 __CFG_BORV$190 000000
start 0000 __CFG_IESO$OFF 000000 midi_note_on@pkt 0006
___param_bank 000000 ?_main 0001 __CFG_WDTEN$ON 000000
_RCREG 000FAE _SPBRG 000FAF _TXREG 000FAD
__CFG_WRT0$OFF 000000 __CFG_WRT1$OFF 000000 __CFG_EBTR0$OFF 000000
__CFG_FCMEN$OFF 000000 __CFG_EBTR1$OFF 000000 __CFG_WRTB$OFF 000000
__CFG_WRTC$OFF 000000 __CFG_WRTD$OFF 000000 __CFG_EBTRB$OFF 000000
__CFG_MCLRE$EXTMCLR 000000 ?_eusart_init 0001 _putch 7E66
_eusart_write_midi 7F78 __end_of_midi_set_status 7EAE status 000FD8
__CFG_HFOFST$ON 000000 ?_eusart_write_midi 0002 __CFG_PBADEN$ON 000000
eusart_write_midi@length 0006 __initialization 7E60 midi_note_on@note 000A
__end_of_main 7F02 ??_eusart_write_midi 0004 midi_note_on@velocity 000B
??_main 000E ?_midi_note_on 0006 __activetblptr 000000
__end_of_eusart_write_midi 8000 ?_putch 0001 _TRISC6 007CA6
_TRISC7 007CA7 __CFG_XINST$OFF 000000 __CFG_STVREN$ON 000000
__end_of_midi_set_channel 7ED4 midi_set_status@status 0003 ??_midi_note_on 000C
putch@c 0001 __accesstop 0060 __end_of__initialization 7E60
?_midi_set_status 0001 ___rparam_used 000001 __pcstackCOMRAM 0001
__end_of_putch 7E72 __size_of_eusart_write_midi 0088 ??_putch 0001
__CFG_PLLCFG$OFF 000000 __size_of_eusart_init 0018 __CFG_CCP2MX$PORTC1 000000
__CFG_CCP3MX$PORTB5 000000 __end_of_midi_note_on 7F78 eusart_write_midi@pkt 0002
__CFG_PWRTEN$OFF 000000 __Hparam 0000 __Lparam 0000
__pcinit 7E60 __ramtop 0600 __ptext0 7ED4
__ptext1 7F02 __ptext2 7E8A __ptext3 7EAE
__ptext4 7F78 __ptext5 7E66 __ptext6 7E72
end_of_initialization 7E60 _RCSTAbits 000FAB postdec2 000FDD
postinc2 000FDE ?_midi_set_channel 0001 ??_midi_set_channel 0005
_TXSTAbits 000FAC midi_set_channel@channel 0003 _BAUDCONbits 000FB8
start_initialization 7E60 __size_of_midi_note_on 0076 __size_of_midi_set_status 0024
_midi_note_on 7F02 ??_eusart_init 0001 midi_set_status@pkt 0001
__CFG_PRICLKEN$ON 000000 main@sample_message 000E __size_of_putch 000C
__end_of_eusart_init 7E8A __CFG_WDTPS$32768 000000 ??_midi_set_status 0004
__size_of_midi_set_channel 0026 eusart_write_midi@data 0008 __Hrparam 0000
__Lrparam 0000 __CFG_BOREN$SBORDIS 000000 __CFG_P2BMX$PORTD2 000000
_eusart_init 7E72 __size_of_main 002E midi_set_channel@pkt 0001
__CFG_T3CMX$PORTC0 000000 __CFG_FOSC$ECHPIO6 000000 _midi_set_channel 7EAE
_midi_set_status 7E8A
|