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

📄 main.asm

📁 此代码是ucos-II在凌阳61单片机上的移植
💻 ASM
字号:
// GCC for SUNPLUS u'nSP version 1.0.21-3
// Command: D:\PROGRA~1\Sunplus\UNSPID~1.0\cc1.exe C:\DOCUME~1\inhow\LOCALS~1\Temp\cc2Baaaa.i -fkeep-inline-functions -quiet -dumpbase main.c -mglobal-var-iram -gstabs -Wall -o .\Debug/main.asm
	.external __sn_func_ptr_sec

// gcc2_compiled.:

.debug
	.dw '.stabs "C:/61ucostest/",0x64,0,3,',0,0,offset Ltext0,seg Ltext0,0x0d,0x0a
.code
.debug
	.dw '.stabs "C:/61ucostest/main.c",0x64,0,3,',0,0,offset Ltext0,seg Ltext0,0x0d,0x0a
.code
.code
Ltext0:
.debug
	.dw '.stabs "int:t1=r1;-32768;32767;",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "char:t2=r2;0;127;",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "long int:t3=r3;-2147483648;2147483647;",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "unsigned int:t4=r4;0;65535;",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "long unsigned int:t5=r5;0;4294967295;",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "long long int:t6=r6;-2147483648;2147483647;",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "long long unsigned int:t7=r7;0;4294967295;",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "short int:t8=r8;-32768;32767;",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "short unsigned int:t9=r9;0;65535;",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "signed char:t10=r10;-32768;32767;",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "unsigned char:t11=r11;0;65535;",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "float:t12=r1;2;0;",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "double:t13=r1;2;0;",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "long double:t14=r1;2;0;",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "complex int:t15=s2real:1,0,16;imag:1,16,16;;",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "complex float:t16=r16;2;0;",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "complex double:t17=r17;2;0;",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "complex long double:t18=r18;2;0;",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "void:t19=19",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "BOOLEAN:t20=11",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "INT8U:t21=11",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "INT8S:t22=10",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "INT16U:t23=4",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "INT16S:t24=1",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "INT32U:t25=5",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "INT32S:t26=3",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "FP32:t27=12",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "fp64:t28=13",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "OS_STK:t29=2",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "os_event:T30=s24OSEventType:21,0,16;OSEventPtr:31=*19,16,16;\\",128,0,0,0',0x0d,0x0a
	.DW '.stabs "OSEventCnt:23,32,16;OSEventGrp:21,48,16;OSEventTbl:32=ar1;0;3;21,64,64;\\",128,0,0,0',0x0d,0x0a
	.DW '.stabs "OSEventName:33=ar1;0;15;21,128,256;;",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "OS_EVENT:t34=30",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "os_sem_data:T35=s6OSCnt:23,0,16;OSEventTbl:32,16,64;\\",128,0,0,0',0x0d,0x0a
	.DW '.stabs "OSEventGrp:21,80,16;;",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "OS_SEM_DATA:t36=35",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "os_stk_data:T37=s4OSFree:25,0,32;OSUsed:25,32,32;;",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "OS_STK_DATA:t38=37",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "os_tcb:T39=s60OSTCBStkPtr:40=*29,0,16;OSTCBExtPtr:31,16,16;\\",128,0,0,0',0x0d,0x0a
	.DW '.stabs "OSTCBStkBottom:40,32,16;OSTCBStkSize:25,48,32;\\",128,0,0,0',0x0d,0x0a
	.DW '.stabs "OSTCBOpt:23,80,16;OSTCBId:23,96,16;OSTCBNext:41=*39,112,16;\\",128,0,0,0',0x0d,0x0a
	.DW '.stabs "OSTCBPrev:41,128,16;OSTCBEventPtr:42=*34,144,16;\\",128,0,0,0',0x0d,0x0a
	.DW '.stabs "OSTCBDly:23,160,16;OSTCBStat:21,176,16;OSTCBPendTO:20,192,16;\\",128,0,0,0',0x0d,0x0a
	.DW '.stabs "OSTCBPrio:21,208,16;OSTCBX:21,224,16;OSTCBY:21,240,16;\\",128,0,0,0',0x0d,0x0a
	.DW '.stabs "OSTCBBitX:21,256,16;OSTCBBitY:21,272,16;OSTCBDelReq:21,288,16;\\",128,0,0,0',0x0d,0x0a
	.DW '.stabs "OSTCBCtxSwCtr:25,304,32;OSTCBCyclesTot:25,336,32;\\",128,0,0,0',0x0d,0x0a
	.DW '.stabs "OSTCBCyclesStart:25,368,32;OSTCBStkBase:40,400,16;\\",128,0,0,0',0x0d,0x0a
	.DW '.stabs "OSTCBStkUsed:25,416,32;OSTCBTaskName:43=ar1;0;31;21,448,512;;",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "OS_TCB:t44=39",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabs "sem:G42",32,0,0,',0,0,offset _sem,seg _sem,0x0d,0x0a
.CODE
.debug
	.dw '.stabs "TaskAStk:G45=ar1;0;50;29",32,0,0,',0,0,offset _TaskAStk,seg _TaskAStk,0x0d,0x0a
.CODE
.debug
	.dw '.stabs "TaskBStk:G45",32,0,0,',0,0,offset _TaskBStk,seg _TaskBStk,0x0d,0x0a
.CODE
.code
.debug
	.dw '.stabs "main:F1",36,0,0,',0,0,offset _main,seg _main,0x0d,0x0a
.CODE
.public _main
_main:	.proc
.debug
	.dw '.stabn 0x44,0,13,',0,0
	.dd LM1-_main
	.dw 0x0d,0x0a
.code
LM1:
	// total=1, vars=1
	// frame_pointer_needed: 1
	push bp to [sp]
	sp-=1
	bp=sp+1

	R1=BP+4
	[BP]=R1	// QImode move
.debug
	.dw '.stabn 0x44,0,14,',0,0
	.dd LM2-_main
	.dw 0x0d,0x0a
.code
LM2:
	call _OSInit	// call without return value
.debug
	.dw '.stabn 0x44,0,15,',0,0
	.dd LM3-_main
	.dw 0x0d,0x0a
.code
LM3:
	R1=1	// QImode move
	[SP--]=R1	// QImode move
	call _OSSemCreate	// call with return value
	SP = SP + 1	//SP
	[_sem]=R1	// QImode move
.debug
	.dw '.stabn 0x44,0,16,',0,0
	.dd LM4-_main
	.dw 0x0d,0x0a
.code
LM4:
	R1=3	// QImode move
	[SP--]=R1	// QImode move
	R1=0	// QImode move
	[SP--]=R1	// QImode move
	//split R1, 50
	R1=50	// QImode move
	R2=0	// QImode move
	push R1,R2 to [sp]	// pushhi
	R1=_TaskAStk	// QImode move
	[SP--]=R1	// QImode move
	R1=2	// QImode move
	[SP--]=R1	// QImode move
	R1=2	// QImode move
	[SP--]=R1	// QImode move
	R1=_TaskAStk+50	// QImode move
	[SP--]=R1	// QImode move
	R1=0	// QImode move
	[SP--]=R1	// QImode move
	R1=TaskA_entry	// QImode move, function pointer
	[SP--]=R1	// QImode move
	call _OSTaskCreateExt	// call with return value
	SP = SP + 10	//SP
.debug
	.dw '.stabn 0x44,0,17,',0,0
	.dd LM5-_main
	.dw 0x0d,0x0a
.code
LM5:
	R1=3	// QImode move
	[SP--]=R1	// QImode move
	R1=0	// QImode move
	[SP--]=R1	// QImode move
	//split R1, 50
	R1=50	// QImode move
	R2=0	// QImode move
	push R1,R2 to [sp]	// pushhi
	R1=_TaskBStk	// QImode move
	[SP--]=R1	// QImode move
	R1=23	// QImode move
	[SP--]=R1	// QImode move
	R1=23	// QImode move
	[SP--]=R1	// QImode move
	R1=_TaskBStk+50	// QImode move
	[SP--]=R1	// QImode move
	R1=0	// QImode move
	[SP--]=R1	// QImode move
	R1=TaskB_entry	// QImode move, function pointer
	[SP--]=R1	// QImode move
	call _OSTaskCreateExt	// call with return value
	SP = SP + 10	//SP
.debug
	.dw '.stabn 0x44,0,18,',0,0
	.dd LM6-_main
	.dw 0x0d,0x0a
.code
LM6:
	call _OSStart	// call without return value
.debug
	.dw '.stabn 0x44,0,19,',0,0
	.dd LM7-_main
	.dw 0x0d,0x0a
.code
LM7:
.debug
	.dw '.stabn 0x44,0,19,',0,0
	.dd LM8-_main
	.dw 0x0d,0x0a
.code
LM8:
L2:

	sp+=1
	pop bp from [sp]
	retf
	.endp	// end of main

.debug
	.dw '.stabf ',0,0
	.dd LME1-_main
	.dw 0x0d,0x0a
.code
LME1:
.code
.debug
	.dw '.stabs "TaskA:F19",36,0,0,',0,0,offset _TaskA,seg _TaskA,0x0d,0x0a
.CODE
.public _TaskA
_TaskA:	.proc
.debug
	.dw '.stabn 0x44,0,22,',0,0
	.dd LM9-_TaskA
	.dw 0x0d,0x0a
.code
LM9:
	// total=2, vars=2
	// frame_pointer_needed: 1
	push bp to [sp]
	sp-=2
	bp=sp+1

	R1=BP+5
	[bp+1]=R1	// QImode move
.debug
	.dw '.stabn 0x44,0,23,',0,0
	.dd LM10-_TaskA
	.dw 0x0d,0x0a
.code
LM10:
LBB2:
.debug
	.dw '.stabn 0x44,0,25,',0,0
	.dd LM11-_TaskA
	.dw 0x0d,0x0a
.code
LM11:
	call _InitSystem	// call with return value
L4:
.debug
	.dw '.stabn 0x44,0,28,',0,0
	.dd LM12-_TaskA
	.dw 0x0d,0x0a
.code
LM12:
LBB3:
	[SP--]=BP	// QImode move
	R1=0	// QImode move
	[SP--]=R1	// QImode move
	R1=[_sem]	// QImode move
	[SP--]=R1	// QImode move
	call _OSSemPend	// call without return value
	SP = SP + 3	//SP
.debug
	.dw '.stabn 0x44,0,29,',0,0
	.dd LM13-_TaskA
	.dw 0x0d,0x0a
.code
LM13:
	R1=(-256)	// QImode move
	[SP--]=R1	// QImode move
	call _display	// call with return value
	SP = SP + 1	//SP
.debug
	.dw '.stabn 0x44,0,30,',0,0
	.dd LM14-_TaskA
	.dw 0x0d,0x0a
.code
LM14:
	R1=64	// QImode move
	[SP--]=R1	// QImode move
	call _OSTimeDly	// call without return value
	SP = SP + 1	//SP
.debug
	.dw '.stabn 0x44,0,31,',0,0
	.dd LM15-_TaskA
	.dw 0x0d,0x0a
.code
LM15:
	R1=[_sem]	// QImode move
	[SP--]=R1	// QImode move
	call _OSSemPost	// call with return value
	SP = SP + 1	//SP
.debug
	.dw '.stabn 0x44,0,32,',0,0
	.dd LM16-_TaskA
	.dw 0x0d,0x0a
.code
LM16:
LBE3:
.debug
	.dw '.stabn 0x44,0,26,',0,0
	.dd LM17-_TaskA
	.dw 0x0d,0x0a
.code
LM17:
L6:
	pc=L4	// Indirect jump
L5:
.debug
	.dw '.stabn 0x44,0,33,',0,0
	.dd LM18-_TaskA
	.dw 0x0d,0x0a
.code
LM18:
LBE2:
.debug
	.dw '.stabn 0x44,0,33,',0,0
	.dd LM19-_TaskA
	.dw 0x0d,0x0a
.code
LM19:
L3:

	sp+=2
	pop bp from [sp]
	retf
	.endp	// end of TaskA

.debug
	.dw '.stabs "data:p31",160,0,0,5',0x0d,0x0a
.CODE
.debug
	.dw '.stabn 0xc0,0,0,',0,0
	.dd LBB2-_TaskA
	.dw 0x0d,0x0a
.code
.debug
	.dw '.stabs "erra:21",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabn 0xc0,0,0,',0,0
	.dd LBB3-_TaskA
	.dw 0x0d,0x0a
.code
.debug
	.dw '.stabn 0xe0,0,0,',0,0
	.dd LBE3-_TaskA
	.dw 0x0d,0x0a
.code
.debug
	.dw '.stabn 0xe0,0,0,',0,0
	.dd LBE2-_TaskA
	.dw 0x0d,0x0a
.code
.debug
	.dw '.stabf ',0,0
	.dd LME2-_TaskA
	.dw 0x0d,0x0a
.code
LME2:
.code
.debug
	.dw '.stabs "TaskB:F19",36,0,0,',0,0,offset _TaskB,seg _TaskB,0x0d,0x0a
.CODE
.public _TaskB
_TaskB:	.proc
.debug
	.dw '.stabn 0x44,0,36,',0,0
	.dd LM20-_TaskB
	.dw 0x0d,0x0a
.code
LM20:
	// total=2, vars=2
	// frame_pointer_needed: 1
	push bp to [sp]
	sp-=2
	bp=sp+1

	R1=BP+5
	[bp+1]=R1	// QImode move
.debug
	.dw '.stabn 0x44,0,37,',0,0
	.dd LM21-_TaskB
	.dw 0x0d,0x0a
.code
LM21:
LBB4:
L8:
.debug
	.dw '.stabn 0x44,0,41,',0,0
	.dd LM22-_TaskB
	.dw 0x0d,0x0a
.code
LM22:
LBB5:
	[SP--]=BP	// QImode move
	R1=0	// QImode move
	[SP--]=R1	// QImode move
	R1=[_sem]	// QImode move
	[SP--]=R1	// QImode move
	call _OSSemPend	// call without return value
	SP = SP + 3	//SP
.debug
	.dw '.stabn 0x44,0,42,',0,0
	.dd LM23-_TaskB
	.dw 0x0d,0x0a
.code
LM23:
	R1=(-1)	// QImode move
	[SP--]=R1	// QImode move
	call _display	// call with return value
	SP = SP + 1	//SP
.debug
	.dw '.stabn 0x44,0,43,',0,0
	.dd LM24-_TaskB
	.dw 0x0d,0x0a
.code
LM24:
	R1=64	// QImode move
	[SP--]=R1	// QImode move
	call _OSTimeDly	// call without return value
	SP = SP + 1	//SP
.debug
	.dw '.stabn 0x44,0,44,',0,0
	.dd LM25-_TaskB
	.dw 0x0d,0x0a
.code
LM25:
	R1=[_sem]	// QImode move
	[SP--]=R1	// QImode move
	call _OSSemPost	// call with return value
	SP = SP + 1	//SP
.debug
	.dw '.stabn 0x44,0,45,',0,0
	.dd LM26-_TaskB
	.dw 0x0d,0x0a
.code
LM26:
LBE5:
.debug
	.dw '.stabn 0x44,0,39,',0,0
	.dd LM27-_TaskB
	.dw 0x0d,0x0a
.code
LM27:
L10:
	pc=L8	// Indirect jump
L9:
.debug
	.dw '.stabn 0x44,0,46,',0,0
	.dd LM28-_TaskB
	.dw 0x0d,0x0a
.code
LM28:
LBE4:
.debug
	.dw '.stabn 0x44,0,46,',0,0
	.dd LM29-_TaskB
	.dw 0x0d,0x0a
.code
LM29:
L7:

	sp+=2
	pop bp from [sp]
	retf
	.endp	// end of TaskB

.debug
	.dw '.stabs "data:p31",160,0,0,5',0x0d,0x0a
.CODE
.debug
	.dw '.stabn 0xc0,0,0,',0,0
	.dd LBB4-_TaskB
	.dw 0x0d,0x0a
.code
.debug
	.dw '.stabs "errb:21",128,0,0,0',0x0d,0x0a
.CODE
.debug
	.dw '.stabn 0xc0,0,0,',0,0
	.dd LBB5-_TaskB
	.dw 0x0d,0x0a
.code
.debug
	.dw '.stabn 0xe0,0,0,',0,0
	.dd LBE5-_TaskB
	.dw 0x0d,0x0a
.code
.debug
	.dw '.stabn 0xe0,0,0,',0,0
	.dd LBE4-_TaskB
	.dw 0x0d,0x0a
.code
.debug
	.dw '.stabf ',0,0
	.dd LME3-_TaskB
	.dw 0x0d,0x0a
.code
LME3:
.iram
.public _sem
_sem:
	.dw 0
.iram
.public _TaskAStk
_TaskAStk:
	.dw 51 dup(0)
.iram
.public _TaskBStk
_TaskBStk:
	.dw 51 dup(0)
.external _display
.external _OSSemPost
.external _OSTimeDly
.external _OSSemPend
.external _InitSystem
.external _OSStart
.external _OSTaskCreateExt
.external _OSSemCreate
.external _OSInit

// far pointer entry table:
TaskB_ptsec: .section .vtbl
TaskB_entry:	.dw seg _TaskB, offset _TaskB

TaskA_ptsec: .section .vtbl
TaskA_entry:	.dw seg _TaskA, offset _TaskA

	.end

⌨️ 快捷键说明

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