Chapter 5 Detailed Applications - 87 -
153 ;--------------------------------------------------------
154 BCOPY data_FEI_top,data_FE_top,data_FE
155 BCOPY data_FOI_top,data_FO_top,data_FO
156
157 LDC #__Sys_Sp,SP
158 LDC #__Sys_Sp,FB
159
160
161 ;-----------------------------------------------------------------
162 ; Set System IPL and Set Interrupt Vector
163 ;-----------------------------------------------------------------
164 MOV.B #0,R0L
165 MOV.B #__SYS_IPL,R0H
166 LDC R0,FLG
167 LDC #__INT_VECTOR,INTB
168
169 ; +-----------------------------------------------------+
170 ; | System timer interrupt setting |
171 ; +-----------------------------------------------------+
172 .IF USE_TIMER
173 MOV.B #stmr_mod_val,stmr_mod_reg+regoffset ; set timer mode
174 MOV.W #stmr_cnt,stmr_ctr_reg+regoffset ; set interval count
175 MOV.B #stmr_int_IPL,stmr_int_reg ; set timer IPL
176 OR.B #stmr_bit+1,stmr_start+regoffset ; system timer start
177 .ENDIF
178
179 ; +-----------------------------------------------------+
180 ; | System timer initialize |
181 ; +-----------------------------------------------------+
182 .IF USE_SYSTEM_TIME
183 MOV.W #__D_Sys_TIME_L,__Sys_time+4
184 MOV.W #__D_Sys_TIME_M,__Sys_time+2
185 MOV.W #__D_Sys_TIME_H,__Sys_time
186 .ENDIF
187
188 ; +-----------------------------------------------------+
189 ; | User Initial Routine ( if there are ) |
190 ; +-----------------------------------------------------+
191 ; Initialize standard I/O
192 .GLB _init
193 JSR.A _init
194
195 ; +-----------------------------------------------------+
196 ; | Initalization of System Data Area |
197 ; +-----------------------------------------------------+
198 JSR.W __init_sys
199 JSR.W __init_tsk
200
201 .IF __MR_TIMEOUT
202 .GLB __init_tout
203 JSR.W __init_tout
204 .ENDIF
205
206 .IF __NUM_FLG
207 .GLB __init_flg
208 JSR.W __init_flg
209 .ENDIF
210
211 .IF __NUM_SEM
212 .GLB __init_sem
213 JSR.W __init_sem
214 .ENDIF
215
216 .IF __NUM_DTQ
217 .GLB __init_dtq
218 JSR.W __init_dtq
219 .ENDIF
220
221 .IF __NUM_VDTQ ;*A1*
222 .GLB __init_vdtq
223 JSR.W __init_vdtq
224 .ENDIF
225
226 .IF __NUM_MBX
227 .GLB __init_mbx
228 JSR.W __init_mbx
229 .ENDIF
230
231 .IF ALARM_HANDLER
232 .GLB __init_alh