📄 ucosii.lst
字号:
__start:
__text_start:
0094 E5CF LDI R28,0x5F
0095 E0D2 LDI R29,2
0096 BFCD OUT P3D,R28
0097 BFDE OUT P3E,R29
0098 51C0 SUBI R28,0x10
0099 40D0 SBCI R29,0
009A EA0A LDI R16,0xAA
009B 8308 STD R16,0+Y
009C 2400 CLR R0
009D E6E0 LDI R30,0x60
009E E0F0 LDI R31,0
009F E012 LDI R17,2
00A0 32ED CPI R30,0x2D
00A1 07F1 CPC R31,R17
00A2 F011 BEQ 0x00A5
00A3 9201 ST R0,Z+
00A4 CFFB RJMP 0x00A0
00A5 8300 STD R16,0+Z
00A6 E2E8 LDI R30,0x28
00A7 E0F1 LDI R31,1
00A8 E6A0 LDI R26,0x60
00A9 E0B0 LDI R27,0
00AA E011 LDI R17,1
00AB 32E8 CPI R30,0x28
00AC 07F1 CPC R31,R17
00AD F021 BEQ 0x00B2
00AE 95C8 LPM
00AF 9631 ADIW R30,1
00B0 920D ST R0,X+
00B1 CFF9 RJMP 0x00AB
00B2 DBE3 RCALL _main
_exit:
00B3 CFFF RJMP _exit
_OSTaskStkInit:
stks --> R10
tmp --> R22
stk --> R20
opt --> Y+10
ptos --> Y+8
pdata --> R12
task --> R22
00B4 DC65 RCALL push_gset4
00B5 2EC2 MOV R12,R18
00B6 2ED3 MOV R13,R19
00B7 2F60 MOV R22,R16
00B8 2F71 MOV R23,R17
FILE: C:\software\UCOS-II\ucos2_iccavr\iccavr\source\os_cpu_c.c
(0001) /*
(0002) ********************************************************************************
(0003) * uC/OS-II
(0004) * The Real-Time Kernel
(0005) *
(0006) * ATmega103 Specific code
(0007) *
(0008) * File: OS_CPU_C.C
(0009) * By: Ole Saether
(0010) * Modified by: Joerg Meyer
(0011) * Revision: 0
(0012) *
(0013) *
(0014) *
(0015) ********************************************************************************
(0016) */
(0017)
(0018) #define OS_CPU_GLOBALS
(0019) #include "includes.h"
(0020)
(0021) /*
(0022) ********************************************************************************
(0023) * INITIALIZE A TASK'S STACK
(0024) *
(0025) * Description:
(0026) * This function is called by either OSTaskCreate() or OSTaskCreateExt() to
(0027) * initialize the stack frame of the task being created. This function is
(0028) * highly processor specific.
(0029) *
(0030) * Arguments:
(0031) * task - is a pointer to the task code
(0032) *
(0033) * pdata - is a pointer to a user supplied data area that will be passed to the
(0034) * task when the task first executes.
(0035) *
(0036) * ptos - is a pointer to the top of stack. It is assumed that 'ptos' points to
(0037) * the highest valid address on the stack.
(0038) *
(0039) * opt - specifies options that can be used to alter the behavior of
(0040) OSTaskStkInit(). (see uCOS_II.H for OS_TASK_OPT_???).
(0041) *
(0042) * Returns:
(0043) * Always returns the location of the new top-of-stack' once the processor
(0044) * registers have been placed on the stack in the proper order.
(0045) *
(0046) * Note(s):
(0047) * Interrupts are enabled when your task starts executing. You can change this
(0048) * by setting the SREG to 0x00 instead. In this case, interrupts would be
(0049) * disabled upon task startup. The application code would be responsible for
(0050) * enabling interrupts at the beginning of the task code. You will need to
(0051) * modify OSTaskIdle() and OSTaskStat() so that they enable interrupts. Failure
(0052) * to do this will make your system crash! The AVR return stack is placed 64
(0053) * bytes above the start of the (512 byte) stack. This provides 32 levels of
(0054) * function call nesting which should be more than enough for most applications
(0055) * (see the "read.me" file for more info).
(0056) *
(0057) ********************************************************************************
(0058) */
(0059) OS_STK *OSTaskStkInit (void (*task)(void *pd),
(0060) void *pdata, OS_STK *ptos, INT16U opt){
(0061)
(0062) INT8U *stk;
(0063) INT8U *stks; // Temp. variable used for setting up AVR hardware stack
(0064) INT16U tmp;
(0065)
(0066)
(0067) opt = opt; // 'opt' is not used, prevent warning
(0068) stk = (INT8U *)ptos; // Wandlung von ptos in Bytezeiger
00B9 8548 LDD R20,8+Y
00BA 8559 LDD R21,9+Y
(0069) // AVR return stack ("hardware stack")
(0070) stks = (INT8U *)(ptos)-(OS_TASK_DEF_STK_SIZE-32);
00BB 8588 LDD R24,8+Y
00BC 8599 LDD R25,9+Y
00BD 5480 SUBI R24,0x40
00BE 4090 SBCI R25,0
00BF 2EA8 MOV R10,R24
00C0 2EB9 MOV R11,R25
(0071)
(0072) // the function address has an extra level of indirection. Fetch the
(0073) // actual address.
(0074) //
(0075) tmp = *(INT16U const *)task;
00C1 2F06 MOV R16,R22
00C2 2F17 MOV R17,R23
00C3 DC5F RCALL lpm16
00C4 2F60 MOV R22,R16
00C5 2F71 MOV R23,R17
(0076)
(0077) // 36 Bytes
(0078) *stks-- = (INT8U)tmp; //Put task start address on top of hardware stack
00C6 2C2A MOV R2,R10
00C7 2C3B MOV R3,R11
00C8 2D82 MOV R24,R2
00C9 2D93 MOV R25,R3
00CA 9701 SBIW R24,1
00CB 2DE2 MOV R30,R2
00CC 2DF3 MOV R31,R3
00CD 8360 STD R22,0+Z
(0079) *stks-- = (INT8U)(tmp >> 8);
00CE 2E28 MOV R2,R24
00CF 2E39 MOV R3,R25
00D0 9701 SBIW R24,1
00D1 2EA8 MOV R10,R24
00D2 2EB9 MOV R11,R25
00D3 2E46 MOV R4,R22
00D4 2E57 MOV R5,R23
00D5 2C45 MOV R4,R5
00D6 2455 CLR R5
00D7 2DE2 MOV R30,R2
00D8 2DF3 MOV R31,R3
00D9 8240 STD R4,0+Z
(0080)
(0081) *stk-- = (INT8U)0x00; // R0 = 0x00
00DA 2E24 MOV R2,R20
00DB 2E35 MOV R3,R21
00DC 5041 SUBI R20,1
00DD 4050 SBCI R21,0
00DE 2444 CLR R4
00DF 2DE2 MOV R30,R2
00E0 2DF3 MOV R31,R3
00E1 8240 STD R4,0+Z
(0082) *stk-- = (INT8U)0x01;
00E2 2E24 MOV R2,R20
00E3 2E35 MOV R3,R21
00E4 5041 SUBI R20,1
00E5 4050 SBCI R21,0
00E6 E081 LDI R24,1
00E7 2DE2 MOV R30,R2
00E8 2DF3 MOV R31,R3
00E9 8380 STD R24,0+Z
(0083) *stk-- = (INT8U)0x02;
00EA 2E24 MOV R2,R20
00EB 2E35 MOV R3,R21
00EC 5041 SUBI R20,1
00ED 4050 SBCI R21,0
00EE E082 LDI R24,2
00EF 2DE2 MOV R30,R2
00F0 2DF3 MOV R31,R3
00F1 8380 STD R24,0+Z
(0084) *stk-- = (INT8U)0x03;
00F2 2E24 MOV R2,R20
00F3 2E35 MOV R3,R21
00F4 5041 SUBI R20,1
00F5 4050 SBCI R21,0
00F6 E083 LDI R24,3
00F7 2DE2 MOV R30,R2
00F8 2DF3 MOV R31,R3
00F9 8380 STD R24,0+Z
(0085) *stk-- = (INT8U)0x04;
00FA 2E24 MOV R2,R20
00FB 2E35 MOV R3,R21
00FC 5041 SUBI R20,1
00FD 4050 SBCI R21,0
00FE E084 LDI R24,4
00FF 2DE2 MOV R30,R2
0100 2DF3 MOV R31,R3
0101 8380 STD R24,0+Z
(0086) *stk-- = (INT8U)0x05;
0102 2E24 MOV R2,R20
0103 2E35 MOV R3,R21
0104 5041 SUBI R20,1
0105 4050 SBCI R21,0
0106 E085 LDI R24,5
0107 2DE2 MOV R30,R2
0108 2DF3 MOV R31,R3
0109 8380 STD R24,0+Z
(0087) *stk-- = (INT8U)0x06;
010A 2E24 MOV R2,R20
010B 2E35 MOV R3,R21
010C 5041 SUBI R20,1
010D 4050 SBCI R21,0
010E E086 LDI R24,6
010F 2DE2 MOV R30,R2
0110 2DF3 MOV R31,R3
0111 8380 STD R24,0+Z
(0088) *stk-- = (INT8U)0x07;
0112 2E24 MOV R2,R20
0113 2E35 MOV R3,R21
0114 5041 SUBI R20,1
0115 4050 SBCI R21,0
0116 E087 LDI R24,7
0117 2DE2 MOV R30,R2
0118 2DF3 MOV R31,R3
0119 8380 STD R24,0+Z
(0089) *stk-- = (INT8U)0x08;
011A 2E24 MOV R2,R20
011B 2E35 MOV R3,R21
011C 5041 SUBI R20,1
011D 4050 SBCI R21,0
011E E088 LDI R24,0x8
011F 2DE2 MOV R30,R2
0120 2DF3 MOV R31,R3
0121 8380 STD R24,0+Z
(0090) *stk-- = (INT8U)0x09;
0122 2E24 MOV R2,R20
0123 2E35 MOV R3,R21
0124 5041 SUBI R20,1
0125 4050 SBCI R21,0
0126 E089 LDI R24,0x9
0127 2DE2 MOV R30,R2
0128 2DF3 MOV R31,R3
0129 8380 STD R24,0+Z
(0091) *stk-- = (INT8U)0x10;
012A 2E24 MOV R2,R20
012B 2E35 MOV R3,R21
012C 5041 SUBI R20,1
012D 4050 SBCI R21,0
012E E180 LDI R24,0x10
012F 2DE2 MOV R30,R2
0130 2DF3 MOV R31,R3
0131 8380 STD R24,0+Z
(0092) *stk-- = (INT8U)0x11;
0132 2E24 MOV R2,R20
0133 2E35 MOV R3,R21
0134 5041 SUBI R20,1
0135 4050 SBCI R21,0
0136 E181 LDI R24,0x11
0137 2DE2 MOV R30,R2
0138 2DF3 MOV R31,R3
0139 8380 STD R24,0+Z
(0093) *stk-- = (INT8U)0x12;
013A 2E24 MOV R2,R20
013B 2E35 MOV R3,R21
013C 5041 SUBI R20,1
013D 4050 SBCI R21,0
013E E182 LDI R24,0x12
013F 2DE2 MOV R30,R2
0140 2DF3 MOV R31,R3
0141 8380 STD R24,0+Z
(0094) *stk-- = (INT8U)0x13;
0142 2E24 MOV R2,R20
0143 2E35 MOV R3,R21
0144 5041 SUBI R20,1
0145 4050 SBCI R21,0
0146 E183 LDI R24,0x13
0147 2DE2 MOV R30,R2
0148 2DF3 MOV R31,R3
0149 8380 STD R24,0+Z
(0095) *stk-- = (INT8U)0x14;
014A 2E24 MOV R2,R20
014B 2E35 MOV R3,R21
014C 5041 SUBI R20,1
014D 4050 SBCI R21,0
014E E184 LDI R24,0x14
014F 2DE2 MOV R30,R2
0150 2DF3 MOV R31,R3
0151 8380 STD R24,0+Z
(0096) *stk-- = (INT8U)0x15;
0152 2E24 MOV R2,R20
0153 2E35 MOV R3,R21
0154 5041 SUBI R20,1
0155 4050 SBCI R21,0
0156 E185 LDI R24,0x15
0157 2DE2 MOV R30,R2
0158 2DF3 MOV R31,R3
0159 8380 STD R24,0+Z
(0097) tmp = (INT16U)pdata;
015A 2D6C MOV R22,R12
015B 2D7D MOV R23,R13
(0098) *stk-- = (INT8U)tmp; //Simulate call to function with argument
015C 2E24 MOV R2,R20
015D 2E35 MOV R3,R21
015E 5041 SUBI R20,1
015F 4050 SBCI R21,0
0160 2DE2 MOV R30,R2
0161 2DF3 MOV R31,R3
0162 8360 STD R22,0+Z
(0099) *stk-- = (INT8U)(tmp >> 8);
0163 2E24 MOV R2,R20
0164 2E35 MOV R3,R21
0165 5041 SUBI R20,1
0166 4050 SBCI R21,0
0167 2E46 MOV R4,R22
0168 2E57 MOV R5,R23
0169 2C45 MOV R4,R5
016A 2455 CLR R5
016B 2DE2 MOV R30,R2
016C 2DF3 MOV R31,R3
016D 8240 STD R4,0+Z
(0100) *stk-- = (INT8U)0x18;
016E 2E24 MOV R2,R20
016F 2E35 MOV R3,R21
0170 5041 SUBI R20,1
0171 4050 SBCI R21,0
0172 E188 LDI R24,0x18
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -