让我们先来看看STARTUP.A51文件(默认设置)吧!根据源文件中的说明文字,我们很容易分析出STARTUP.A51文件的工作方式和作用!让我们把它先汉化一下看看!
$NOMOD51;Ax51宏汇编器控制命令:禁止预定义的8051
;------------------------------------------------------------------------------
; This file is part of the C51 Compiler package
; Copyright (c) 1988-2002 Keil Elektronik GmbH and Keil Software, Inc.
;------------------------------------------------------------------------------
; STARTUP.A51: This code is executed after processor reset.
; STARTUP.A51: STARTUP.A51文件所生成的代码将在单片机复位后被执行!
; To translate this file use A51 with the following invocation:
; 将按照下面的命令行语句调用A51编译器进行编译产生目标文件
; A51 STARTUP.A51
;
; To link the modified STARTUP.OBJ file to your application use the following
; BL51 invocation:
; 将按照下面的命令行语句调用BL51连接器把STARTUP.OBJ定位连接到您的程序代码中
; BL51 <your object file list>, STARTUP.OBJ <controls>
;
;------------------------------------------------------------------------------
;
; User-defined Power-On Initialization of Memory
; 自定义上电后需要初始化的储存区域
; With the following EQU statements the initialization of memory
; at processor reset can be defined:
; 使用下列EQU伪指令定义初始化的存储区域在单片机复位后定义生效
;
; the absolute start-address of IDATA memory is always 0
IDATALEN EQU 80H ; the length of IDATA memory in bytes.
; IDATA(间接寻址区)其起始地址固定为0
;IDATALEN用于指定需要初始化的 IDATA区长度(以字节为单位)*
XDATASTART EQU 0H ; the absolute start-address of XDATA memory
;XDATA (外部直接寻址区) XDATASTART用于指定需要初始化的XDATA区起始地址
XDATALEN EQU 0H &nb