📄 os_cpu_c.src
字号:
; .\OS_CPU_C.SRC generated from: OS_CPU_C.C
$NOMOD51
NAME OS_CPU_C
P0 DATA 080H
P1 DATA 090H
P2 DATA 0A0H
P3 DATA 0B0H
T0 BIT 0B0H.4
AC BIT 0D0H.6
T1 BIT 0B0H.5
T2 BIT 090H.0
EA BIT 0A8H.7
IE DATA 0A8H
EXF2 BIT 0C8H.6
RD BIT 0B0H.7
ES BIT 0A8H.4
IP DATA 0B8H
RI BIT 098H.0
INT0 BIT 0B0H.2
CY BIT 0D0H.7
TI BIT 098H.1
INT1 BIT 0B0H.3
RCAP2H DATA 0CBH
PS BIT 0B8H.4
SP DATA 081H
T2EX BIT 090H.1
OV BIT 0D0H.2
RCAP2L DATA 0CAH
C_T2 BIT 0C8H.1
WR BIT 0B0H.6
RCLK BIT 0C8H.5
TCLK BIT 0C8H.4
SBUF DATA 099H
PCON DATA 087H
SCON DATA 098H
TMOD DATA 089H
TCON DATA 088H
IE0 BIT 088H.1
IE1 BIT 088H.3
B DATA 0F0H
CP_RL2 BIT 0C8H.0
ACC DATA 0E0H
ET0 BIT 0A8H.1
ET1 BIT 0A8H.3
TF0 BIT 088H.5
ET2 BIT 0A8H.5
TF1 BIT 088H.7
TF2 BIT 0C8H.7
RB8 BIT 098H.2
TH0 DATA 08CH
EX0 BIT 0A8H.0
IT0 BIT 088H.0
TH1 DATA 08DH
TB8 BIT 098H.3
EX1 BIT 0A8H.2
IT1 BIT 088H.2
TH2 DATA 0CDH
P BIT 0D0H.0
SM0 BIT 098H.7
TL0 DATA 08AH
SM1 BIT 098H.6
TL1 DATA 08BH
SM2 BIT 098H.5
TL2 DATA 0CCH
PT0 BIT 0B8H.1
PT1 BIT 0B8H.3
RS0 BIT 0D0H.3
PT2 BIT 0B8H.5
TR0 BIT 088H.4
RS1 BIT 0D0H.4
TR1 BIT 088H.6
TR2 BIT 0C8H.2
PX0 BIT 0B8H.0
PX1 BIT 0B8H.2
DPH DATA 083H
DPL DATA 082H
EXEN2 BIT 0C8H.3
REN BIT 098H.4
T2CON DATA 0C8H
RXD BIT 0B0H.0
TXD BIT 0B0H.1
F0 BIT 0D0H.5
PSW DATA 0D0H
?PR?_?OSInitHookBegin?OS_CPU_C SEGMENT CODE
?PR?_?OSInitHookEnd?OS_CPU_C SEGMENT CODE
?PR?_?OSTaskCreateHook?OS_CPU_C SEGMENT CODE
?PR?_?OSTaskDelHook?OS_CPU_C SEGMENT CODE
?PR?_?OSTaskIdleHook?OS_CPU_C SEGMENT CODE
?PR?_?OSTaskStatHook?OS_CPU_C SEGMENT CODE
?PR?_?OSTaskStkInit?OS_CPU_C SEGMENT CODE
?PR?_?OSTaskSwHook?OS_CPU_C SEGMENT CODE
?PR?_?OSTCBInitHook?OS_CPU_C SEGMENT CODE
?PR?_?OSTimeTickHook?OS_CPU_C SEGMENT CODE
EXTRN CODE (?C?ADDXBP)
EXTRN DATA (?C_XBP)
EXTRN CODE (?C?XBPOFF)
EXTRN CODE (?C?IILDX)
EXTRN CODE (?C?PSTPTR)
EXTRN CODE (?C?CSTPTR)
PUBLIC _?OSTimeTickHook
PUBLIC _?OSTCBInitHook
PUBLIC _?OSTaskSwHook
PUBLIC _?OSTaskStkInit
PUBLIC _?OSTaskStatHook
PUBLIC _?OSTaskIdleHook
PUBLIC _?OSTaskDelHook
PUBLIC _?OSTaskCreateHook
PUBLIC _?OSInitHookEnd
PUBLIC _?OSInitHookBegin
; /*
; *********************************************************************************************************
; * uC/OS-II
; * The Real-Time Kernel
; *
; * (c) Copyright 1992-2002, Jean J. Labrosse, Weston, FL
; * All Rights Reserved
; *
; * 8051/8052 Specific code
; * LARGE MEMORY MODEL
; *
; * Keil C Compiler V6.23a
; * (MSC51 Compatible Target)
; *
; * File : OS_CPU_C.C
; * By : Jean J. Labrosse
; * Replant : wl.peng
; *********************************************************************************************************
; */
;
; #define OS_CPU_GLOBALS
; #include "includes.h"
;
; /*
; *********************************************************************************************************
; * OS INITIALIZATION HOOK
; * (BEGINNING)
; *
; * Description: This function is called by OSInit() at the beginning of OSInit().
; *
; * Arguments : none
; *
; * Note(s) : 1) Interrupts should be disabled during this call.
; *********************************************************************************************************
; */
; #if OS_CPU_HOOKS_EN > 0 && OS_VERSION > 203
; void OSInitHookBegin (void) KCREENTRANT
RSEG ?PR?_?OSInitHookBegin?OS_CPU_C
_?OSInitHookBegin:
; SOURCE LINE # 37
; {
; }
; SOURCE LINE # 39
RET
; END OF _?OSInitHookBegin
; #endif
;
; /*
; *********************************************************************************************************
; * OS INITIALIZATION HOOK
; * (END)
; *
; * Description: This function is called by OSInit() at the end of OSInit().
; *
; * Arguments : none
; *
; * Note(s) : 1) Interrupts should be disabled during this call.
; *********************************************************************************************************
; */
; #if OS_CPU_HOOKS_EN > 0 && OS_VERSION > 203
; void OSInitHookEnd (void) KCREENTRANT
RSEG ?PR?_?OSInitHookEnd?OS_CPU_C
_?OSInitHookEnd:
; SOURCE LINE # 55
; {
; }
; SOURCE LINE # 57
RET
; END OF _?OSInitHookEnd
; #endif
;
; /*$PAGE*/
; /*
; *********************************************************************************************************
; * TASK CREATION HOOK
; *
; * Description: This function is called when a task is created.
; *
; * Arguments : ptcb is a pointer to the task control block of the task being created.
; *
; * Note(s) : 1) Interrupts are disabled during this call.
; *********************************************************************************************************
; */
; #if OS_CPU_HOOKS_EN > 0
; void OSTaskCreateHook (OS_TCB *ptcb) KCREENTRANT
RSEG ?PR?_?OSTaskCreateHook?OS_CPU_C
_?OSTaskCreateHook:
USING 0
; SOURCE LINE # 73
MOV DPTR,#0FFFDH
LCALL ?C?ADDXBP
MOV A,R3
MOVX @DPTR,A
INC DPTR
MOV A,R2
MOVX @DPTR,A
INC DPTR
MOV A,R1
MOVX @DPTR,A
; {
; ptcb = ptcb; /* Prevent compiler warning */
; SOURCE LINE # 75
MOV DPH,?C_XBP
MOV DPL,?C_XBP+01H
MOVX A,@DPTR
MOV R1,A
INC DPTR
MOVX A,@DPTR
MOV R2,A
INC DPTR
MOVX A,@DPTR
MOV DPH,?C_XBP
MOV DPL,?C_XBP+01H
XCH A,R1
MOVX @DPTR,A
INC DPTR
MOV A,R2
MOVX @DPTR,A
INC DPTR
MOV A,R1
MOVX @DPTR,A
; }
; SOURCE LINE # 76
MOV DPTR,#03H
LJMP ?C?ADDXBP
; END OF _?OSTaskCreateHook
; #endif
;
;
; /*
; *********************************************************************************************************
; * TASK DELETION HOOK
; *
; * Description: This function is called when a task is deleted.
; *
; * Arguments : ptcb is a pointer to the task control block of the task being deleted.
; *
; * Note(s) : 1) Interrupts are disabled during this call.
; *********************************************************************************************************
; */
; #if OS_CPU_HOOKS_EN > 0
; void OSTaskDelHook (OS_TCB *ptcb) KCREENTRANT
RSEG ?PR?_?OSTaskDelHook?OS_CPU_C
_?OSTaskDelHook:
USING 0
; SOURCE LINE # 92
MOV DPTR,#0FFFDH
LCALL ?C?ADDXBP
MOV A,R3
MOVX @DPTR,A
INC DPTR
MOV A,R2
MOVX @DPTR,A
INC DPTR
MOV A,R1
MOVX @DPTR,A
; {
; ptcb = ptcb; /* Prevent compiler warning */
; SOURCE LINE # 94
MOV DPH,?C_XBP
MOV DPL,?C_XBP+01H
MOVX A,@DPTR
MOV R1,A
INC DPTR
MOVX A,@DPTR
MOV R2,A
INC DPTR
MOVX A,@DPTR
MOV DPH,?C_XBP
MOV DPL,?C_XBP+01H
XCH A,R1
MOVX @DPTR,A
INC DPTR
MOV A,R2
MOVX @DPTR,A
INC DPTR
MOV A,R1
MOVX @DPTR,A
; }
; SOURCE LINE # 95
MOV DPTR,#03H
LJMP ?C?ADDXBP
; END OF _?OSTaskDelHook
; #endif
;
; /*
; *********************************************************************************************************
; * IDLE TASK HOOK
; *
; * Description: This function is called by the idle task. This hook has been added to allow you to do
; * such things as STOP the CPU to conserve power.
; *
; * Arguments : none
; *
; * Note(s) : 1) Interrupts are enabled during this call.
; *********************************************************************************************************
; */
; #if OS_CPU_HOOKS_EN > 0 && OS_VERSION >= 251
; void OSTaskIdleHook (void) KCREENTRANT
RSEG ?PR?_?OSTaskIdleHook?OS_CPU_C
_?OSTaskIdleHook:
; SOURCE LINE # 111
; {
; }
; SOURCE LINE # 113
RET
; END OF _?OSTaskIdleHook
; #endif
;
; /*
; *********************************************************************************************************
; * STATISTIC TASK HOOK
; *
; * Description: This function is called every second by uC/OS-II's statistics task. This allows your
; * application to add functionality to the statistics task.
; *
; * Arguments : none
; *********************************************************************************************************
; */
;
; #if OS_CPU_HOOKS_EN > 0
; void OSTaskStatHook (void) KCREENTRANT
RSEG ?PR?_?OSTaskStatHook?OS_CPU_C
_?OSTaskStatHook:
; SOURCE LINE # 128
; {
; }
; SOURCE LINE # 130
RET
; END OF _?OSTaskStatHook
; #endif
;
; /*$PAGE*/
; /*
; *********************************************************************************************************
; * INITIALIZE A TASK'S STACK
; *
; * Description: This function is called by either OSTaskCreate() or OSTaskCreateExt() to initialize the
; * stack frame of the task being created. This function is highly processor specific.
; *
; * Arguments : task is a pointer to the task code
; *
; * pdata is a pointer to a user supplied data area that will be passed to the task
; * when the task first executes.
; *
; * ptos is a pointer to the top of stack. It is assumed that 'ptos' points to
; * a 'free' entry on the task stack. If OS_STK_GROWTH is set to 1 then
; * 'ptos' will contain the HIGHEST valid address of the stack. Similarly, if
; * OS_STK_GROWTH is set to 0, the 'ptos' will contains the LOWEST valid address
; * of the stack.
; *
; * opt specifies options that can be used to alter the behavior of OSTaskStkInit().
; * (see uCOS_II.H for OS_TASK_OPT_???).
; *
; * Returns : Always returns the location of the new top-of-stack' once the processor registers have
; * been placed on the stack in the proper order.
; *
; * Note(s) : Interrupts are enabled when your task starts executing. You can change this by setting the
; * PSW to 0x0002 instead. In this case, interrupts would be disabled upon task startup. The
; * application code would be responsible for enabling interrupts at the beginning of the task
; * code. You will need to modify OSTaskIdle() and OSTaskStat() so that they enable
; * interrupts. Failure to do this will make your system crash!
; *********************************************************************************************************
; */
;
; OS_STK *OSTaskStkInit (void (*task)(void *pd) KCREENTRANT, void *pdata, OS_STK *ptos, INT16U opt) KCREENTRANT
RSEG ?PR?_?OSTaskStkInit?OS_CPU_C
_?OSTaskStkInit:
USING 0
; SOURCE LINE # 166
MOV DPTR,#0FFFDH
LCALL ?C?ADDXBP
MOV A,R3
MOVX @DPTR,A
INC DPTR
MOV A,R2
MOVX @DPTR,A
INC DPTR
MOV A,R1
MOVX @DPTR,A
MOV DPTR,#0FFFDH
LCALL ?C?ADDXBP
; {
; INT8U * stk;
;
; opt = opt; /* 'opt' is not used, prevent warning */
; SOURCE LINE # 170
MOV DPTR,#0CH
LCALL ?C?XBPOFF
MOVX A,@DPTR
MOV R6,A
INC DPTR
MOVX A,@DPTR
MOV R7,A
MOV DPTR,#0CH
LCALL ?C?XBPOFF
MOV A,R6
MOVX @DPTR,A
INC DPTR
MOV A,R7
MOVX @DPTR,A
; stk = (INT8U *) ptos; /* Load stack pointer */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -