-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserial2.lst
More file actions
198 lines (198 loc) · 12.5 KB
/
serial2.lst
File metadata and controls
198 lines (198 loc) · 12.5 KB
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
1 ;--------------------------------------------------------
2 ; File Created by SDCC : free open source ANSI-C Compiler
3 ; Version 3.5.0 #9253 (Mar 24 2016) (Linux)
4 ; This file was generated Fri Mar 29 15:47:22 2019
5 ;--------------------------------------------------------
6 .module serial2
7 .optsdcc -mstm8
8
9 ;--------------------------------------------------------
10 ; Public variables in this module
11 ;--------------------------------------------------------
12 .globl _main
13 ;--------------------------------------------------------
14 ; ram data
15 ;--------------------------------------------------------
16 .area DATA
17 ;--------------------------------------------------------
18 ; ram data
19 ;--------------------------------------------------------
20 .area INITIALIZED
21 ;--------------------------------------------------------
22 ; Stack segment in internal ram
23 ;--------------------------------------------------------
24 .area SSEG
000000 25 __start__stack:
000000 26 .ds 1
27
28 ;--------------------------------------------------------
29 ; absolute external ram data
30 ;--------------------------------------------------------
31 .area DABS (ABS)
32 ;--------------------------------------------------------
33 ; interrupt vector
34 ;--------------------------------------------------------
35 .area HOME
000000 36 __interrupt_vect:
000000 82v00u00u00 37 int s_GSINIT ;reset
000004 82 00 00 00 38 int 0x0000 ;trap
000008 82 00 00 00 39 int 0x0000 ;int0
00000C 82 00 00 00 40 int 0x0000 ;int1
000010 82 00 00 00 41 int 0x0000 ;int2
000014 82 00 00 00 42 int 0x0000 ;int3
000018 82 00 00 00 43 int 0x0000 ;int4
00001C 82 00 00 00 44 int 0x0000 ;int5
000020 82 00 00 00 45 int 0x0000 ;int6
000024 82 00 00 00 46 int 0x0000 ;int7
000028 82 00 00 00 47 int 0x0000 ;int8
00002C 82 00 00 00 48 int 0x0000 ;int9
000030 82 00 00 00 49 int 0x0000 ;int10
000034 82 00 00 00 50 int 0x0000 ;int11
000038 82 00 00 00 51 int 0x0000 ;int12
00003C 82 00 00 00 52 int 0x0000 ;int13
000040 82 00 00 00 53 int 0x0000 ;int14
000044 82 00 00 00 54 int 0x0000 ;int15
000048 82 00 00 00 55 int 0x0000 ;int16
00004C 82 00 00 00 56 int 0x0000 ;int17
000050 82 00 00 00 57 int 0x0000 ;int18
000054 82 00 00 00 58 int 0x0000 ;int19
000058 82 00 00 00 59 int 0x0000 ;int20
00005C 82 00 00 00 60 int 0x0000 ;int21
000060 82 00 00 00 61 int 0x0000 ;int22
000064 82 00 00 00 62 int 0x0000 ;int23
000068 82 00 00 00 63 int 0x0000 ;int24
00006C 82 00 00 00 64 int 0x0000 ;int25
000070 82 00 00 00 65 int 0x0000 ;int26
000074 82 00 00 00 66 int 0x0000 ;int27
000078 82 00 00 00 67 int 0x0000 ;int28
00007C 82 00 00 00 68 int 0x0000 ;int29
69 ;--------------------------------------------------------
70 ; global & static initialisations
71 ;--------------------------------------------------------
72 .area HOME
73 .area GSINIT
74 .area GSFINAL
75 .area GSINIT
000000 76 __sdcc_gs_init_startup:
000000 77 __sdcc_init_data:
78 ; stm8_genXINIT() start
000000 AEr00r00 [ 2] 79 ldw x, #l_DATA
000003 27 07 [ 1] 80 jreq 00002$
000005 81 00001$:
000005 72 4FuFFuFF [ 1] 82 clr (s_DATA - 1, x)
000009 5A [ 2] 83 decw x
00000A 26 F9 [ 1] 84 jrne 00001$
00000C 85 00002$:
00000C AEr00r00 [ 2] 86 ldw x, #l_INITIALIZER
00000F 27 09 [ 1] 87 jreq 00004$
000011 88 00003$:
000011 D6uFFuFF [ 1] 89 ld a, (s_INITIALIZER - 1, x)
000014 D7uFFuFF [ 1] 90 ld (s_INITIALIZED - 1, x), a
000017 5A [ 2] 91 decw x
000018 26 F7 [ 1] 92 jrne 00003$
00001A 93 00004$:
94 ; stm8_genXINIT() end
95 .area GSFINAL
000000 CCr00r80 [ 2] 96 jp __sdcc_program_startup
97 ;--------------------------------------------------------
98 ; Home
99 ;--------------------------------------------------------
100 .area HOME
101 .area HOME
000080 102 __sdcc_program_startup:
000080 CCr00r00 [ 2] 103 jp _main
104 ; return from main will return to caller
105 ;--------------------------------------------------------
106 ; code
107 ;--------------------------------------------------------
108 .area CODE
109 ; serial2.c: 30: void main(void)
110 ; genLabel
111 ; -----------------------------------------
112 ; function main
113 ; -----------------------------------------
114 ; Register assignment might be sub-optimal.
115 ; Stack space usage: 8 bytes.
000000 116 _main:
000000 52 08 [ 2] 117 sub sp, #8
118 ; serial2.c: 34: CLK_DIVR = 0x00; // Set the frequency to 16 MHz
119 ; genPointerSet
000002 35 00 50 C0 [ 1] 120 mov 0x50c0+0, #0x00
121 ; serial2.c: 35: CLK_PCKENR1 = 0xFF; // Enable peripherals
122 ; genPointerSet
000006 35 FF 50 C3 [ 1] 123 mov 0x50c3+0, #0xff
124 ; serial2.c: 37: PC_DDR = 0x08; // Put TX line on
125 ; genPointerSet
00000A 35 08 50 0C [ 1] 126 mov 0x500c+0, #0x08
127 ; serial2.c: 38: PC_CR1 = 0x08;
128 ; genPointerSet
00000E 35 08 50 0D [ 1] 129 mov 0x500d+0, #0x08
130 ; serial2.c: 40: USART1_CR2 = USART_CR2_TEN; // Allow TX and RX
131 ; genPointerSet
000012 35 08 52 35 [ 1] 132 mov 0x5235+0, #0x08
133 ; serial2.c: 41: USART1_CR3 &= ~(USART_CR3_STOP1 | USART_CR3_STOP2); // 1 stop bit
134 ; genPointerGet
135 ; genCast
136 ; genAssign
137 ; genAnd
138 ; genPointerSet
000016 AE 52 36 [ 2] 139 ldw x, #0x5236
000019 F6 [ 1] 140 ld a, (x)
00001A A4 CF [ 1] 141 and a, #0xcf
142 ; peephole 10 removed redundant load of #0x5236 into x
00001C F7 [ 1] 143 ld (x), a
144 ; serial2.c: 42: USART1_BRR2 = 0x03; USART1_BRR1 = 0x68; // 9600 baud
145 ; genPointerSet
00001D 35 03 52 33 [ 1] 146 mov 0x5233+0, #0x03
147 ; genPointerSet
000021 35 68 52 32 [ 1] 148 mov 0x5232+0, #0x68
149 ; genLabel
000025 150 00106$:
151 ; serial2.c: 47: for(i = 0; i < 147456; i++); // Sleep
152 ; genAssign
000025 AE 40 00 [ 2] 153 ldw x, #0x4000
000028 1F 03 [ 2] 154 ldw (0x03, sp), x
00002A A6 02 [ 1] 155 ld a, #0x02
00002C 0F 01 [ 1] 156 clr (0x01, sp)
157 ; genLabel
00002E 158 00105$:
159 ; genMinus
00002E 1E 03 [ 2] 160 ldw x, (0x03, sp)
000030 1D 00 01 [ 2] 161 subw x, #0x0001
000033 1F 07 [ 2] 162 ldw (0x07, sp), x
000035 A2 00 [ 1] 163 sbc a, #0x00
000037 97 [ 1] 164 ld xl, a
000038 7B 01 [ 1] 165 ld a, (0x01, sp)
00003A A2 00 [ 1] 166 sbc a, #0x00
00003C 95 [ 1] 167 ld xh, a
168 ; genAssign
00003D 02 [ 1] 169 rlwa x
00003E 6B 01 [ 1] 170 ld (0x01, sp), a
000040 01 [ 1] 171 rrwa x
000041 16 07 [ 2] 172 ldw y, (0x07, sp)
000043 17 03 [ 2] 173 ldw (0x03, sp), y
000045 9F [ 1] 174 ld a, xl
175 ; genIfx
000046 16 07 [ 2] 176 ldw y, (0x07, sp)
000048 26 E4 [ 1] 177 jrne 00105$
178 ; peephole j22 jumped to 00105$ directly instead of via 00122$.
00004A 5D [ 2] 179 tnzw x
00004B 27 D8 [ 1] 180 jreq 00106$
181 ; peephole j19 jumped to 00106$ directly instead of via 00123$.
182 ; peephole j30 removed unused label 00122$.
183 ; peephole j5 changed absolute to relative unconditional jump.
184 ; peephole j30 removed unused label 00123$.
185 ; genGoto
00004D 20 DF [ 2] 186 jra 00105$
187 ; peephole j2d removed unreachable jump to 00106$.
188 ; peephole j5 changed absolute to relative unconditional jump.
189 ; genLabel
190 ; peephole j30 removed unused label 00108$.
191 ; genEndFunction
00004F 5B 08 [ 2] 192 addw sp, #8
000051 193 C$serial2.c$49$1$13 ==.
000051 194 XG$main$0$0 ==.
000051 81 [ 4] 195 ret
196 .area CODE
197 .area INITIALIZER
198 .area CABS (ABS)