📄 startup400.lst
字号:
00B8.2 +1 226 sbit PX1 = IP^2;
00B8.1 +1 227 sbit PT0 = IP^1;
00B8.0 +1 228 sbit PX0 = IP^0;
+1 229
0098.7 +1 230 sbit SM0 = SCON0^7; /* Alternate SM0_FE_0 */
0098.6 +1 231 sbit SM1 = SCON0^6; /* Alternate SM1_0 */
0098.5 +1 232 sbit SM2 = SCON0^5; /* Alternate SM2_0 */
0098.4 +1 233 sbit REN = SCON0^4; /* Alternate REN_0 */
0098.3 +1 234 sbit TB8 = SCON0^3; /* Alternate TB8_0 */
0098.2 +1 235 sbit RB8 = SCON0^2; /* Alternate RB8_0 */
0098.1 +1 236 sbit TI = SCON0^1; /* Alternate TI_0 */
0098.0 +1 237 sbit RI = SCON0^0; /* Alternate RI_0 */
+1 238
00C0.7 +1 239 sbit SM01 = SCON1^7; /* Alternate SM0_FE_1 */
00C0.6 +1 240 sbit SM11 = SCON1^6; /* Alternate SM1_1 */
00C0.5 +1 241 sbit SM21 = SCON1^5; /* Alternate SM2_1 */
00C0.4 +1 242 sbit REN1 = SCON1^4; /* Alternate REN_1 */
00C0.3 +1 243 sbit TB81 = SCON1^3; /* Alternate TB8_1 */
00C0.2 +1 244 sbit RB81 = SCON1^2; /* Alternate RB8_1 */
00C0.1 +1 245 sbit TI1 = SCON1^1; /* Alternate TI_1 */
00C0.0 +1 246 sbit RI1 = SCON1^0; /* Alternate RI_1 */
+1 247
00C8.7 +1 248 sbit TF2 = T2CON^7;
00C8.6 +1 249 sbit EXF2 = T2CON^6;
00C8.5 +1 250 sbit RCLK = T2CON^5;
00C8.4 +1 251 sbit TCLK = T2CON^4;
00C8.3 +1 252 sbit EXEN2 = T2CON^3;
00C8.2 +1 253 sbit TR2 = T2CON^2;
00C8.1 +1 254 sbit C_T2 = T2CON^1;
00C8.0 +1 255 sbit CP_RL2= T2CON^0;
+1 256
AX51 MACRO ASSEMBLER STARTUP400 01/24/07 12:40:12 PAGE 5
00D8.7 +1 257 sbit SMOD_1= WDCON^7;
00D8.6 +1 258 sbit POR = WDCON^6;
00D8.5 +1 259 sbit EPF1 = WDCON^5;
00D8.4 +1 260 sbit PF1 = WDCON^4;
00D8.3 +1 261 sbit WDIF = WDCON^3;
00D8.2 +1 262 sbit WTRF = WDCON^2;
00D8.1 +1 263 sbit EWT = WDCON^1;
00D8.0 +1 264 sbit RWT = WDCON^0;
+1 265
00E8.7 +1 266 sbit CANBIE= EIE^7;
00E8.6 +1 267 sbit C0IE = EIE^6;
00E8.5 +1 268 sbit C1IE = EIE^5;
00E8.4 +1 269 sbit EWDI = EIE^4;
00E8.3 +1 270 sbit EX5 = EIE^3; /* Alternate EC3 */
00E8.2 +1 271 sbit EX4 = EIE^2; /* Alternate EC2 */
00E8.1 +1 272 sbit EX3 = EIE^1; /* Alternate EC1 */
00E8.0 +1 273 sbit EX2 = EIE^0; /* Alternate EC0 */
+1 274
00F8.7 +1 275 sbit CANBIP= EIP^7;
00F8.6 +1 276 sbit C0IP = EIP^6;
00F8.5 +1 277 sbit C1IP = EIP^5;
00F8.4 +1 278 sbit PWDI = EIP^4;
00F8.3 +1 279 sbit PX5 = EIP^3; /* Alternate PC3 */
00F8.2 +1 280 sbit PX4 = EIP^2; /* Alternate PC2 */
00F8.1 +1 281 sbit PX3 = EIP^1; /* Alternate PC1 */
00F8.0 +1 282 sbit PX2 = EIP^0; /* Alternate PC0 */
+1 283
+1 284
285
286
287 ;****************************************************************************
288 ;
289 ; BEGIN CONFIGURABLE OPTIONS
290 ;
291 ; Set INITIALIZE_SERIAL0 to 0 to disable initialization of serial port 0.
292 ; Disabling serial port 0 initialization will also disable the printing of
293 ; the copyright message in init_rom(). When disabled, you must initialize
294 ; serial port 0 yourself and/or override the C putchar() function if you
295 ; want putchar(), puts(), or printf() to work.
296 ;
297 $set (INITIALIZE_SERIAL0 = 1)
298
299
300 ;
301 ; Set USE_MONITOR to 0 to configure this program to load into bank 40 (flash on TINIm400
)
302 ; Set USE_MONITOR to 1 to configure this program to load into bank 20 (RAM on TINIm400)
303 ; where it is suitable for use by the Keil monitor.
304 ;
305 $set (USE_MONITOR = 0)
306
307 ;
308 ; Set XTALMULT to 2 or 4 to use the crystal doubler or quadrupler.
309 ; Set XTALMULT to 1 to use the default. Do not use other
310 ; values for XTALMULT.
311 ;
312 $set (XTALMULT = 1)
313
314 ;
315 ; Set the OSCILLATOR_FREQ value to the value of the oscillator you are using.
316 ; The TINIm400 uses a 14745600 Hz oscillator. DO NOT CHANGE THIS VALUE TO
317 ; REFLECT THE USE OF THE CRYSTAL MULTIPLIER.
318 ;
00E10000 319 OSCILLATOR_FREQ equ 14745600
320
321 ;
AX51 MACRO ASSEMBLER STARTUP400 01/24/07 12:40:12 PAGE 6
322 ; Set SERIAL0_BAUDRATE to the baud rate you want to get standard output at.
323 ; Default is 115200.
324 ;
0001C200 325 SERIAL0_BAUDRATE equ 115200
326
327 ;
328 ; Set USE_REENTRANT_STACK to 1 to use Keil's reentrant stack (allows
329 ; recursive function calls). Set REENTRANT_STACK_TOP to the top of the
330 ; reentrant stack if USE_REENTRANT_STACK is 1.
331 ; REENTRANT_STACK_TOP cannot be greater than 0FFFFh and is always located
332 ; in the first 64KB of the XDATA segment, regardless of the size of XDATA.
333 ; Make sure the reentrant stack does not conflict with the XDATA project
334 ; settings and variables. It is a good idea to declare the reentrant stack
335 ; as an xdata application variable to prevent the linker from allocating
336 ; the xdata space for other variables. For example, add the following to
337 ; your C source:
338 ;
339 ; #define REENTRANT_STACK_TOP 0xffff
340 ;
341 ; /* Total size of the reentrant stack the application uses. */
342 ; #define REENTRANT_STACK_SIZE 16386
343 ;
344 ; /* Prevent the linker from using the stack space */
345 ; #define REENTRANT_STACK_LOC REENTRANT_STACK_TOP-REENTRANT_STACK_SIZE
346 ; static char xdata _reentrant_stack[REENTRANT_STACK_SIZE] _at_ REENTRANT_STACK_LOC;
347 ;
348 ; You must call task_reentrant_stack(size) for each task that has functions
349 ; declared as "reentrant".
350 ; See the reentrant stack sample application for a demonstration of the
351 ; reentrant stack.
352 ;
353 $set (USE_REENTRANT_STACK = 0)
FFFF 354 REENTRANT_STACK_TOP equ 0FFFFh
355
356 ;
357 ; Set SETMAC to 1 to give the TINI a specific MAC ID as defined by
358 ; the equates MAC_MSB, MAC_5, ..., MAC_LSB. Set SETMAC to 2 to
359 ; set registers r5:r4:r3:r2:r1:r0 to your own MAC ID (see 'User MAC Code'
360 ; below). Use a SETMAC of 0 to find the MAC in a 2502-E48.
361 ; (Note: You also have to call init_setclock() if there is no 2502-E48.)
362 ;
363 $set (SETMAC = 0)
364
0000 365 MAC_MSB equ 00h
0060 366 MAC_5 equ 60h
0062 367 MAC_4 equ 62h
0063 368 MAC_3 equ 63h
0064 369 MAC_2 equ 64h
0065 370 MAC_1 equ 65h
0067 371 MAC_LSB equ 67h
372
373 ;
374 ; Change ERASE_IDATA to erase the internal data memory before the program begins.
375 ;
0100 376 ERASE_IDATA equ 100h ; the amount of IDATA memory to erase
377
378 ;
379 ; Change length from 0 to erase starting at address ERASE_XDATA_ADDR for
380 ; ERASE_XDATA_LEN bytes.
381 ;
0000 382 ERASE_XDATA_ADDR equ 0h ; the absolute start-address of XDATA memory
0000 383 ERASE_XDATA_LEN equ 0h ; the length of XDATA memory in bytes.
384
385 ;
386 ; Set INTERNALSRAM to 1 to enable the internal 64KB SRAM on the DS80C410/411.
387 ; (Note: This has no effect on the DS80C400.)
AX51 MACRO ASSEMBLER STARTUP400 01/24/07 12:40:12 PAGE 7
388 ;
389 $set (INTERNALSRAM = 0)
390
391 ;
392 ; END OF CONFIGURABLE OPTIONS
393 ;
394 ;****************************************************************************
FFFC 395 TIMER_RELOAD equ (65536 - ((OSCILLATOR_FREQ) / (32 * SERIAL0_BAUDRATE)))
396
397
398 $if (USE_REENTRANT_STACK <> 0)
C_XBP_SEG SEGMENT DATA AT 070H
RSEG C_XBP_SEG
?C_XBP: DSB 2
XBPSTACKTOP equ REENTRANT_STACK_TOP + 1
Public ?C_XBP
$endif
408
409 ;
410 ; Direct where the ROM puts the boot status flags
411 ;
0021 412 BFLAGS equ 21h
413
414 name ?C_STARTUP
415 ;
416 ; Make sure the compiler does not use the OS flags & bits
417 ;
000008 418 DSEG at 08h
000008 419 regbank123: ds 24
420
000020 421 DSEG AT 20h
000020 422 wos_flags: ds 1
423
000027 424 DSEG AT 27h
000027 425 rom_flags: ds 1
426
000068 427 DSEG AT 68h
000068 428 wos_crit_count: ds 1
429
00006B 430 DSEG AT 6Bh
00006B 431 sched_reload: ds 2
00006D 432 curr_pc: ds 3
433
000072 434 DSEG AT 72h
000072 435 sched: ds 3
000075 436 ms_count: ds 5
437
00007A 438 DSEG AT 7Ah
00007A 439 xbp_loc: ds 1
440
00007B 441 DSEG AT 7Bh
00007B 442 hb_chandle: ds 5
443
000080 444 ISEG AT 80h
000080 445 hb_open_cache: ds 6
446
447
448 extrn code (?C_START)
449 public ?C_STARTUP
450
451 $if (USE_MONITOR = 0)
400000 452 ?C_CPURESET?0 segment code at 400000H
453 $endif
AX51 MACRO ASSEMBLER STARTUP400 01/24/07 12:40:12 PAGE 8
454 $if (USE_MONITOR = 1)
?C_CPURESET?0 segment code at 200000H
$endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -