资源预览内容
第1页 / 共31页
第2页 / 共31页
第3页 / 共31页
第4页 / 共31页
第5页 / 共31页
第6页 / 共31页
第7页 / 共31页
第8页 / 共31页
第9页 / 共31页
第10页 / 共31页
亲,该文档总共31页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
uCOSII V2.52 移植到 STC12C5A60S2 单片机上uCOSII 版本:V2.52单片机型号:STC12C5A60S2说明:代码注释中有乱码,不影响程序,因为编码机制不同导致修改文件 1:启动文件 STARTUP.A51,修改部分红色字体标出$NOMOD51;-; This file is part of the C51 Compiler package; Copyright (c) 1988-2005 Keil Elektronik GmbH and Keil Software, Inc.; Version 8.01; * *;-; STARTUP.A51: This code is executed after processor reset.; To translate this file use A51 with the following invocation:; A51 STARTUP.A51; To link the modified STARTUP.OBJ file to your application use the following; Lx51 invocation:; Lx51 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:; IDATALEN: IDATA memory size ; Note: The absolute start-address of IDATA memory is always 0; The IDATA space overlaps physically the DATA and BIT areas.IDATALEN EQU 80H; XDATASTART: XDATA memory start address ; The absolute start address of XDATA memoryXDATASTART EQU 0 ; XDATALEN: XDATA memory size ; The length of XDATA memory in bytes.XDATALEN EQU 0 ; PDATASTART: ppdata memory start address ; The absolute start address of ppdata memoryPDATASTART EQU 0H; PDATALEN: ppdata memory size ; The length of ppdata memory in bytes.PDATALEN EQU 0H;-; Reentrant Stack Initialization; The following EQU statements define the stack pointer for reentrant; functions and initialized it:; Stack Space for reentrant functions in the SMALL model.; IBPSTACK: Enable SMALL model reentrant stack; Stack space for reentrant functions in the SMALL model.IBPSTACK EQU 0 ; set to 1 if small reentrant is used.; IBPSTACKTOP: End address of SMALL model stack ; Set the top of the stack to the highest location.IBPSTACKTOP EQU 0xFF +1 ; default 0FFH+1 ; ; Stack Space for reentrant functions in the LARGE model. ; XBPSTACK: Enable LARGE model reentrant stack; Stack space for reentrant functions in the LARGE model.XBPSTACK EQU 1 ; set to 1 if large reentrant is used.; XBPSTACKTOP: End address of LARGE model stack ; Set the top of the stack to the highest location.XBPSTACKTOP EQU 0xFFFF +1 ; default 0FFFFH+1 ; ; Stack Space for reentrant functions in the COMPACT model. ; PBPSTACK: Enable COMPACT model reentrant stack; Stack space for reentrant functions in the COMPACT model.PBPSTACK EQU 0 ; set to 1 if compact reentrant is used.; PBPSTACKTOP: End address of COMPACT model stack ; Set the top of the stack to the highest location.PBPSTACKTOP EQU 0xFF +1 ; default 0FFH+1 ; ;-; Memory Page for Using the Compact Model with 64 KByte xdata RAM; Compact Model Page Definition; Define the XDATA page used for ppdata variables. ; PPAGE must conform with the PPAGE set in the linker invocation.; Enable ppdata memory page initalizationPPAGEENABLE EQU 0 ; set to 1 if ppdata object are used.; PPAGE number ; uppermost 256-byte address of the page used for ppdata variables.PPAGE EQU 0; SFR address which supplies uppermost address byte ; most 8051 variants use P2 as uppermost address bytePPAGE_SFR DATA 0A0H; ;-; Standard SFR Symbols ACC DATA 0E0HB DATA 0F0HSP DATA 81HDPL DATA 82HDPH DATA 83HNAME ?C_STARTUPPUBLIC OSStack PUBLIC OSStkStart?C_C51STARTUP SEGMENT CODE?STACK SEGMENT IDATA RSEG ?STACKOSStack:DS 50HOSStkStart IDATA OSStack-1EXTRN CODE (?C_START)PUBLIC ?C_STARTUP CSEG AT 0?C_STARTUP: LJMP STARTUP1RSEG ?C_C51STARTUPSTARTUP1:IF IDATALEN 0MOV R0,#IDATALEN - 1CLR AIDATALOOP: MOV R0,ADJNZ R0,IDATALOOPENDIFIF XDATALEN 0MOV DPTR,#XDATASTARTMOV R7,#LOW (XDATALEN)IF (LOW (XDATALEN) 0MOV R6,#(HIGH (XDATALEN) +1ELSEMOV R6,#HIGH (XDATALEN)ENDIFCLR AXDATALOOP: MOVX DPTR,AINC DPTRDJNZ R7,XDATALOOPDJNZ R6,XDATALOOPENDIFIF PPAGEENABLE 0MOV PPAGE_SFR,#PPAGEENDIFIF PDATALEN 0MOV R0,#LOW (PDATASTART)MOV R7,#LOW (PDATALEN) CLR APDATALOOP: MOVX R0,AINC R0DJNZ R7,PDATALOOPENDIFIF IBPSTACK 0EXTRN DATA (?C_IBP)MOV ?C_IBP,#LOW IBPSTACKTOPENDIFIF XBPSTACK 0EXTRN DATA (?C_XBP)MOV ?C_XBP,#HIGH XBPSTACKTOPMOV ?C_XBP+1,#LOW XBPSTACKTOPENDIFIF PBPSTACK
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号