uCOSII-V2.52在单片机STC12C5A60S2上移植方法

上传人:aa****6 文档编号:29218431 上传时间:2018-01-22 格式:DOCX 页数:31 大小:22.01KB
返回 下载 相关 举报
uCOSII-V2.52在单片机STC12C5A60S2上移植方法_第1页
第1页 / 共31页
uCOSII-V2.52在单片机STC12C5A60S2上移植方法_第2页
第2页 / 共31页
uCOSII-V2.52在单片机STC12C5A60S2上移植方法_第3页
第3页 / 共31页
uCOSII-V2.52在单片机STC12C5A60S2上移植方法_第4页
第4页 / 共31页
uCOSII-V2.52在单片机STC12C5A60S2上移植方法_第5页
第5页 / 共31页
点击查看更多>>
资源描述

《uCOSII-V2.52在单片机STC12C5A60S2上移植方法》由会员分享,可在线阅读,更多相关《uCOSII-V2.52在单片机STC12C5A60S2上移植方法(31页珍藏版)》请在金锄头文库上搜索。

1、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 cod

2、e 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 Initializatio

3、n 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

4、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

5、; 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 s

6、pace 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.

7、 ; 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

8、 ; ; 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 stac

9、k 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 m

10、emory 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; ;-

11、; 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 STARTUP1

12、RSEG ?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,

13、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

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 其它办公文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号