📄 test1.s
字号:
.module test1.c
.area text(rom, con, rel)
.dbfile G:\编程2002-10-15-HOME\做过的项目\2002-10-22\home-c\software\ucos-ii-at90S-icc-avr\os-task-sem\test1.c
.dbfunc e main _main fV
; err -> R20
.even
_main::
sbiw R28,7
.dbline -1
.dbline 5
; //test1.c
; #include "includes.h"
;
; void main(void)
; {
.dbline 8
; INT8U err;
; #if PROGRAM_START_FLASH_EN
; ProgramStart();
rcall _ProgramStart
.dbline 10
; #endif
; OSInit();
rcall _OSInit
.dbline 12
; //create task1
; err=OSTaskCreate(&tcb_task1,task1,(void*)(int)1,
clr R2
std y+6,R2
ldi R24,128
ldi R25,0
std y+4,R24
std y+5,R25
ldi R24,<_stk_task1+127
ldi R25,>_stk_task1+127
std y+2,R24
std y+3,R25
ldi R24,1
ldi R25,0
std y+0,R24
std y+1,R25
ldi R18,<PL_task1
ldi R19,>PL_task1
ldi R16,<_tcb_task1
ldi R17,>_tcb_task1
rcall _OSTaskCreate
mov R20,R16
.dbline 17
; &stk_task1[OS_TASK_STACK_SIZE-1],
; OS_TASK_STACK_SIZE,
; 0);
; #if OS_STRICT
; if(OS_NO_ERR!=err)
tst R16
breq L4
.dbline 18
; OSError(0);
clr R16
rcall _OSError
L4:
.dbline 21
; #endif
; //create task2
; err=OSTaskCreate(&tcb_task2,task2,(void*)(int)2,
ldi R24,1
std y+6,R24
ldi R24,128
ldi R25,0
std y+4,R24
std y+5,R25
ldi R24,<_stk_task2+127
ldi R25,>_stk_task2+127
std y+2,R24
std y+3,R25
ldi R24,2
ldi R25,0
std y+0,R24
std y+1,R25
ldi R18,<PL_task2
ldi R19,>PL_task2
ldi R16,<_tcb_task2
ldi R17,>_tcb_task2
rcall _OSTaskCreate
mov R20,R16
.dbline 26
; &stk_task2[OS_TASK_STACK_SIZE-1],
; OS_TASK_STACK_SIZE,
; 1);
; #if OS_STRICT
; if(OS_NO_ERR!=err)
tst R16
breq L7
.dbline 27
; OSError(0);
clr R16
rcall _OSError
L7:
.dbline 31
; #endif
;
; //create task3
; err=OSTaskCreate(&tcb_task3,task3,(void*)(int)3,
ldi R24,2
std y+6,R24
ldi R24,128
ldi R25,0
std y+4,R24
std y+5,R25
ldi R24,<_stk_task3+127
ldi R25,>_stk_task3+127
std y+2,R24
std y+3,R25
ldi R24,3
ldi R25,0
std y+0,R24
std y+1,R25
ldi R18,<PL_task3
ldi R19,>PL_task3
ldi R16,<_tcb_task3
ldi R17,>_tcb_task3
rcall _OSTaskCreate
mov R20,R16
.dbline 36
; &stk_task3[OS_TASK_STACK_SIZE-1],
; OS_TASK_STACK_SIZE,
; 2);
; #if OS_STRICT
; if(OS_NO_ERR!=err)
tst R16
breq L10
.dbline 37
; OSError(0);
clr R16
rcall _OSError
L10:
.dbline 41
; #endif
;
; #if OS_SEM_EN
; OSSemCreate(&uart_sem,1);
ldi R18,1
ldi R19,0
ldi R16,<_uart_sem
ldi R17,>_uart_sem
rcall _OSSemCreate
.dbline 52
; #if LCD_EN
; lcd_init();
; lcd_puts("hi,sem test!");
; #if DEBUG_IN_AVR_STUDIO==0
; Delay();
; #endif
; lcd_clear();
; #endif//LCD_EN
; #endif//OS_SEM_EN
; //////////
; TC2_Init();
rcall _TC2_Init
.dbline 53
; SEI();
sei
.dbline 54
; OSStart(); // start multitasking
rcall _OSStart
.dbline 57
;
; #if OS_STRICT
; OSError(0);
clr R16
rcall _OSError
L12:
.dbline 60
L13:
.dbline 59
rjmp L12
X0:
.dbline -2
.dbline 61
; #endif
; while(1)
; ;
; }
L2:
adiw R28,7
.dbline 0 ; func end
ret
.dbsym r err 20 c
.dbend
.area vector(rom, abs)
.org 14
rjmp _OSTickISR
.area text(rom, con, rel)
.dbfile G:\编程2002-10-15-HOME\做过的项目\2002-10-22\home-c\software\ucos-ii-at90S-icc-avr\os-task-sem\test1.c
.area func_lit
PL_task3: .word `_task3
PL_task2: .word `_task2
PL_task1: .word `_task1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -