📄 start.lst
字号:
371 ;
00AA 372 INIT_01:
00AA 06F40C00 373 ADD R4,#0CH ; skip DBPTR, DPTR and DW
00AE 0DBA 374 JMP CC_UC, INIT ; continue with next initialization
375
376
00B0 377 INIT_END: ;
378
379 ; C166_BSS
380
00B0 E6F40000 R 381 MOV R4, #POF ?C166_BSS_HEAD ; move intra-page offset address rom
382 ; data section C166_BSS to R4
00B4 383 BSS_DPP0: ;
00B4 E6000000 R 384 MOV DPP0,#PAG ?C166_BSS_HEAD ; load data page pointer register DPP0
385 ; with data page of rom data C166_BSS
00B8 CC00 386 NOP ; delay for pipeline effect
387
388 #line 391 "c:\program files\tasking\c166 v8.0\include\_c_init.asm"
391
00BA 392 BSS: ;
00BA 9854 393 MOV R5, [R4+] ; BSS block header code -> R5
394 #line 403 "c:\program files\tasking\c166 v8.0\include\_c_init.asm"
403
404
00BC 4856 405 CMP R5, #06H ; check if header code 6 (far)
00BE 2D1C 406 JMP CC_EQ, BSS_06 ;
407
00C0 4857 408 CMP R5, #07H ; check if header code 7 (huge)
00C2 3D27 409 JMP CC_NE, BSS_END ; if(no header code) end initialization
410
TASKING C166/ST10 assembler v8.0r1 Build 256 SN 00096962 Date: Apr 23 2004 Time: 16:27:03 Page: 13
start
LOC CODE LINE SOURCELINE
411
00C4 412 BSS_07: ; clear huge ram data (data > 64 K)
00C4 9814 413 MOV SOF_RAM, [R4+] ; move intra-segment offset address ram
414 ; data block to SOF_RAM=R1
00C6 9834 415 MOV R3, [R4+] ; move segment address ram data block
416 ; to R3
417 ; process data page number ram data
00C8 F173 418 MOV RH3, SOF_RAM_H ; R3.15, R3.14=low bits of page number *byte forwarding
)
419
420
421
00CA 1C23 422 ROL R3, #2 ; shift R3.15, R3.14 to R3.1 and R3.0
00CC 66F3FF03 423 AND R3, #03FFH ; mask page number
00D0 F6F302FE 424 MOV DPP1, R3 ; load data page pointer register DPP1
425 ; with data page of ram data block
00D4 FEF1 426 BCLR SOF_RAM.15 ; DPP1:POF_RAM ->SOF_RAM
00D6 EFF1 427 BSET SOF_RAM.14 ;
428 ;
00D8 9854 429 MOV R5, [R4+] ; number of bytes (R6:R5) to clear in
00DA 9864 430 MOV R6, [R4+] ; specified ram data block.
431 ; MSW=R6, LSW=R5 (long word)
432 ;
00DC 433 CB07_2: ; Service Watchdog Timer (if enabled)
00DC A005 434 CMPD1 R5, #0 ; test if all bytes are cleared and
00DE 3D02 435 JMP CC_NE, CB07_1 ; decrement number of bytes to clear.
436 ;
00E0 A006 437 CMPD1 R6, #0 ;
438 #line 441 "c:\program files\tasking\c166 v8.0\include\_c_init.asm"
441
00E2 2DEB 442 JMP CC_EQ, BSS ; if( block end ) next initialization
443 ;
444
00E4 A4011CFF 445 CB07_1: MOVB [SOF_RAM], ZEROS ; clear byte
00E8 86F1FF7F 446 CMPI1 SOF_RAM, #07FFFH ; test end of data page and inc SOF_RAM
00EC 3DF7 447 JMP CC_NE, CB07_2 ; if(no page end) next byte clear
448 ;
00EE E6F10040 449 MOV SOF_RAM, #04000H ; preset offset address ram data
00F2 06010100 450 ADD DPP1, #1 ; next page ram data; increment DPP1
00F6 0DF2 451 JMP CC_UC, CB07_2 ; jump for next byte clear
452 #line 455 "c:\program files\tasking\c166 v8.0\include\_c_init.asm"
455
456
00F8 457 BSS_06: ; clear far ram data. (CPU mode is
458 ; segmented with DPP usage linear or
459 ; paged.)
00F8 9814 460 MOV POF_RAM, [R4+] ; move intra-page offset address ram
461 ; data block to POF_RAM=R1
00FA FEF1 462 BCLR SOF_RAM.15 ; DPP1:POF_RAM ->SOF_RAM
00FC EFF1 463 BSET SOF_RAM.14 ;
00FE 940402FE 464 MOV DPP1, [R4] ; load data page pointer register DPP1
465 ; with data page of ram data block
0102 0842 466 ADD R4, #2 ; inc offset address to ram data section
467 ; C166_BSS and also insure a delay for
468 ; pipeline effect. (DPP1 set)
TASKING C166/ST10 assembler v8.0r1 Build 256 SN 00096962 Date: Apr 23 2004 Time: 16:27:03 Page: 14
start
LOC CODE LINE SOURCELINE
469 ;
0104 9854 470 MOV R5, [R4+] ; number of bytes to clear in specified
471 ; ram data block
472 ;
0106 473 CB06_1: ; Service Watchdog Timer (if enabled)
0106 A005 474 CMPD1 R5, #0 ; test on data block end
475 #line 478 "c:\program files\tasking\c166 v8.0\include\_c_init.asm"
478
0108 2DD8 479 JMP CC_EQ, BSS ; if( block end ) next initialization
480
481
010A A4011CFF 482 MOVB [SOF_RAM], ZEROS ; clear byte
010E 0811 483 ADD SOF_RAM, #1 ; inc SOF_RAM
0110 0DFA 484 JMP CC_UC, CB06_1 ; jump for next byte clear
485 #line 488 "c:\program files\tasking\c166 v8.0\include\_c_init.asm"
488
489
490
491 #line 521 "c:\program files\tasking\c166 v8.0\include\_c_init.asm"
521
0112 522 BSS_END:
523
524 #line 529 "c:\program files\tasking\c166 v8.0\include\_c_init.asm"
529
530
531
0112 E6000000 532 MOV DPP0, #0 ; restore DPP0 to its default value
0116 E6010000 R 533 MOV DPP1, #PAG C166_XGROUP ; set DPP1 to page of xnear data/user stack
011A E6020000 R 534 MOV DPP2, #PAG C166_DGROUP ; set DPP2 to page of default data
535 ; group
536 #line 538 "c:\program files\tasking\c166 v8.0\include\_c_init.asm"
538
539
011E CB00 540 ret ; return address on the system stack
541 __C_INIT ENDP
542 __C_INIT_PR ENDS
543 #line 24 "start.asm"
24
25 NAME CSTART ; module name
26
27 PUBLIC __IDLE ; cstart end
28 PUBLIC __EXIT ; address to jump to on 'exit()'
29 EXTERN _main:NEAR ; start label user program
30 EXTERN __C_INIT:NEAR
31
32 __CSTART_PR SECTION CODE WORD PUBLIC 'CPROGRAM'
33 __CSTART PROC TASK __CSTART_TASK INTNO __CSTART_INUM = 0
34
0000 E60C0604 35 MOV ADDRSEL1, #0x0406
0004 0A8AFFAE 36 BFLDL BUSCON1, #0xFF, #0x04AE&0xFF
0008 1A8A04F6 37 BFLDH BUSCON1, #0xF6, #(0x04AE>>8)&0xFF
000C 0A89FF84 38 BFLDL SYSCON, #0xFF, #0x0184&0xFF
0010 1A8901FF 39 BFLDH SYSCON, #0xFF, #(0x0184>>8)&0xFF
0014 D180 40 EXTR #1
0016 E6120D00 1 41 MOV XPERCON, #0x000D
TASKING C166/ST10 assembler v8.0r1 Build 256 SN 00096962 Date: Apr 23 2004 Time: 16:27:03 Page: 15
start
LOC CODE LINE SOURCELINE
42
43 #line 344 "c:\program files\tasking\c166 v8.0\include\head.asm"
001A E0D0 344 mov R0, #0x000D
345 #line 43 "start.asm"
001C F6F07EEB 43 mov XPEREMU, R0 ; initialize XPEREMU
44
45
0020 D120 46 ATOMIC #3
0022 E6090000 3R 47 MOV SP, #?SYSSTACK_TOP ; Set stack pointer.
0026 E60A0000 2R 48 MOV STKOV, #?SYSSTACK_BOTTOM + 6*2 ; Set stack overflow pointer.
002A E60B0000 1R 49 MOV STKUN, #?SYSSTACK_TOP ; Set stack underflow pointer.
50
002E E6080000 R 51 MOV CP, #CSTART_RBANK ; Set context pointer.
0032 CC00 52 NOP
53
0034 E6010000 R 54 MOV DPP1, #PAG C166_XGROUP ; set DPP1 to page of user stack / xnear data
0038 E6F00000 R 55 MOV R0, #POF (?USRSTACK_TOP - 2) + 0x4002 ; set user stack pointer
003C A55AA5A5 56 DISWDT ; Disable watchdog timer
57
0040 B54AB5B5 58 EINIT ; End of initialization
59
60 ; disable(0)/enable(1) initialization of bit
61 ; variables at startup
0044 CA000000 R 62 call __C_INIT ; return address pushed on system stack (@Rx not used)
; initalization of global/static data
63
0048 BF88 64 BSET IEN ; allow monitor to break application
65
004A E00C 66 MOV R12, #0 ; set argc to 0
004C E00D 67 MOV R13, #0 ;
004E E00E 68 MOV R14, #0 ; set argv[] to 0
69
0050 CA000000 R 70 call _main ; return address pushed on system stack (@Rx not used)
71
72 ; The exit() function causes normal program termination to occur. First, all
73 ; functions registered by the atexit() function are called in the reverse
74 ; order. Next, all open streams with unwritten buffered data are flushed, all
75 ; open streams are closed and all files created by the tmpfile() function are
76 ; removed. The status value passed to exit is returned in R4.
0054 77 __EXIT: LABEL FAR ; the exit() or abort() function jumps
78 ; to this entry.
0054 87788787 79 __IDLE: IDLE ; Power down CPU until peripheral inter-
80 ; rupt or external interrupt occurs.
0058 0DFD 81 JMPR CC_UC, __IDLE ; set idle mode again.
82 RETV ; Virtual return.
83 __CSTART ENDP
84 __CSTART_PR ENDS
85
86
87 C166_US SECTION DATA WORD GLBUSRSTACK 'CUSTACK'
0000 88 DS 2 ; Allocate a user stack of at least 2 bytes
89 C166_US ENDS
90
91 C166_DGROUP DGROUP __DUMMY
92 __DUMMY SECTION DATA WORD PUBLIC 'CNEAR'
TASKING C166/ST10 assembler v8.0r1 Build 256 SN 00096962 Date: Apr 23 2004 Time: 16:27:03 Page: 16
start
LOC CODE LINE SOURCELINE
93 __DUMMY ENDS
94 C166_XGROUP DGROUP __XDUMMY,C166_US
95 __XDUMMY SECTION DATA WORD PUBLIC
96 __XDUMMY ENDS
97
98 CSTART_RBANK REGDEF R0-R15 ; Register usage
99 SSKDEF 0 ; System stack size
100
101 END
total errors: 0, warnings: 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -