Subversion Repositories Projects

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
99 gunterl 1
   1               		.file	"twimaster.c"
2
   2               		.arch atmega644p
3
   3               	__SREG__ = 0x3f
4
   4               	__SP_H__ = 0x3e
5
   5               	__SP_L__ = 0x3d
6
   6               	__tmp_reg__ = 0
7
   7               	__zero_reg__ = 1
8
   8               		.global __do_copy_data
9
   9               		.global __do_clear_bss
10
  10               		.text
11
  11               	.global	i2c_init
12
  13               	i2c_init:
13
  14               	/* prologue: frame size=0 */
14
  15               	/* prologue end (size=0) */
15
  16 0000 1092 B900 		sts 185,__zero_reg__
16
  17 0004 8AE2      		ldi r24,lo8(42)
17
  18 0006 8093 B800 		sts 184,r24
18
  19               	/* epilogue: frame size=0 */
19
  20 000a 0895      		ret
20
  21               	/* epilogue end (size=1) */
21
  22               	/* function i2c_init size 6 (5) */
22
  24               	.global	i2c_start
23
  26               	i2c_start:
24
  27               	/* prologue: frame size=0 */
25
  28               	/* prologue end (size=0) */
26
  29 000c 85EA      		ldi r24,lo8(-91)
27
  30 000e 8093 BC00 		sts 188,r24
28
  31 0012 80E0      		ldi r24,lo8(0)
29
  32 0014 90E0      		ldi r25,hi8(0)
30
  33               	/* epilogue: frame size=0 */
31
  34 0016 0895      		ret
32
  35               	/* epilogue end (size=1) */
33
  36               	/* function i2c_start size 6 (5) */
34
  38               	.global	i2c_stop
35
  40               	i2c_stop:
36
  41               	/* prologue: frame size=0 */
37
  42               	/* prologue end (size=0) */
38
  43 0018 84E9      		ldi r24,lo8(-108)
39
  44 001a 8093 BC00 		sts 188,r24
40
  45               	/* epilogue: frame size=0 */
41
  46 001e 0895      		ret
42
  47               	/* epilogue end (size=1) */
43
  48               	/* function i2c_stop size 4 (3) */
44
  50               	.global	i2c_write_byte
45
  52               	i2c_write_byte:
46
  53               	/* prologue: frame size=0 */
47
  54               	/* prologue end (size=0) */
48
  55 0020 1092 B900 		sts 185,__zero_reg__
49
  56 0024 8093 BB00 		sts 187,r24
50
  57 0028 85E8      		ldi r24,lo8(-123)
51
  58 002a 8093 BC00 		sts 188,r24
52
  59 002e 80E0      		ldi r24,lo8(0)
53
  60 0030 90E0      		ldi r25,hi8(0)
54
  61               	/* epilogue: frame size=0 */
55
  62 0032 0895      		ret
56
  63               	/* epilogue end (size=1) */
57
  64               	/* function i2c_write_byte size 10 (9) */
58
  66               	.global	__vector_26
59
  68               	__vector_26:
60
  69               	/* prologue: frame size=0 */
61
  70 0034 1F92      		push __zero_reg__
62
  71 0036 0F92      		push __tmp_reg__
63
  72 0038 0FB6      		in __tmp_reg__,__SREG__
64
  73 003a 0F92      		push __tmp_reg__
65
  74 003c 1124      		clr __zero_reg__
66
  75 003e 8F93      		push r24
67
  76 0040 9F93      		push r25
68
  77 0042 EF93      		push r30
69
  78 0044 FF93      		push r31
70
  79               	/* prologue end (size=9) */
71
  80 0046 8091 0000 		lds r24,twi_state
72
  81 004a 8F5F      		subi r24,lo8(-(1))
73
  82 004c 8093 0000 		sts twi_state,r24
74
  83 0050 8150      		subi r24,lo8(-(-1))
75
  84 0052 8330      		cpi r24,lo8(3)
76
  85 0054 01F0      		breq .L14
77
  86 0056 8430      		cpi r24,lo8(4)
78
  87 0058 00F4      		brsh .L19
79
  88 005a 8130      		cpi r24,lo8(1)
80
  89 005c 01F0      		breq .L12
81
  90 005e 8230      		cpi r24,lo8(2)
82
  91 0060 00F4      		brsh .L13
83
  92 0062 00C0      		rjmp .L38
84
  93               	.L19:
85
  94 0064 8530      		cpi r24,lo8(5)
86
  95 0066 01F0      		breq .L16
87
  96 0068 8530      		cpi r24,lo8(5)
88
  97 006a 00F0      		brlo .L17
89
  98 006c 8630      		cpi r24,lo8(6)
90
  99 006e 01F0      		breq .L17
91
 100 0070 8730      		cpi r24,lo8(7)
92
 101 0072 01F0      		breq .+2
93
 102 0074 00C0      		rjmp .L10
94
 103 0076 00C0      		rjmp .L18
95
 104               	.L38:
96
 105 0078 8091 0000 		lds r24,motor
97
 106 007c 880F      		lsl r24
98
 107 007e 8E5A      		subi r24,lo8(-(82))
99
 108 0080 00C0      		rjmp .L39
100
 109               	.L12:
101
 110 0082 8091 0000 		lds r24,motor
102
 111 0086 8F5F      		subi r24,lo8(-(1))
103
 112 0088 8093 0000 		sts motor,r24
104
 113 008c 8150      		subi r24,lo8(-(-1))
105
 114 008e 00C0      		rjmp .L47
106
 115               	.L20:
107
 116 0090 8091 0000 		lds r24,Motor_Vorne
108
 117               	.L39:
109
 118 0094 1092 B900 		sts 185,__zero_reg__
110
 119 0098 8093 BB00 		sts 187,r24
111
 120 009c 85E8      		ldi r24,lo8(-123)
112
 121               	.L40:
113
 122 009e 8093 BC00 		sts 188,r24
114
 123 00a2 00C0      		rjmp .L10
115
 124               	.L13:
116
 125 00a4 84E9      		ldi r24,lo8(-108)
117
 126 00a6 8093 BC00 		sts 188,r24
118
 127 00aa 8091 0000 		lds r24,motor
119
 128 00ae 8430      		cpi r24,lo8(4)
120
 129 00b0 00F4      		brsh .L24
121
 130 00b2 1092 0000 		sts twi_state,__zero_reg__
122
 131 00b6 00C0      		rjmp .L26
123
 132               	.L24:
124
 133 00b8 1092 0000 		sts motor,__zero_reg__
125
 134               	.L26:
126
 135 00bc 85EA      		ldi r24,lo8(-91)
127
 136 00be 00C0      		rjmp .L40
128
 137               	.L14:
129
 138 00c0 8091 0000 		lds r24,motorread
130
 139 00c4 880F      		lsl r24
131
 140 00c6 8D5A      		subi r24,lo8(-(83))
132
 141 00c8 00C0      		rjmp .L39
133
 142               	.L16:
134
 143 00ca 8091 BB00 		lds r24,187
135
 144 00ce E091 0000 		lds r30,motorread
136
 145 00d2 FF27      		clr r31
137
 146 00d4 E050      		subi r30,lo8(-(motor_rx))
138
 147 00d6 F040      		sbci r31,hi8(-(motor_rx))
139
 148 00d8 8083      		st Z,r24
140
 149               	.L17:
141
 150 00da 8091 0000 		lds r24,motorread
142
 151               	.L47:
143
 152 00de 8130      		cpi r24,lo8(1)
144
 153 00e0 01F0      		breq .L32
145
 154 00e2 8130      		cpi r24,lo8(1)
146
 155 00e4 00F0      		brlo .L20
147
 156 00e6 8230      		cpi r24,lo8(2)
148
 157 00e8 01F0      		breq .L33
149
 158 00ea 8330      		cpi r24,lo8(3)
150
 159 00ec 01F4      		brne .L10
151
 160 00ee 00C0      		rjmp .L34
152
 161               	.L32:
153
 162 00f0 8091 0000 		lds r24,Motor_Hinten
154
 163 00f4 00C0      		rjmp .L39
155
 164               	.L33:
156
 165 00f6 8091 0000 		lds r24,Motor_Rechts
157
 166 00fa 00C0      		rjmp .L39
158
 167               	.L34:
159
 168 00fc 8091 0000 		lds r24,Motor_Links
160
 169 0100 00C0      		rjmp .L39
161
 170               	.L18:
162
 171 0102 8091 0000 		lds r24,motorread
163
 172 0106 9091 BB00 		lds r25,187
164
 173 010a E82F      		mov r30,r24
165
 174 010c FF27      		clr r31
166
 175 010e E050      		subi r30,lo8(-(motor_rx))
167
 176 0110 F040      		sbci r31,hi8(-(motor_rx))
168
 177 0112 9483      		std Z+4,r25
169
 178 0114 8F5F      		subi r24,lo8(-(1))
170
 179 0116 8093 0000 		sts motorread,r24
171
 180 011a 8430      		cpi r24,lo8(4)
172
 181 011c 00F0      		brlo .L35
173
 182 011e 1092 0000 		sts motorread,__zero_reg__
174
 183               	.L35:
175
 184 0122 84E9      		ldi r24,lo8(-108)
176
 185 0124 8093 BC00 		sts 188,r24
177
 186 0128 8AE0      		ldi r24,lo8(10)
178
 187 012a 90E0      		ldi r25,hi8(10)
179
 188 012c 9093 0000 		sts (I2CTimeout)+1,r25
180
 189 0130 8093 0000 		sts I2CTimeout,r24
181
 190 0134 1092 0000 		sts twi_state,__zero_reg__
182
 191               	.L10:
183
 192 0138 8091 BC00 		lds r24,188
184
 193 013c 8068      		ori r24,lo8(-128)
185
 194 013e 8093 BC00 		sts 188,r24
186
 195               	/* epilogue: frame size=0 */
187
 196 0142 FF91      		pop r31
188
 197 0144 EF91      		pop r30
189
 198 0146 9F91      		pop r25
190
 199 0148 8F91      		pop r24
191
 200 014a 0F90      		pop __tmp_reg__
192
 201 014c 0FBE      		out __SREG__,__tmp_reg__
193
 202 014e 0F90      		pop __tmp_reg__
194
 203 0150 1F90      		pop __zero_reg__
195
 204 0152 1895      		reti
196
 205               	/* epilogue end (size=9) */
197
 206               	/* function __vector_26 size 144 (126) */
198
 208               	.global	i2c_reset
199
 210               	i2c_reset:
200
 211               	/* prologue: frame size=0 */
201
 212               	/* prologue end (size=0) */
202
 213 0154 4CEB      		ldi r20,lo8(188)
203
 214 0156 50E0      		ldi r21,hi8(188)
204
 215 0158 84E9      		ldi r24,lo8(-108)
205
 216 015a DA01      		movw r26,r20
206
 217 015c 8C93      		st X,r24
207
 218 015e 1092 0000 		sts twi_state,__zero_reg__
208
 219 0162 2BEB      		ldi r18,lo8(187)
209
 220 0164 30E0      		ldi r19,hi8(187)
210
 221 0166 F901      		movw r30,r18
211
 222 0168 8081      		ld r24,Z
212
 223 016a 1092 0000 		sts motor,__zero_reg__
213
 224 016e 80E8      		ldi r24,lo8(-128)
214
 225 0170 8C93      		st X,r24
215
 226 0172 1092 BD00 		sts 189,__zero_reg__
216
 227 0176 1092 BA00 		sts 186,__zero_reg__
217
 228 017a 1082      		st Z,__zero_reg__
218
 229 017c E9EB      		ldi r30,lo8(185)
219
 230 017e F0E0      		ldi r31,hi8(185)
220
 231 0180 1082      		st Z,__zero_reg__
221
 232 0182 A8EB      		ldi r26,lo8(184)
222
 233 0184 B0E0      		ldi r27,hi8(184)
223
 234 0186 1C92      		st X,__zero_reg__
224
 235 0188 1082      		st Z,__zero_reg__
225
 236 018a 8AE2      		ldi r24,lo8(42)
226
 237 018c 8C93      		st X,r24
227
 238 018e 85EA      		ldi r24,lo8(-91)
228
 239 0190 DA01      		movw r26,r20
229
 240 0192 8C93      		st X,r24
230
 241 0194 1082      		st Z,__zero_reg__
231
 242 0196 F901      		movw r30,r18
232
 243 0198 1082      		st Z,__zero_reg__
233
 244 019a 85E8      		ldi r24,lo8(-123)
234
 245 019c 8C93      		st X,r24
235
 246               	/* epilogue: frame size=0 */
236
 247 019e 0895      		ret
237
 248               	/* epilogue end (size=1) */
238
 249               	/* function i2c_reset size 38 (37) */
239
 251               	.global	twi_state
240
 252               	.global	twi_state
241
 253               		.section .bss
242
 256               	twi_state:
243
 257 0000 00        		.skip 1,0
244
 258               	.global	motor
245
 259               	.global	motor
246
 262               	motor:
247
 263 0001 00        		.skip 1,0
248
 264               	.global	motorread
249
 265               	.global	motorread
250
 268               	motorread:
251
 269 0002 00        		.skip 1,0
252
 270               		.comm motor_rx,8,1
253
 271               	/* File "twimaster.c": code  208 = 0x00d0 ( 185), prologues   9, epilogues  14 */
254
DEFINED SYMBOLS
255
                            *ABS*:00000000 twimaster.c
256
C:\Users\gunterl\AppData\Local\Temp/ccG704Yc.s:3      *ABS*:0000003f __SREG__
257
C:\Users\gunterl\AppData\Local\Temp/ccG704Yc.s:4      *ABS*:0000003e __SP_H__
258
C:\Users\gunterl\AppData\Local\Temp/ccG704Yc.s:5      *ABS*:0000003d __SP_L__
259
C:\Users\gunterl\AppData\Local\Temp/ccG704Yc.s:6      *ABS*:00000000 __tmp_reg__
260
C:\Users\gunterl\AppData\Local\Temp/ccG704Yc.s:7      *ABS*:00000001 __zero_reg__
261
C:\Users\gunterl\AppData\Local\Temp/ccG704Yc.s:13     .text:00000000 i2c_init
262
C:\Users\gunterl\AppData\Local\Temp/ccG704Yc.s:26     .text:0000000c i2c_start
263
C:\Users\gunterl\AppData\Local\Temp/ccG704Yc.s:40     .text:00000018 i2c_stop
264
C:\Users\gunterl\AppData\Local\Temp/ccG704Yc.s:52     .text:00000020 i2c_write_byte
265
C:\Users\gunterl\AppData\Local\Temp/ccG704Yc.s:68     .text:00000034 __vector_26
266
C:\Users\gunterl\AppData\Local\Temp/ccG704Yc.s:256    .bss:00000000 twi_state
267
C:\Users\gunterl\AppData\Local\Temp/ccG704Yc.s:262    .bss:00000001 motor
268
C:\Users\gunterl\AppData\Local\Temp/ccG704Yc.s:268    .bss:00000002 motorread
269
                            *COM*:00000008 motor_rx
270
C:\Users\gunterl\AppData\Local\Temp/ccG704Yc.s:210    .text:00000154 i2c_reset
271
 
272
UNDEFINED SYMBOLS
273
__do_copy_data
274
__do_clear_bss
275
Motor_Vorne
276
Motor_Hinten
277
Motor_Rechts
278
Motor_Links
279
I2CTimeout