📄 os_cpu_c.lis
字号:
.module os_cpu_c.c
.area text(rom, con, rel)
0000 .dbfile E:\study\ucos_ii\ucos2_iccavr\iccavr\ucos2_with_cpu\os_cpu_c.c
0000 .dbfunc e OSTaskStkInit _OSTaskStkInit fpc
0000 ; stks -> R10,R11
0000 ; tmp -> R22,R23
0000 ; stk -> R20,R21
0000 ; opt -> y+8
0000 ; ptos -> y+6
0000 ; pdata -> R18,R19
0000 ; task -> R16,R17
.even
0000 _OSTaskStkInit::
0000 0E940000 xcall push_gset3
0004 .dbline -1
0004 .dbline 60
0004 ; /*
0004 ; ********************************************************************************
0004 ; * uC/OS-II
0004 ; * The Real-Time Kernel
0004 ; *
0004 ; * ATmega103 Specific code
0004 ; *
0004 ; * File: OS_CPU_C.C
0004 ; * By: Ole Saether
0004 ; * Modified by: Joerg Meyer
0004 ; * Revision: 0
0004 ; *
0004 ; *
0004 ; *
0004 ; ********************************************************************************
0004 ; */
0004 ;
0004 ; #define OS_CPU_GLOBALS
0004 ; #include "..\ucos2_application\includes.h"
0004 ;
0004 ; /*
0004 ; ********************************************************************************
0004 ; * INITIALIZE A TASK'S STACK
0004 ; *
0004 ; * Description:
0004 ; * This function is called by either OSTaskCreate() or OSTaskCreateExt() to
0004 ; * initialize the stack frame of the task being created. This function is
0004 ; * highly processor specific.
0004 ; *
0004 ; * Arguments:
0004 ; * task - is a pointer to the task code
0004 ; *
0004 ; * pdata - is a pointer to a user supplied data area that will be passed to the
0004 ; * task when the task first executes.
0004 ; *
0004 ; * ptos - is a pointer to the top of stack. It is assumed that 'ptos' points to
0004 ; * the highest valid address on the stack.
0004 ; *
0004 ; * opt - specifies options that can be used to alter the behavior of
0004 ; OSTaskStkInit(). (see uCOS_II.H for OS_TASK_OPT_???).
0004 ; *
0004 ; * Returns:
0004 ; * Always returns the location of the new top-of-stack' once the processor
0004 ; * registers have been placed on the stack in the proper order.
0004 ; *
0004 ; * Note(s):
0004 ; * Interrupts are enabled when your task starts executing. You can change this
0004 ; * by setting the SREG to 0x00 instead. In this case, interrupts would be
0004 ; * disabled upon task startup. The application code would be responsible for
0004 ; * enabling interrupts at the beginning of the task code. You will need to
0004 ; * modify OSTaskIdle() and OSTaskStat() so that they enable interrupts. Failure
0004 ; * to do this will make your system crash! The AVR return stack is placed 64
0004 ; * bytes above the start of the (512 byte) stack. This provides 32 levels of
0004 ; * function call nesting which should be more than enough for most applications
0004 ; * (see the "read.me" file for more info).
0004 ; *
0004 ; ********************************************************************************
0004 ; */
0004 ; OS_STK *OSTaskStkInit (void (*task)(void *pd),
0004 ; void *pdata, OS_STK *ptos, INT16U opt){
0004 .dbline 67
0004 ;
0004 ; INT8U *stk;
0004 ; INT8U *stks; // Temp. variable used for setting up AVR hardware stack
0004 ; INT16U tmp;
0004 ;
0004 ;
0004 ; opt = opt; // 'opt' is not used, prevent warning
0004 .dbline 68
0004 ; stk = (INT8U *)ptos; // Wandlung von ptos in Bytezeiger
0004 4E81 ldd R20,y+6
0006 5F81 ldd R21,y+7
0008 .dbline 70
0008 ; // AVR return stack ("hardware stack")
0008 ; stks = (INT8U *)(ptos)-(OS_TASK_DEF_STK_SIZE-32);
0008 CA01 movw R24,R20
000A 8056 subi R24,96
000C 9040 sbci R25,0
000E .dbline 75
000E ;
000E ; // the function address has an extra level of indirection. Fetch the
000E ; // actual address.
000E ; //
000E ; tmp = *(INT16U const *)task;
000E F801 movw R30,R16
0010 6591 lpm R22,Z+
0012 7491 lpm R23,Z
0014 .dbline 78
0014 ;
0014 ; // 36 Bytes
0014 ; *stks-- = (INT8U)tmp; //Put task start address on top of hardware stack
0014 1C01 movw R2,R24
0016 0197 sbiw R24,1
0018 F101 movw R30,R2
001A 6083 std z+0,R22
001C .dbline 79
001C ; *stks-- = (INT8U)(tmp >> 8);
001C 1C01 movw R2,R24
001E 0197 sbiw R24,1
0020 5C01 movw R10,R24
0022 2B01 movw R4,R22
0024 452C mov R4,R5
0026 5524 clr R5
0028 F101 movw R30,R2
002A 4082 std z+0,R4
002C .dbline 81
002C ;
002C ; *stk-- = (INT8U)0x00; // R0 = 0x00
002C 1A01 movw R2,R20
002E 4150 subi R20,1
0030 5040 sbci R21,0
0032 4424 clr R4
0034 F101 movw R30,R2
0036 4082 std z+0,R4
0038 .dbline 82
0038 ; *stk-- = (INT8U)0x01;
0038 1A01 movw R2,R20
003A 4150 subi R20,1
003C 5040 sbci R21,0
003E 81E0 ldi R24,1
0040 F101 movw R30,R2
0042 8083 std z+0,R24
0044 .dbline 83
0044 ; *stk-- = (INT8U)0x02;
0044 1A01 movw R2,R20
0046 4150 subi R20,1
0048 5040 sbci R21,0
004A 82E0 ldi R24,2
004C F101 movw R30,R2
004E 8083 std z+0,R24
0050 .dbline 84
0050 ; *stk-- = (INT8U)0x03;
0050 1A01 movw R2,R20
0052 4150 subi R20,1
0054 5040 sbci R21,0
0056 83E0 ldi R24,3
0058 F101 movw R30,R2
005A 8083 std z+0,R24
005C .dbline 85
005C ; *stk-- = (INT8U)0x04;
005C 1A01 movw R2,R20
005E 4150 subi R20,1
0060 5040 sbci R21,0
0062 84E0 ldi R24,4
0064 F101 movw R30,R2
0066 8083 std z+0,R24
0068 .dbline 86
0068 ; *stk-- = (INT8U)0x05;
0068 1A01 movw R2,R20
006A 4150 subi R20,1
006C 5040 sbci R21,0
006E 85E0 ldi R24,5
0070 F101 movw R30,R2
0072 8083 std z+0,R24
0074 .dbline 87
0074 ; *stk-- = (INT8U)0x06;
0074 1A01 movw R2,R20
0076 4150 subi R20,1
0078 5040 sbci R21,0
007A 86E0 ldi R24,6
007C F101 movw R30,R2
007E 8083 std z+0,R24
0080 .dbline 88
0080 ; *stk-- = (INT8U)0x07;
0080 1A01 movw R2,R20
0082 4150 subi R20,1
0084 5040 sbci R21,0
0086 87E0 ldi R24,7
0088 F101 movw R30,R2
008A 8083 std z+0,R24
008C .dbline 89
008C ; *stk-- = (INT8U)0x08;
008C 1A01 movw R2,R20
008E 4150 subi R20,1
0090 5040 sbci R21,0
0092 88E0 ldi R24,8
0094 F101 movw R30,R2
0096 8083 std z+0,R24
0098 .dbline 90
0098 ; *stk-- = (INT8U)0x09;
0098 1A01 movw R2,R20
009A 4150 subi R20,1
009C 5040 sbci R21,0
009E 89E0 ldi R24,9
00A0 F101 movw R30,R2
00A2 8083 std z+0,R24
00A4 .dbline 91
00A4 ; *stk-- = (INT8U)0x10;
00A4 1A01 movw R2,R20
00A6 4150 subi R20,1
00A8 5040 sbci R21,0
00AA 80E1 ldi R24,16
00AC F101 movw R30,R2
00AE 8083 std z+0,R24
00B0 .dbline 92
00B0 ; *stk-- = (INT8U)0x11;
00B0 1A01 movw R2,R20
00B2 4150 subi R20,1
00B4 5040 sbci R21,0
00B6 81E1 ldi R24,17
00B8 F101 movw R30,R2
00BA 8083 std z+0,R24
00BC .dbline 93
00BC ; *stk-- = (INT8U)0x12;
00BC 1A01 movw R2,R20
00BE 4150 subi R20,1
00C0 5040 sbci R21,0
00C2 82E1 ldi R24,18
00C4 F101 movw R30,R2
00C6 8083 std z+0,R24
00C8 .dbline 94
00C8 ; *stk-- = (INT8U)0x13;
00C8 1A01 movw R2,R20
00CA 4150 subi R20,1
00CC 5040 sbci R21,0
00CE 83E1 ldi R24,19
00D0 F101 movw R30,R2
00D2 8083 std z+0,R24
00D4 .dbline 95
00D4 ; *stk-- = (INT8U)0x14;
00D4 1A01 movw R2,R20
00D6 4150 subi R20,1
00D8 5040 sbci R21,0
00DA 84E1 ldi R24,20
00DC F101 movw R30,R2
00DE 8083 std z+0,R24
00E0 .dbline 96
00E0 ; *stk-- = (INT8U)0x15;
00E0 1A01 movw R2,R20
00E2 4150 subi R20,1
00E4 5040 sbci R21,0
00E6 85E1 ldi R24,21
00E8 F101 movw R30,R2
00EA 8083 std z+0,R24
00EC .dbline 97
00EC ; tmp = (INT16U)pdata;
00EC B901 movw R22,R18
00EE .dbline 98
00EE ; *stk-- = (INT8U)tmp; //Simulate call to function with argument
00EE 1A01 movw R2,R20
00F0 4150 subi R20,1
00F2 5040 sbci R21,0
00F4 F101 movw R30,R2
00F6 6083 std z+0,R22
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -