-
Notifications
You must be signed in to change notification settings - Fork 3
/
unit_01_06_DoubleChasing_LED.lst
133 lines (132 loc) · 4.66 KB
/
unit_01_06_DoubleChasing_LED.lst
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
; LST file generated by mikroListExporter - v.2.0
; Date/Time: 21/11/2019 05:32:42 PM
;----------------------------------------------
;Address Opcode ASM
0x0000 0xF000EF0E GOTO 28
0x0004 0x0000 NOP
0x0006 0x0000 NOP
0x0008 0xF000EF00 GOTO 0
0x000C 0x0000 NOP
0x000E 0x0000 NOP
0x0010 0x0000 NOP
0x0012 0x0000 NOP
0x0014 0x0000 NOP
0x0016 0x0000 NOP
0x0018 0xD7F3 BRA 0
_main:
;unit_01_06_DoubleChasing_LED.c,42 :: void main() {
;unit_01_06_DoubleChasing_LED.c,43 :: unsigned char j = 0b10000000 ; // Initialize j as char (0b notation)
0x001C 0x0E80 MOVLW 128
0x001E 0x6E15 MOVWF main_j_L0
0x0020 0x0E01 MOVLW 1
0x0022 0x6E16 MOVWF main_l_L0
;unit_01_06_DoubleChasing_LED.c,49 :: ADCON1 |= 0X0F; // Config all ADC's pins as digital on PIC18F4520
0x0024 0x0E0F MOVLW 15
0x0026 0x12C1 IORWF ADCON1, 1
;unit_01_06_DoubleChasing_LED.c,52 :: TRISB = 0; // Config PORTB as output
0x0028 0x6A93 CLRF TRISB
;unit_01_06_DoubleChasing_LED.c,53 :: PORTB = 0; // Optional, the MCU do it automatically ;)
0x002A 0x6A81 CLRF PORTB
;unit_01_06_DoubleChasing_LED.c,56 :: for(;;) // Endless loop
L_main0:
;unit_01_06_DoubleChasing_LED.c,58 :: PORTB = (j|l);
0x002C 0x5016 MOVF main_l_L0, 0
0x002E 0x1015 IORWF main_j_L0, 0
0x0030 0x6E81 MOVWF PORTB
;unit_01_06_DoubleChasing_LED.c,59 :: j>>=1; // Cycle j bits
0x0032 0xF001C015 MOVFF main_j_L0, R1
0x0036 0x3201 RRCF R1, 1
0x0038 0x9E01 BCF R1, 7
0x003A 0xF015C001 MOVFF R1, main_j_L0
;unit_01_06_DoubleChasing_LED.c,60 :: l<<=1; // Cycle l bits
0x003E 0x3616 RLCF main_l_L0, 1
0x0040 0x9016 BCF main_l_L0, 0
;unit_01_06_DoubleChasing_LED.c,61 :: if(j==0) j = 0b10000000; // Reset j if zero
0x0042 0x5001 MOVF R1, 0
0x0044 0x0A00 XORLW 0
0x0046 0xE102 BNZ L_main3
0x0048 0x0E80 MOVLW 128
0x004A 0x6E15 MOVWF main_j_L0
L_main3:
;unit_01_06_DoubleChasing_LED.c,62 :: if(l==0) l = 0b00000001; // Reset l if zero
0x004C 0x5016 MOVF main_l_L0, 0
0x004E 0x0A00 XORLW 0
0x0050 0xE102 BNZ L_main4
0x0052 0x0E01 MOVLW 1
0x0054 0x6E16 MOVWF main_l_L0
L_main4:
;unit_01_06_DoubleChasing_LED.c,63 :: Delay_ms(100); // Delay .1 s
0x0056 0x0E02 MOVLW 2
0x0058 0x6E0B MOVWF R11, 0
0x005A 0x0E04 MOVLW 4
0x005C 0x6E0C MOVWF R12, 0
0x005E 0x0EBA MOVLW 186
0x0060 0x6E0D MOVWF R13, 0
L_main5:
0x0062 0x2E0D DECFSZ R13, 1, 0
0x0064 0xD7FE BRA L_main5
0x0066 0x2E0C DECFSZ R12, 1, 0
0x0068 0xD7FC BRA L_main5
0x006A 0x2E0B DECFSZ R11, 1, 0
0x006C 0xD7FA BRA L_main5
0x006E 0x0000 NOP
;unit_01_06_DoubleChasing_LED.c,64 :: }
0x0070 0xD7DD BRA L_main0
;unit_01_06_DoubleChasing_LED.c,65 :: }
L_end_main:
0x0072 0xD7FF BRA $+0
; end of _main
Symbol List:
//** Routines locations **
//ADDRESS SIZE PROCEDURE
//----------------------------------------------
0x001C [88] _main
//** Variables locations **
//ADDRESS SIZE VARIABLE
//----------------------------------------------
0x0000 [1] R0
0x0001 [1] R1
0x0002 [1] R2
0x0003 [1] R3
0x0004 [1] R4
0x0005 [1] R5
0x0006 [1] R6
0x0007 [1] R7
0x0008 [1] R8
0x0009 [1] R9
0x000A [1] R10
0x000B [1] R11
0x000C [1] R12
0x000D [1] R13
0x000E [1] R14
0x000F [1] R15
0x0010 [1] R16
0x0011 [1] R17
0x0012 [1] R18
0x0013 [1] R19
0x0014 [1] R20
0x0015 [1] main_j_L0
0x0016 [1] main_l_L0
0x0F81 [1] PORTB
0x0F93 [1] TRISB
0x0FC1 [1] ADCON1
0x0FD8 [1] STATUS
0x0FD9 [1] FSR2L
0x0FDA [1] FSR2H
0x0FDE [1] POSTINC2
0x0FE0 [1] BSR
0x0FE1 [1] FSR1L
0x0FE2 [1] FSR1H
0x0FE4 [1] PREINC1
0x0FE6 [1] POSTINC1
0x0FE7 [1] INDF1
0x0FE8 [1] WREG
0x0FE9 [1] FSR0L
0x0FEA [1] FSR0H
0x0FEE [1] POSTINC0
0x0FF3 [1] PRODL
0x0FF4 [1] PRODH
0x0FF5 [1] TABLAT
0x0FF6 [1] TBLPTRL
0x0FF7 [1] TBLPTRH
0x0FF8 [1] TBLPTRU