?? start.lst
字號:
C166/ST10 assembler v6.0 r2 SN00082920-083 (c) 1998 TASKING, Inc. Date: Dec 5 2000 Time: 10:02:43 Page: 1
start
LOC CODE LINE SOURCELINE
1 #line 1 "d:\c166\lib\src\start.asm"
1 ; @(#)start.asm 1.2 98/04/15
2 ;*****************************************************************************
3 ;*
4 ;* MODULE : start.asm
5 ;*
6 ;* DESCRIPTION : Generic C startup code for the entire C166 family
7 ;*
8 ;* - Include cstartx.asm for CPU's based on 'extended architecture'
9 ;* (e.g. C161x, C163, C164xx, C165, C167xx, ST10-262).
10 ;* This is the default behavior.
11 ;* - Include cstart.asm for non-extended CPU's (e.g. SAB 80C166, GOLD).
12 ;* - Macros can be set on the command line of the macro pre-processor,
13 ;* using the DEFINE() control. Syntax: DEF( macro [, replacement] )
14 ;* Example:
15 ;* m166 cstart.asm DEF(MODEL,LARGE) DEF(_CPU,161O) DEF(_EXT,1)
16 ;*
17 ;* NOTE : When using EDE all the macros are automatically set by
18 ;* the Project Options... dialog from the EDE menu.
19 ;*
20 ;* COPYRIGHTS : 1997 TASKING, Inc.
21 ;*
22 ;*****************************************************************************
23
24 $CASE
25 $GENONLY
26 $DEBUG
27 $NOLOCALS
28
29
30
31
32
33 ; get the maximum performance.
34
35 ; 'abort()' is used.
36
37 ; used.
38
39 ; startup, set to 1 if "bit b = 1;" is used.
40
41 ; set to 1 for multiplexed bus.
42
43
44
45 ;*****************************************************************************
46 ;*
47 ;* MODULE : cstartx.asm
48 ;*
49 ;* DESCRIPTION : C startup code for extended C166 architecture CPU's
50 ;* (e.g. C161x, C163, C164xx, C165, C167xx, ST10-262).
51 ;*
52 ;* - Processor initialization.
53 ;* - Initialization of static variables in internal or external
54 ;* ram is done in '_c_init.asm'.
C166/ST10 assembler v6.0 r2 SN00082920-083 (c) 1998 TASKING, Inc. Date: Dec 5 2000 Time: 10:02:43 Page: 2
start
LOC CODE LINE SOURCELINE
55 ;* - Call the user program: main().
56 ;* - On exit cpu is set in idle mode.
57 ;*
58 ;* COPYRIGHTS : 1998 TASKING, Inc.
59 ;*
60 ;*****************************************************************************
61
62 $CHECKCPU16
63 $NOMOD166 ; disable the internal set of SAB 80C166 SFRs
64 $STDNAMES(reg167.def) ; use extended set of SFR's (BUSCON0 etc.)
65
66 ;*****************************************************************************
67 ;*
68 ;* MODULE : head.asm
69 ;*
70 ;* APPLICATION : run time library C16x/ST10
71 ;*
72 ;* DESCRIPTION : This header file is included in every runtime library module.
73 ;*
74 ;* - Set default value of macros (when not defined on the command-line/EDE):
75 ;* _EXT, _USRSTACK, _SINGLE_FP, MODEL, FIX_BFWD, FIX_MULDIV
76 ;* - Check macro values and activate the corresponding assembler controls
77 ;* - Define the _CALL and _RET macros for the User Stack Model
78 ;*
79 ;*
80 ;* COPYRIGHTS : 1997 TASKING, Inc.
81 ;*
82 ;*****************************************************************************
83
84
85
86
87
88
89
90
91
92
93 ; 1 for fixing the Byte forwarding problem
94
95
96 ;
97 ; Check macros and perform appropriate action
98 ;
99
100 $EXTEND ; enable all architecture extensions
101
102
103
104
105
106
107
108
109 $MODEL(large)
C166/ST10 assembler v6.0 r2 SN00082920-083 (c) 1998 TASKING, Inc. Date: Dec 5 2000 Time: 10:02:43 Page: 3
start
LOC CODE LINE SOURCELINE
110 $SEGMENTED
111
112
113
114 ; When FIX_MULDIV is defined to "ILVL" the protection is not done by BCLR IEN
115 ; but by BFLDH PSW, #0F0h, #0F0h. Note that not all modules support this.
116 ; Make sure that this macro is always defined by the following lines.
117
118
119
120
121 ; The macro _BFWDNOP() expands to a NOP instruction when FIX_BFWD
122 ; is set to 1. This is used for a software bypass for the Erroneous Byte
123 ; Forwarding problem of older steps of the CPU.
124
125
126
127
128 ; Macro _CALL() creates the code for a direct/indirect function call
129 ; Macro _RET() creates the code for function return.
130 ; These macro's are added to support user stack function call and return.
131 ; User stack code is generated if variable _USRSTACK is set, else a normal
132 ; function call and return (CALL/RET) are generated.
133 ; Rx is a temporary register. Most run-time routines use R2 for it.
134 ; Register R2 is used in the return stub function and in the return macro for
135 ; tiny and medium model, so operands may not be passed via register R2 ! R2 is
136 ; free for use if _USRSTACK option is enabled in the C-compiler.
137
138
139
140
141
142
143 ;*****************************************************************************
144 ;*
145 ;* MODULE : _c_init.asm
146 ;*
147 ;* DESCRIPTION : C copy table code for C16x/ST10 microcontroller.
148 ;*
149 ;* - Initialization of static variables in internal or external
150 ;* ram. C variables which have to be initialized are specified
151 ;* in ROM section C166_INIT. C variables which must
152 ;* be cleared are specified in ROM section C166_BSS.
153 ;* - Set user stack pointer.
154 ;*
155 ;* COPYRIGHTS : 1997 TASKING, Inc.
156 ;*
157 ;*****************************************************************************
158
159 ASSUME DPP3:SYSTEM ; assume system data page pointer.
160
161 ASSUME DPP2:?FPSTKUN
162 ASSUME DPP2:?FPSP
163
164
C166/ST10 assembler v6.0 r2 SN00082920-083 (c) 1998 TASKING, Inc. Date: Dec 5 2000 Time: 10:02:43 Page: 4
start
LOC CODE LINE SOURCELINE
165
166
167 PUBLIC __C_INIT
168
169 ; Predefined functions for register R1, R2 and R3.
170 POF_RAM LIT 'R1' ; Page offset address ram data.
171 SOF_RAM LIT 'R1' ; Segment offset address ram data.
172 SOF_RAM_H LIT 'RH1' ; Segment address high byte.
173 POF_ROM LIT 'R2' ; Page offset address rom data.
174 SOF_ROM LIT 'R2' ; Segment offset address rom data.
175 SOF_ROM_H LIT 'RH2' ; Segment address high byte.
176 BP_RAM LIT 'R3' ; Bit position ram data
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -