00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #if defined(__AVR_ATmega128__)
00029
00030
00031 #include "femtoos_ATmega128.asm"
00032
00033 #elif defined(__AVR_ATmega1280__)
00034
00035
00036 #include "femtoos_ATmega1280.asm"
00037
00038 #elif defined(__AVR_ATmega1281__)
00039
00040
00041 #include "femtoos_ATmega1281.asm"
00042
00043 #elif defined(__AVR_ATmega1284P__)
00044
00045
00046 #warning "Port for this device (ATmega1284P) is untested"
00047 #include "femtoos_ATmega1284P.asm"
00048
00049 #elif defined(__AVR_ATmega16__)
00050
00051
00052 #include "femtoos_ATmega16A.asm"
00053
00054 #elif defined(__AVR_ATmega162__)
00055
00056
00057 #include "femtoos_ATmega162.asm"
00058
00059 #elif defined(__AVR_ATmega164P__)
00060
00061
00062 #include "femtoos_ATmega164P.asm"
00063
00064 #elif defined(__AVR_ATmega168__)
00065
00066
00067 #include "femtoos_ATmega168.asm"
00068
00069 #elif defined(__AVR_ATmega168P__)
00070
00071
00072 #include "femtoos_ATmega168P.asm"
00073
00074 #elif defined(__AVR_ATmega2560__)
00075
00076
00077 #include "femtoos_ATmega2560.asm"
00078
00079 #elif defined(__AVR_ATmega2561__)
00080
00081
00082 #include "femtoos_ATmega2561.asm"
00083
00084 #elif defined(__AVR_ATmega32__)
00085
00086
00087 #include "femtoos_ATmega32A.asm"
00088
00089 #elif defined(__AVR_ATmega324P__)
00090
00091
00092 #include "femtoos_ATmega324P.asm"
00093
00094 #elif defined(__AVR_ATmega325__)
00095
00096
00097 #include "femtoos_ATmega325.asm"
00098
00099 #elif defined(__AVR_ATmega3250__)
00100
00101
00102 #include "femtoos_ATmega3250.asm"
00103
00104 #elif defined(__AVR_ATmega325P__)
00105
00106
00107 #include "femtoos_ATmega325P.asm"
00108
00109 #elif defined(__AVR_ATmega3250P__)
00110
00111
00112 #include "femtoos_ATmega3250P.asm"
00113
00114 #elif defined(__AVR_ATmega328P__)
00115
00116
00117 #include "femtoos_ATmega328P.asm"
00118
00119 #elif defined(__AVR_ATmega48__)
00120
00121
00122 #include "femtoos_ATmega48.asm"
00123
00124 #elif defined(__AVR_ATmega48P__)
00125
00126
00127 #include "femtoos_ATmega48P.asm"
00128
00129 #elif defined(__AVR_ATmega64__)
00130
00131
00132 #include "femtoos_ATmega64.asm"
00133
00134 #elif defined(__AVR_ATmega645__)
00135
00136
00137 #warning "Port for this device (ATmega645) is untested"
00138 #include "femtoos_ATmega645.asm"
00139
00140 #elif defined(__AVR_ATmega6450__)
00141
00142
00143 #warning "Port for this device (ATmega6450) is untested"
00144 #include "femtoos_ATmega6450.asm"
00145
00146 #elif defined(__AVR_ATmega640__)
00147
00148
00149 #include "femtoos_ATmega640.asm"
00150
00151 #elif defined(__AVR_ATmega644__)
00152
00153
00154 #include "femtoos_ATmega644.asm"
00155
00156 #elif defined(__AVR_ATmega644P__)
00157
00158
00159 #include "femtoos_ATmega644P.asm"
00160
00161 #elif defined(__AVR_ATmega8__)
00162
00163
00164 #include "femtoos_ATmega8.asm"
00165
00166 #elif defined(__AVR_ATmega8515__)
00167
00168
00169 #include "femtoos_ATmega8515.asm"
00170
00171 #elif defined(__AVR_ATmega8535__)
00172
00173
00174 #include "femtoos_ATmega8535.asm"
00175
00176 #elif defined(__AVR_ATmega88__)
00177
00178
00179 #include "femtoos_ATmega88.asm"
00180
00181 #elif defined(__AVR_ATmega88P__)
00182
00183
00184 #include "femtoos_ATmega88P.asm"
00185
00186 #elif defined(__AVR_ATtiny2313__)
00187
00188
00189 #include "femtoos_ATtiny2313.asm"
00190
00191 #elif defined(__AVR_ATtiny24__)
00192
00193
00194 #include "femtoos_ATtiny24.asm"
00195
00196 #elif defined(__AVR_ATtiny25__)
00197
00198
00199 #include "femtoos_ATtiny25.asm"
00200
00201 #elif defined(__AVR_ATtiny261__)
00202
00203
00204 #include "femtoos_ATtiny261.asm"
00205
00206 #elif defined(__AVR_ATtiny43U__)
00207
00208
00209 #warning "Port for this device (ATtiny43U) is untested"
00210 #include "femtoos_ATtiny43U.asm"
00211
00212 #elif defined(__AVR_ATtiny44__)
00213
00214
00215 #include "femtoos_ATtiny44.asm"
00216
00217 #elif defined(__AVR_ATtiny45__)
00218
00219
00220 #include "femtoos_ATtiny45.asm"
00221
00222 #elif defined(__AVR_ATtiny461__)
00223
00224
00225 #include "femtoos_ATtiny461.asm"
00226
00227 #elif defined(__AVR_ATtiny48__)
00228
00229
00230 #include "femtoos_ATtiny48.asm"
00231
00232 #elif defined(__AVR_ATtiny84__)
00233
00234
00235 #include "femtoos_ATtiny84.asm"
00236
00237 #elif defined(__AVR_ATtiny85__)
00238
00239
00240 #include "femtoos_ATtiny85.asm"
00241
00242 #elif defined(__AVR_ATtiny861__)
00243
00244
00245 #include "femtoos_ATtiny861.asm"
00246
00247 #elif defined(__AVR_ATtiny88__)
00248
00249
00250 #include "femtoos_ATtiny88.asm"
00251
00252 #else
00253
00254
00255 #error "Port for this device is absent"
00256
00257 #endif
00258
00259
00266 #if defined(FEMTOOS_DEVICE_ASSEMBLY) && (defSysGCCstartup == cfgOverride)
00267
00268 .global __init
00269 .global __do_clear_bss
00270
00271
00272
00273
00274
00275 .global __start_main
00276
00277 .section .init0,"ax"
00278 __init:
00279 clr r1
00280 __do_clear_bss:
00281 #if (devRAMbegin >= 0x100)
00282 ldi r25, hi8(devRAMbegin)
00283 #endif
00284 ldi r26, lo8(devRAMend)
00285 ldi r27, hi8(devRAMend)
00286 __do_clear_bss_loop:
00287 st -X, r1
00288 cpi r26, lo8(devRAMbegin)
00289 #if (devRAMbegin >= 0x100)
00290 cpc r27, r25
00291 #else
00292 cpc r27, r1
00293 #endif
00294 brne __do_clear_bss_loop
00295 __do_stack_def:
00296 ldi r26, lo8(xOS+(OSstackInit))
00297 out (_SFR_IO_ADDR(SPL)), r26
00298 #if (devRAMend > 0x100)
00299 ldi r27, hi8(xOS+(OSstackInit))
00300 out (_SFR_IO_ADDR(SPH)), r27
00301 #endif
00302 __start_main:
00303 #if (devFLASHsize <= 0x1000U)
00304 rjmp main
00305 #else
00306 jmp main
00307 #endif
00308
00309
00310
00311
00312
00313 #endif