📄 start12.lst
字号:
304: #ifdef FAR_DATA
305: PSHD ; save counter
0027 3b [2] PSHD
306: LDAB 1,X+ ; load destination page
0028 e630 [3] LDAB 1,X+
307: LDY 2,X+ ; destination address
002a ed31 [3] LDY 2,X+
308: #if defined(__HCS12X__)
309: STAB __GPAGE_ADR__
002c 5b10 [2] STAB 16
310: #else /* __HCS12X__ */
311: __PIC_JSR(_SET_PAGE) ; sets the destinations page register
312: #endif /* __HCS12X__ */
313: PULD ; restore counter
002e 3a [3] PULD
314: #else /* FAR_DATA */
315: LDY 2,X+ ; load destination address
316: #endif /* FAR_DATA */
317:
318: #if defined(__HCS12X__) && defined(FAR_DATA)
319: #if defined(__OPTIMIZE_FOR_SIZE__) /* -os, default */
320: Copy: PSHA
002f 36 [2] PSHA
321: LDAA 1,X+
0030 a630 [3] LDAA 1,X+
322: GSTAA 1,Y+ ; move a byte from ROM to the data area
0032 186a70 [3] GSTAA 1,Y+
323: PULA
0035 32 [3] PULA
324: __FEED_COP_IN_HLI() ; feed the COP if necessary /*lint !e505 !e522 asm code */
325: DBNE D,Copy ; copy-byte loop
0036 0434f6 [3] DBNE D,*-7 ;abs = 002f
326: #else
327: LSRD ; /2 and save bit 0 in the carry
328: BEQ Copy1 ; do we copy more than 1 byte?
329:
330: Copy: PSHD
331: LDD 2,X+
332: GSTD 2,Y+ ; move a word from ROM to the data area
333: PULD
334: __FEED_COP_IN_HLI() ; feed the COP if necessary /*lint !e505 !e522 asm code */
335: DBNE D,Copy ; copy-word loop
336: Copy1:
337: BCC NextBlock ; handle last byte?
338: LDAA 1,X+
339: GSTAA 1,Y+ ; move a byte from ROM to the data area
340: #endif
341: #elif defined(__OPTIMIZE_FOR_SIZE__) /* -os, default */
342: Copy: MOVB 1,X+,1,Y+ ; move a byte from ROM to the data area
343: __FEED_COP_IN_HLI() ; feed the COP if necessary /*lint !e505 !e522 asm code */
344: DBNE D,Copy ; copy-byte loop
345: #else /* __OPTIMIZE_FOR_TIME__ */
346: LSRD ; /2 and save bit 0 in the carry
347: BEQ Copy1 ; do we copy more than 1 byte?
348: Copy: MOVW 2,X+,2,Y+ ; move a word from ROM to the data area
349: __FEED_COP_IN_HLI() ; feed the COP if necessary /*lint !e505 !e522 asm code */
350: DBNE D,Copy ; copy-word loop
351: Copy1:
352: BCC NextBlock ; handle last byte?
353: MOVB 1,X+,1,Y+ ; copy the last byte
354: #endif /* __OPTIMIZE_FOR_SIZE__/__OPTIMIZE_FOR_TIME__ */
355: BRA NextBlock
0039 20e8 [3] BRA *-22 ;abs = 0023
356: funcInits: ; call of global construtors is only in c++ necessary
357: #if defined(__cplusplus)
358: #if defined(__ELF_OBJECT_FILE_FORMAT__)
359: #if defined( __BANKED__) || defined(__LARGE__)
360: LDY _startupData.nofInitBodies; load number of cpp.
361: BEQ done ; if cppcount == 0, goto done
362: LDX _startupData.initBodies ; load address of first module to initialize
363: nextInit:
364: LEAX 3,X ; increment to next init
365: PSHX ; save address of next function to initialize
366: PSHY ; save cpp counter
367: CALL [-3,X] ; use double indirect call to load the page register also
368: PULY ; restore cpp counter
369: PULX ; restore actual address
370: DEY ; decrement cpp counter
371: BNE nextInit
372: #else /* defined( __BANKED__) || defined(__LARGE__) */
373:
374: LDD _startupData.nofInitBodies; load number of cpp.
375: BEQ done ; if cppcount == 0, goto done
376: LDX _startupData.initBodies ; load address of first module to initialize
377: nextInit:
378: LDY 2,X+ ; load address of first module to initialize
379: PSHD
380: PSHX ; save actual address
381: JSR 0,Y ; call initialization function
382: PULX ; restore actual address
383: PULD ; restore cpp counter
384: DBNE D, nextInit
385: #endif /* defined( __BANKED__) || defined(__LARGE__) */
386: #else /* __ELF_OBJECT_FILE_FORMAT__ */
387: LDX _startupData.mInits ; load address of first module to initialize
388: #if defined( __BANKED__) || defined(__LARGE__)
389: nextInit: LDY 3,X+ ; load address of initialization function
390: BEQ done ; stop when address == 0
391: ; in common environments the offset of a function is never 0, so this test could be avoided
392: #ifdef __InitFunctionsMayHaveOffset0__
393: BRCLR -1,X, done, 0xff ; stop when address == 0
394: #endif /* __InitFunctionsMayHaveOffset0__ */
395: PSHX ; save address of next function to initialize
396: CALL [-3,X] ; use double indirect call to load the page register also
397: #else /* defined( __BANKED__) || defined(__LARGE__) */
398: nextInit:
399: LDY 2,X+ ; load address of first module to initialize
400: BEQ done ; stop when address of function == 0
401: PSHX ; save actual address
402: JSR 0,Y ; call initialization function
403: #endif /* defined( __BANKED__) || defined(__LARGE__) */
404: PULX ; restore actual address
405: BRA nextInit
406: #endif /* __ELF_OBJECT_FILE_FORMAT__ */
407: done:
408: #endif /* __cplusplus */
409: }
410: }
003b 0a [7] RTC
411: #endif /* __ONLY_INIT_SP */
412:
413: #if defined( __ELF_OBJECT_FILE_FORMAT__) && defined(__cplusplus ) && 0 /* the call to main does not support to return anymore */
414:
415: #if !defined(FAR_DATA) && (defined( __BANKED__) || defined(__LARGE__))
416: static void __far Fini(void)
417: #else
418: static void Fini(void)
419: #endif
420: {
421: /* purpose: 1) call global destructors in C++ */
422: __asm {
423: #if defined( __BANKED__) || defined(__LARGE__)
424:
425: LDY _startupData.nofFiniBodies; load number of cpp.
426: BEQ done ; if cppcount == 0, goto done
427: LDX _startupData.finiBodies ; load address of first module to finalize
428: nextInit2:
429: LEAX 3,X ; increment to next init
430: PSHX ; save address of next function to finalize
431: PSHY ; save cpp counter
432: CALL [-3,X] ; use double indirect call to load the page register also
433: PULY ; restore cpp counter
434: PULX ; restore actual address
435: DEY ; decrement cpp counter
436: BNE nextInit2
437: #else /* defined( __BANKED__) || defined(__LARGE__) */
438:
439: LDD _startupData.nofFiniBodies; load number of cpp.
440: BEQ done ; if cppcount == 0, goto done
441: LDX _startupData.finiBodies ; load address of first module to finalize
442: nextInit2:
443: LDY 2,X+ ; load address of first module to finalize
444: PSHD
445: PSHX ; save actual address
446: JSR 0,Y ; call finalize function
447: PULX ; restore actual address
448: PULD ; restore cpp counter
449: DBNE D, nextInit2
450: #endif /* defined(__BANKED__) || defined(__LARGE__) */
451: done:;
452: }
453: }
454: #endif
455:
456:
457:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -