日本黄色一级经典视频|伊人久久精品视频|亚洲黄色色周成人视频九九九|av免费网址黄色小短片|黄色Av无码亚洲成年人|亚洲1区2区3区无码|真人黄片免费观看|无码一级小说欧美日免费三级|日韩中文字幕91在线看|精品久久久无码中文字幕边打电话

當(dāng)前位置:首頁(yè) > 單片機(jī) > 單片機(jī)
[導(dǎo)讀]$NOMOD51;Ax51宏匯編器控制命令:禁止預(yù)定義的8051;------------------------------------------------------------------------------; This file is part of the C51 Compiler package; Copyright (c) 1988-2002 K

$NOMOD51;Ax51宏匯編器控制命令:禁止預(yù)定義的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文件所生成的代碼將在單片機(jī)復(fù)位后被執(zhí)行!
; To translate this file use A51 with the following invocation:
;將按照下面的命令行語(yǔ)句調(diào)用A51編譯器進(jìn)行編譯產(chǎn)生目標(biāo)文件
; A51 STARTUP.A51
;
; To link the modified STARTUP.OBJ file to your application use the following
; BL51 invocation:
;將按照下面的命令行語(yǔ)句調(diào)用BL51連接器把STARTUP.OBJ定位連接到您的程序代碼中
; BL51, STARTUP.OBJ
;
;------------------------------------------------------------------------------
;
; User-defined Power-On Initialization of Memory
;自定義上電后需要初始化的儲(chǔ)存區(qū)域
; With the following EQU statements the initialization of memory
; at processor reset can be defined:
;使用下列EQU偽指令定義初始化的存儲(chǔ)區(qū)域在單片機(jī)復(fù)位后定義生效
; ; the absolute start-address of IDATA memory is always 0
IDATALEN EQU 80H ; the length of IDATA memory in bytes.
; IDATA(間接尋址區(qū))其起始地址固定為0;IDATALEN用于指定需要初始化的IDATA區(qū)長(zhǎng)度(以字節(jié)為單位)*

XDATASTART EQU 0H ; the absolute start-address of XDATA memory
XDATALEN EQU 0H ; the length of XDATA memory in bytes.
;XDATA(外部直接尋址區(qū))XDATASTART用于指定需要初始化的XDATA區(qū)起始地址
;XDATALEN用于指定需要初始化的XDATA區(qū)長(zhǎng)度(以字節(jié)為單位)*

PDATASTART EQU 0H ; the absolute start-address of PDATA memory
PDATALEN EQU 0H ; the length of PDATA memory in bytes.
;PDATA(頁(yè)尋址區(qū))PDATASTART用于指定需要初始化的PDATA區(qū)起始地址
;PDATALEN用于指定需要初始化的;PDATA區(qū)長(zhǎng)度(以字節(jié)為單位)*

; Notes: The IDATA space overlaps physically the DATA and BIT areas of the
; 8051 CPU. At minimum the memory space occupied from the C51
; run-time routines must be set to zero.

;注釋?zhuān)?051中IDATA區(qū)物理上已經(jīng)包括了DATA區(qū)(直接尋址區(qū))以及BIT區(qū)(位尋址區(qū))。C51(庫(kù))占用了最小化內(nèi)存空間,運(yùn)行時(shí)程序需要把它設(shè)為0

;------------------------------------------------------------------------------
;
; Reentrant Stack Initilization
;重入堆棧初始化

; The following EQU statements define the stack pointer for reentrant
; functions and initialized it:
;下面的EQU語(yǔ)句定義重入函數(shù)的堆棧指針并初始化它

; Stack Space for reentrant functions in the SMALL model.
; SMALL模式下的重入函數(shù)的堆??臻g

IBPSTACK EQU 0 ; set to 1 if small reentrant is used.
;如果再SMALL模式下使用重入則設(shè)為1
IBPSTACKTOP EQU 0FFH+1 ; set top of stack to highest location+1.
;設(shè)置堆棧頂最高位置+1
;
; Stack Space for reentrant functions in the LARGE model.
; LARGE模式下的重入函數(shù)的堆??臻g
XBPSTACK EQU 0 ; set to 1 if large reentrant is used.
;如果再LARGE模式下使用重入則設(shè)為1
XBPSTACKTOP EQU 0FFFFH+1; set top of stack to highest location+1.
;設(shè)置堆棧頂最高位置+1
;
; Stack Space for reentrant functions in the COMPACT model.
; COMPACT模式下的重入函數(shù)的堆??臻g
PBPSTACK EQU 0 ; set to 1 if compact reentrant is used.
;如果再COMPACT模式下使用重入則設(shè)為1
PBPSTACKTOP EQU 0FFFFH+1; set top of stack to highest location+1.
;設(shè)置堆棧頂最高位置+1
;
;------------------------------------------------------------------------------
;
; Page Definition for Using the Compact Model with 64 KByte xdata RAM
;使用COMPACT模式時(shí)為64KB的XDATA RAM定義頁(yè)

; The following EQU statements define the xdata page used for pdata
; variables. The EQU PPAGE must conform with the PPAGE control used
; in the linker invocation.
;下面的EQU語(yǔ)句定義PDATA變量的使用了XDATA頁(yè)

PPAGEENABLE EQU 0 ; set to 1 if pdata object are used.
;如果使用PDATA頁(yè)則設(shè)為1
;
PPAGE EQU 0 ; define PPAGE number.
;定義頁(yè)號(hào)
;
PPAGE_SFR DATA 0A0H ; SFR that supplies uppermost address byte
;SFR的最高地址字節(jié)
; (most 8051 variants use P2 as uppermost address byte)
; (大多數(shù)8051變量要用P2的最高地址字節(jié))

;------------------------------------------------------------------------------

; Standard SFR Symbols
;標(biāo)準(zhǔn)SFR符號(hào)
ACC DATA 0E0H
B DATA 0F0H
SP DATA 81H
DPL DATA 82H
DPH DATA 83H

NAME ?C_STARTUP


?C_C51STARTUP SEGMENT CODE
?STACK SEGMENT IDATA

RSEG ?STACK
DS 1

EXTRN CODE (?C_START)
;外部代碼(這個(gè)標(biāo)號(hào)將代表用戶程序的啟始地址)
PUBLIC ?C_STARTUP
;給外部使用的符號(hào)

CSEG AT 0
;在code段的0地址處放以下代碼(使用AT指令進(jìn)行絕對(duì)地址的定位)
?C_STARTUP: LJMP STARTUP1

RSEG ?C_C51STARTUP

STARTUP1:

IF IDATALEN <> 0
;如果長(zhǎng)度大于1則初始化IDATA
MOV R0,#IDATALEN - 1
CLR A
IDATALOOP: MOV @R0,A
DJNZ R0,IDATALOOP
ENDIF

IF XDATALEN <> 0
;如果長(zhǎng)度大于1則初始化XDATA
MOV DPTR,#XDATASTART
MOV R7,#LOW (XDATALEN)


IF (LOW (XDATALEN)) <> 0
;預(yù)置初始化時(shí)的外循環(huán)次數(shù)到R6
MOV R6,#(HIGH (XDATALEN)) +1
ELSE
MOV R6,#HIGH (XDATALEN)
ENDIF
CLR A
XDATALOOP: MOVX @DPTR,A
INC DPTR
DJNZ R7,XDATALOOP
DJNZ R6,XDATALOOP
ENDIF

本站聲明: 本文章由作者或相關(guān)機(jī)構(gòu)授權(quán)發(fā)布,目的在于傳遞更多信息,并不代表本站贊同其觀點(diǎn),本站亦不保證或承諾內(nèi)容真實(shí)性等。需要轉(zhuǎn)載請(qǐng)聯(lián)系該專(zhuān)欄作者,如若文章內(nèi)容侵犯您的權(quán)益,請(qǐng)及時(shí)聯(lián)系本站刪除( 郵箱:macysun@21ic.com )。
換一批
延伸閱讀
關(guān)閉