The lesson; while I do believe in intuition for great solutions, it is worth to challenge your beliefs every once in a while.
Pointer version:
30 0764 _Cbutton_construct
31 ;button_ptr.c: 27: me->debounceCounter = 0;
32
33 0764 0084 movwf fsr
34
35 0765 1383 bcf 3,7
36 0766 0180 clrf 0
37 ;button_ptr.c: 28: me->level = !1;
38
39 ; _me assigned to ?a_Cbutton_construct+0
40 0000 _Cbutton_construct$me set
?a_Cbutton_construct+0
41 ;_me stored from w
42 0767 1283 bcf status,5
43 0768 1303 bcf status,6 ;carry unused
44 0769 00A8 movwf (((?a_Cbutton_construct+0)))
45 076A 0A28 incf (((?a_Cbutton_construct+0))),w
46 076B 0084 movwf fsr
47
48 076C 1383 bcf 3,7
49 076D 0180 clrf 0
Index version:
30 06F6 _Cbutton_construct
31 ;button.C: 27: theButton[meIndex].
debounceCounter = 0;
32
33 global _theButton
34 ; _meIndex assigned to ?a_Cbutton_construct+0
35 0000 _Cbutton_construct$meIndex set ?a_
Cbutton_construct+0
36 ;_meIndex stored from w
37 06F6 1283 bcf status,5
38 06F7 1303 bcf status,6 ;carry unused
39 06F8 00A8 movwf (((?a_Cbutton_construct+0)))
40 06F9 0828 movf (((?a_Cbutton_construct+0))),w
41 06FA 00F0 movwf btemp
42 06FB 1003 bcf status,0
43 06FC 0DF0 rlf btemp
44 06FD 1003 bcf status,0
45 06FE 0D70 rlf btemp,w
46 06FF 3E20 addlw ((_theButton))
47 0700 0084 movwf fsr
48
49 0701 1383 bcf 3,7
50 0702 0180 clrf 0
51 ;button.C: 28: theButton[meIndex].level = !1;
52
53 0703 0828 movf (((?a_Cbutton_construct+0))),w
54 0704 00F0 movwf btemp
55 0705 1003 bcf status,0
56 0706 0DF0 rlf btemp
57 0707 1003 bcf status,0
58 0708 0D70 rlf btemp,w
59 0709 00F0 movwf btemp
60 070A 0A70 incf btemp,w
61 070B 3E20 addlw ((_theButton))
62 070C 0084 movwf fsr
63
64 070D 1383 bcf 3,7
65 070E 0180 clrf 0
No comments:
Post a Comment