⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 os_cpu_c.s

📁 ucos在avr mega128上的移植
💻 S
📖 第 1 页 / 共 2 页
字号:
	movw R30,R2
	std z+0,R24
;     *psoft_stk-- = (INT8U)0x04;             /* R4    = 0x04                                             */
	movw R2,R20
	subi R20,1
	sbci R21,0
	ldi R24,4
	movw R30,R2
	std z+0,R24
;     *psoft_stk-- = (INT8U)0x05;             /* R5    = 0x05                                             */
	movw R2,R20
	subi R20,1
	sbci R21,0
	ldi R24,5
	movw R30,R2
	std z+0,R24
;     *psoft_stk-- = (INT8U)0x06;             /* R6    = 0x06                                             */
	movw R2,R20
	subi R20,1
	sbci R21,0
	ldi R24,6
	movw R30,R2
	std z+0,R24
;     *psoft_stk-- = (INT8U)0x07;             /* R7    = 0x07                                             */
	movw R2,R20
	subi R20,1
	sbci R21,0
	ldi R24,7
	movw R30,R2
	std z+0,R24
;     *psoft_stk-- = (INT8U)0x08;             /* R8    = 0x08                                             */
	movw R2,R20
	subi R20,1
	sbci R21,0
	ldi R24,8
	movw R30,R2
	std z+0,R24
;     *psoft_stk-- = (INT8U)0x09;             /* R9    = 0x09                                             */
	movw R2,R20
	subi R20,1
	sbci R21,0
	ldi R24,9
	movw R30,R2
	std z+0,R24
;     *psoft_stk-- = (INT8U)0x10;             /* R10   = 0x10                                             */
	movw R2,R20
	subi R20,1
	sbci R21,0
	ldi R24,16
	movw R30,R2
	std z+0,R24
;     *psoft_stk-- = (INT8U)0x11;             /* R11   = 0x11                                             */
	movw R2,R20
	subi R20,1
	sbci R21,0
	ldi R24,17
	movw R30,R2
	std z+0,R24
;     *psoft_stk-- = (INT8U)0x12;             /* R12   = 0x12                                             */
	movw R2,R20
	subi R20,1
	sbci R21,0
	ldi R24,18
	movw R30,R2
	std z+0,R24
;     *psoft_stk-- = (INT8U)0x13;             /* R13   = 0x13                                             */
	movw R2,R20
	subi R20,1
	sbci R21,0
	ldi R24,19
	movw R30,R2
	std z+0,R24
;     *psoft_stk-- = (INT8U)0x14;             /* R14   = 0x14                                             */
	movw R2,R20
	subi R20,1
	sbci R21,0
	ldi R24,20
	movw R30,R2
	std z+0,R24
;     *psoft_stk-- = (INT8U)0x15;             /* R15   = 0x15                                             */
	movw R2,R20
	subi R20,1
	sbci R21,0
	ldi R24,21
	movw R30,R2
	std z+0,R24
;     tmp          = (INT16U)p_arg;
	movw R22,R18
;     *psoft_stk-- = (INT8U)tmp;              /* 'p_arg' passed in R17:R16                                */
	movw R2,R20
	subi R20,1
	sbci R21,0
	movw R30,R2
	std z+0,R22
;     *psoft_stk-- = (INT8U)(tmp >> 8);
	movw R2,R20
	subi R20,1
	sbci R21,0
	movw R4,R22
	mov R4,R5
	clr R5
	movw R30,R2
	std z+0,R4
;     *psoft_stk-- = (INT8U)0x18;             /* R18   = 0x18                                             */
	movw R2,R20
	subi R20,1
	sbci R21,0
	ldi R24,24
	movw R30,R2
	std z+0,R24
;     *psoft_stk-- = (INT8U)0x19;             /* R19   = 0x19                                             */
	movw R2,R20
	subi R20,1
	sbci R21,0
	ldi R24,25
	movw R30,R2
	std z+0,R24
;     *psoft_stk-- = (INT8U)0x20;             /* R20   = 0x20                                             */
	movw R2,R20
	subi R20,1
	sbci R21,0
	ldi R24,32
	movw R30,R2
	std z+0,R24
;     *psoft_stk-- = (INT8U)0x21;             /* R21   = 0x21                                             */
	movw R2,R20
	subi R20,1
	sbci R21,0
	ldi R24,33
	movw R30,R2
	std z+0,R24
;     *psoft_stk-- = (INT8U)0x22;             /* R22   = 0x22                                             */
	movw R2,R20
	subi R20,1
	sbci R21,0
	ldi R24,34
	movw R30,R2
	std z+0,R24
;     *psoft_stk-- = (INT8U)0x23;             /* R23   = 0x23                                             */
	movw R2,R20
	subi R20,1
	sbci R21,0
	ldi R24,35
	movw R30,R2
	std z+0,R24
;     *psoft_stk-- = (INT8U)0x24;             /* R24   = 0x24                                             */
	movw R2,R20
	subi R20,1
	sbci R21,0
	ldi R24,36
	movw R30,R2
	std z+0,R24
;     *psoft_stk-- = (INT8U)0x25;             /* R25   = 0x25                                             */
	movw R2,R20
	subi R20,1
	sbci R21,0
	ldi R24,37
	movw R30,R2
	std z+0,R24
;     *psoft_stk-- = (INT8U)0x26;             /* R26   = 0x26                                             */
	movw R2,R20
	subi R20,1
	sbci R21,0
	ldi R24,38
	movw R30,R2
	std z+0,R24
;     *psoft_stk-- = (INT8U)0x27;             /* R27   = 0x27                                             */
	movw R2,R20
	subi R20,1
	sbci R21,0
	ldi R24,39
	movw R30,R2
	std z+0,R24
;                                             /* R28     R29:R28 is the software stack which gets ...     */
;                                             /* R29     ... stored in the task's OS_TCB.                 */
;     *psoft_stk-- = (INT8U)0x30;             /* R30   = 0x30                                             */
	movw R2,R20
	subi R20,1
	sbci R21,0
	ldi R24,48
	movw R30,R2
	std z+0,R24
;     *psoft_stk-- = (INT8U)0x31;             /* R31   = 0x31                                             */
	movw R2,R20
	subi R20,1
	sbci R21,0
	ldi R24,49
	movw R30,R2
	std z+0,R24
;     *psoft_stk-- = (INT8U)0x00;             /* RAMPZ = 0x00                                             */
	movw R2,R20
	subi R20,1
	sbci R21,0
	clr R4
	movw R30,R2
	std z+0,R4
;     *psoft_stk-- = (INT8U)0x80;             /* SREG  = Interrupts enabled                               */
	movw R2,R20
	subi R20,1
	sbci R21,0
	ldi R24,128
	movw R30,R2
	std z+0,R24
;     tmp          = (INT16U)phard_stk;
	movw R22,R10
;     *psoft_stk-- = (INT8U)(tmp >> 8);       /* SPH                                                      */
	movw R2,R20
	subi R20,1
	sbci R21,0
	movw R4,R22
	mov R4,R5
	clr R5
	movw R30,R2
	std z+0,R4
;     *psoft_stk   = (INT8U) tmp;             /* SPL                                                      */
	movw R30,R20
	std z+0,R22
;     return ((void *)psoft_stk);
	movw R16,R30
L7:
	xcall pop_gset3
	.dbline 0 ; func end
	ret
	.even
_OSTaskSwHook::
; }
; 
; /*$PAGE*/
; /*
; *********************************************************************************************************
; *                                           TASK SWITCH HOOK
; *
; * Description: This function is called when a task switch is performed.  This allows you to perform other
; *              operations during a context switch.
; *
; * Arguments  : none
; *
; * Note(s)    : 1) Interrupts are disabled during this call.
; *              2) It is assumed that the global pointer 'OSTCBHighRdy' points to the TCB of the task that
; *                 will be 'switched in' (i.e. the highest priority task) and, 'OSTCBCur' points to the 
; *                 task being switched out (i.e. the preempted task).
; *********************************************************************************************************
; */
; #if (OS_CPU_HOOKS_EN > 0) && (OS_TASK_SW_HOOK_EN > 0)
; void  OSTaskSwHook (void)
; {
L8:
	.dbline 0 ; func end
	ret
;           ptcb -> R16,R17
	.even
_OSTCBInitHook::
; #ifdef OS_VIEW_MODULE
;     OSView_TaskSwHook();
; #endif
; }
; #endif
; 
; /*
; *********************************************************************************************************
; *                                           OS_TCBInit() HOOK
; *
; * Description: This function is called by OS_TCBInit() after setting up most of the TCB.
; *
; * Arguments  : ptcb    is a pointer to the TCB of the task being created.
; *
; * Note(s)    : 1) Interrupts may or may not be ENABLED during this call.
; *********************************************************************************************************
; */
; #if OS_CPU_HOOKS_EN > 0 && OS_VERSION > 203
; void  OSTCBInitHook (OS_TCB *ptcb)
; {
;     ptcb = ptcb;                                           /* Prevent Compiler warning                 */
L9:
	.dbline 0 ; func end
	ret
	.area bss(ram, con, rel)
_OSTaskHardStkSize::
	.blkb 2
_OSTaskStkSize::
	.blkb 2

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -