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

📄 os_sem.asm

📁 ucOS在51单片机上的移植实现
💻 ASM
📖 第 1 页 / 共 2 页
字号:
;***************************************************************
;* TMS320C54x ANSI C Codegen                      Version 3.50 *
;* Date/Time created: Wed Apr 07 11:37:08 2004                 *
;***************************************************************
	.mmregs
FP	.set	AR7
	.c_mode
;	acp500 -m --i_output_file D:\DOCUME~1\liuchao\LOCALS~1\Temp\tempTI2 --ii_file D:\DOCUME~1\liuchao\LOCALS~1\Temp\tempTI3 --object_file .\os_sem.obj --opt_shell 5 os_sem.c os_sem.c -gk -as -fr. os_sem.c 
	.file	"os_sem.c"
	.file	"e:\ti\c5400\cgtools\include\os_cpu.h"
	.sym	_BOOLEAN, 0, 14, 13, 16
	.sym	_INT8U, 0, 14, 13, 16
	.sym	_INT16U, 0, 14, 13, 16
	.sym	_INT32U, 0, 15, 13, 32
	.sym	_OS_STK, 0, 14, 13, 16
	.file	"e:\ti\c5400\cgtools\include\os_cfg.h"
	.sym	_OS_FLAGS, 0, 14, 13, 16
	.file	".\ucos_ii.h"
	.stag	_os_event, 704
	.member	_OSEventType, 0, 14, 8, 16
	.member	_OSEventGrp, 16, 14, 8, 16
	.member	_OSEventCnt, 32, 14, 8, 16
	.member	_OSEventPtr, 48, 16, 8, 16
	.member	_OSEventTbl, 64, 62, 8, 128, , 8
	.member	_OSEventName, 192, 50, 8, 512, , 32
	.eos
	.sym	_OS_EVENT, 0, 8, 13, 704,_os_event
	.stag	_os_flag_node, 0
	.eos
	.sym	_OS_FLAG_NODE, 0, 8, 13, 0,_os_flag_node
	.stag	_os_sem_data, 160
	.member	_OSCnt, 0, 14, 8, 16
	.member	_OSEventTbl, 16, 62, 8, 128, , 8
	.member	_OSEventGrp, 144, 14, 8, 16
	.eos
	.sym	_OS_SEM_DATA, 0, 8, 13, 160,_os_sem_data
	.stag	_os_tcb, 1024
	.member	_OSTCBStkPtr, 0, 30, 8, 16
	.member	_OSTCBExtPtr, 16, 16, 8, 16
	.member	_OSTCBStkBottom, 32, 30, 8, 16
	.member	_OSTCBStkSize, 64, 15, 8, 32
	.member	_OSTCBOpt, 96, 14, 8, 16
	.member	_OSTCBId, 112, 14, 8, 16
	.member	_OSTCBNext, 128, 24, 8, 16, _os_tcb
	.member	_OSTCBPrev, 144, 24, 8, 16, _os_tcb
	.member	_OSTCBEventPtr, 160, 24, 8, 16, _os_event
	.member	_OSTCBMsg, 176, 16, 8, 16
	.member	_OSTCBFlagNode, 192, 24, 8, 16, _os_flag_node
	.member	_OSTCBFlagsRdy, 208, 14, 8, 16
	.member	_OSTCBDly, 224, 14, 8, 16
	.member	_OSTCBStat, 240, 14, 8, 16
	.member	_OSTCBPrio, 256, 14, 8, 16
	.member	_OSTCBX, 272, 14, 8, 16
	.member	_OSTCBY, 288, 14, 8, 16
	.member	_OSTCBBitX, 304, 14, 8, 16
	.member	_OSTCBBitY, 320, 14, 8, 16
	.member	_OSTCBDelReq, 336, 14, 8, 16
	.member	_OSTCBCtxSwCtr, 352, 15, 8, 32
	.member	_OSTCBCyclesTot, 384, 15, 8, 32
	.member	_OSTCBCyclesStart, 416, 15, 8, 32
	.member	_OSTCBStkBase, 448, 30, 8, 16
	.member	_OSTCBStkUsed, 480, 15, 8, 32
	.member	_OSTCBTaskName, 512, 50, 8, 512, , 32
	.eos
	.sym	_OS_TCB, 0, 8, 13, 1024,_os_tcb
	.file	"os_sem.c"
	.file	".\ucos_ii.h"
	.file	"os_sem.c"
	.sect	".text"
	.global	_OSSemAccept
	.sym	_OSSemAccept,_OSSemAccept, 46, 2, 0
	.func	39

;***************************************************************
;* FUNCTION DEF: _OSSemAccept                                  *
;***************************************************************
_OSSemAccept:
;* A     assigned to _pevent
	.sym	_pevent,0, 24, 17, 16, _os_event
	.sym	_pevent,0, 24, 1, 16, _os_event
	.sym	_cnt,1, 14, 1, 16
        PSHM      AR1
        FRAME     #-2
        NOP
	.line	2
        STL       A,*SP(0)              ; |40| 
	.line	10
        LD        *SP(0),A              ; |48| 
        BC        L1,ANEQ               ; |48| 
        ; branch occurs ; |48| 
	.line	11
        BD        L4                    ; |49| 
        NOP
        LD        #0,A                  ; |49| 
        ; branch occurs ; |49| 
L1:    
	.line	14
        MVDK      *SP(0),*(AR1)         ; |52| 
        CMPM      *AR1,#3               ; |52| 
        BC        L2,TC                 ; |52| 
        ; branch occurs ; |52| 
	.line	15
        BD        L4                    ; |53| 
        NOP
        LD        #0,A                  ; |53| 
        ; branch occurs ; |53| 
L2:    
	.line	17
 ssbx INTM
	.line	18
        LD        *AR1(2),A             ; |56| 
        STL       A,*SP(1)              ; |56| 
	.line	19
        LD        *SP(1),A              ; |57| 
        BC        L3,AEQ                ; |57| 
        ; branch occurs ; |57| 
	.line	20
        ADDM      #-1,*AR1(2)           ; |58| 
L3:    
	.line	22
 rsbx INTM
	.line	23
        LD        *SP(1),A              ; |61| 
L4:    
	.line	24
        FRAME     #2                    ; |62| 
        POPM      AR1                   ; |62| 
        RET       ; |62| 
        ; return occurs ; |62| 
	.endfunc	62,000000400h,3


	.sect	".text"
	.global	_OSSemCreate
	.sym	_OSSemCreate,_OSSemCreate, 104, 2, 0, _os_event
	.func	83

;***************************************************************
;* FUNCTION DEF: _OSSemCreate                                  *
;***************************************************************
_OSSemCreate:
;* A     assigned to _cnt
	.sym	_cnt,0, 14, 17, 16
	.sym	_cnt,0, 14, 1, 16
	.sym	_pevent,1, 24, 1, 16, _os_event
        PSHM      AR1
        FRAME     #-2
        NOP
	.line	2
        STL       A,*SP(0)              ; |84| 
	.line	9
        LD        *(_OSIntNesting),A    ; |91| 
        BC        L5,AEQ                ; |91| 
        ; branch occurs ; |91| 
	.line	10
        BD        L8                    ; |92| 
        NOP
        LD        #0,A                  ; |92| 
        ; branch occurs ; |92| 
L5:    
	.line	12
 ssbx INTM
	.line	13
        MVKD      *(_OSEventFreeList),*SP(1) ; |95| 
	.line	14
        LD        *(_OSEventFreeList),A ; |96| 
        BC        L6,AEQ                ; |96| 
        ; branch occurs ; |96| 
	.line	15
        MVDM      *(_OSEventFreeList),AR1 ; |97| 
        NOP
        MVDK      *AR1(3),*(_OSEventFreeList) ; |97| 
L6:    
	.line	17
 rsbx INTM
	.line	18
        LD        *SP(1),A              ; |100| 
        BC        L7,AEQ                ; |100| 
        ; branch occurs ; |100| 
	.line	19
        MVDK      *SP(1),*(AR1)         ; |101| 
        ST        #3,*AR1               ; |101| 
	.line	20
        LD        *SP(0),A              ; |102| 
        MVDK      *SP(1),*(AR1)         ; |102| 
        STL       A,*AR1(2)             ; |102| 
	.line	21
        MVDK      *SP(1),*(AR1)         ; |103| 
        ST        #0,*AR1(3)            ; |103| 
	.line	23
        MVDK      *SP(1),*(AR1)         ; |105| 
        ST        #63,*AR1(12)          ; |105| 
	.line	24
        MVDK      *SP(1),*(AR1)         ; |106| 
        ST        #0,*AR1(13)           ; |106| 
	.line	26
        LD        *SP(1),A              ; |108| 
        CALL      #_OS_EventWaitListInit ; |108| 
        ; call occurs [#_OS_EventWaitListInit] ; |108| 
L7:    
	.line	28
        LD        *SP(1),A              ; |110| 
L8:    
	.line	29
        FRAME     #2                    ; |111| 
        POPM      AR1                   ; |111| 
        RET       ; |111| 
        ; return occurs ; |111| 
	.endfunc	111,000000400h,3


	.sect	".text"
	.global	_OSSemDel
	.sym	_OSSemDel,_OSSemDel, 104, 2, 0, _os_event
	.func	152

;***************************************************************
;* FUNCTION DEF: _OSSemDel                                     *
;***************************************************************
_OSSemDel:
;* A     assigned to _pevent
	.sym	_pevent,0, 24, 17, 16, _os_event
	.sym	_opt,6, 14, 9, 16
	.sym	_err,7, 30, 9, 16
	.sym	_pevent,2, 24, 1, 16, _os_event
	.sym	_tasks_waiting,3, 14, 1, 16
        PSHM      AR1
        FRAME     #-4
        NOP
	.line	2
        STL       A,*SP(2)              ; |153| 
	.line	9
        LD        *(_OSIntNesting),A    ; |160| 
        BC        L9,AEQ                ; |160| 
        ; branch occurs ; |160| 
	.line	10
        MVDK      *SP(7),*(AR1)         ; |161| 
        ST        #140,*AR1             ; |161| 
	.line	11
        BD        L21                   ; |162| 
        NOP
        LD        *SP(2),A              ; |162| 
        ; branch occurs ; |162| 
L9:    
	.line	14
        LD        *SP(2),A              ; |165| 
        BC        L10,ANEQ              ; |165| 
        ; branch occurs ; |165| 
	.line	15
        MVDK      *SP(7),*(AR1)         ; |166| 
        ST        #4,*AR1               ; |166| 
	.line	16
        BD        L21                   ; |167| 
        NOP
        LD        *SP(2),A              ; |167| 
        ; branch occurs ; |167| 
L10:    
	.line	19
        MVDK      *SP(2),*(AR1)         ; |170| 
        CMPM      *AR1,#3               ; |170| 
        BC        L11,TC                ; |170| 
        ; branch occurs ; |170| 
	.line	20
        MVDK      *SP(7),*(AR1)         ; |171| 
        ST        #1,*AR1               ; |171| 
	.line	21
        BD        L21                   ; |172| 
        NOP
        LD        *SP(2),A              ; |172| 
        ; branch occurs ; |172| 
L11:    
	.line	23
 ssbx INTM
	.line	24
        LD        *AR1(1),A             ; |175| 
        BC        L12,AEQ               ; |175| 
        ; branch occurs ; |175| 
	.line	25
        ST        #1,*SP(3)             ; |176| 
	.line	26
        B         L20                   ; |177| 
        ; branch occurs ; |177| 
L12:    
	.line	27
        ST        #0,*SP(3)             ; |178| 
	.line	29
        B         L20                   ; |180| 
        ; branch occurs ; |180| 
L13:    
	.line	31
        LD        *SP(3),A              ; |182| 
        BC        L14,ANEQ              ; |182| 
        ; branch occurs ; |182| 
	.line	33
        MVDK      *SP(2),*(AR1)         ; |184| 
        ST        #63,*AR1(12)          ; |184| 
	.line	34
        MVDK      *SP(2),*(AR1)         ; |185| 
        ST        #0,*AR1(13)           ; |185| 
	.line	36
        MVDK      *SP(2),*(AR1)         ; |187| 
        ST        #0,*AR1               ; |187| 
	.line	37
        MVDK      *SP(2),*(AR1)         ; |188| 
        MVKD      *(_OSEventFreeList),*AR1(3) ; |188| 
	.line	38
        MVDK      *SP(2),*(AR1)         ; |189| 
        ST        #0,*AR1(2)            ; |189| 
	.line	39
        MVDK      *SP(2),*(_OSEventFreeList) ; |190| 
	.line	40
 rsbx INTM
	.line	41
        MVDK      *SP(7),*(AR1)         ; |192| 
        ST        #0,*AR1               ; |192| 
	.line	42
        BD        L21                   ; |193| 
        NOP
        LD        #0,A                  ; |193| 
        ; branch occurs ; |193| 
	.line	43
L14:    
	.line	44
 rsbx INTM
	.line	45
        MVDK      *SP(7),*(AR1)         ; |196| 
        ST        #8,*AR1               ; |196| 
	.line	46
        BD        L21                   ; |197| 
        NOP
        LD        *SP(2),A              ; |197| 
        ; branch occurs ; |197| 
L15:    
	.line	50
        MVDK      *SP(2),*(AR1)         ; |201| 
        LD        *AR1(1),A             ; |201| 
        BC        L17,AEQ               ; |201| 
        ; branch occurs ; |201| 
L16:    
	.line	51
        ST        #0,*SP(0)             ; |202| 
        ST        #1,*SP(1)             ; |202| 
        LD        *SP(2),A              ; |202| 
        CALL      #_OS_EventTaskRdy     ; |202| 
        ; call occurs [#_OS_EventTaskRdy] ; |202| 
	.line	52
        MVDK      *SP(2),*(AR1)         ; |203| 
        LD        *AR1(1),A             ; |203| 
        BC        L16,ANEQ              ; |203| 
        ; branch occurs ; |203| 
L17:    
	.line	54
        MVDK      *SP(2),*(AR1)         ; |205| 
        ST        #63,*AR1(12)          ; |205| 
	.line	55
        MVDK      *SP(2),*(AR1)         ; |206| 
        ST        #0,*AR1(13)           ; |206| 
	.line	57
        MVDK      *SP(2),*(AR1)         ; |208| 
        ST        #0,*AR1               ; |208| 
	.line	58
        MVDK      *SP(2),*(AR1)         ; |209| 
        MVKD      *(_OSEventFreeList),*AR1(3) ; |209| 
	.line	59
        MVDK      *SP(2),*(AR1)         ; |210| 
        ST        #0,*AR1(2)            ; |210| 
	.line	60
        MVDK      *SP(2),*(_OSEventFreeList) ; |211| 
	.line	61
 rsbx INTM
	.line	62
        CMPM      *SP(3),#1             ; |213| 
        BC        L18,NTC               ; |213| 
        ; branch occurs ; |213| 
	.line	63
        CALL      #_OS_Sched            ; |214| 
        ; call occurs [#_OS_Sched] ; |214| 
L18:    
	.line	65
        MVDK      *SP(7),*(AR1)         ; |216| 
        ST        #0,*AR1               ; |216| 
	.line	66
        BD        L21                   ; |217| 
        NOP
        LD        #0,A                  ; |217| 
        ; branch occurs ; |217| 
L19:    
	.line	69
 rsbx INTM
	.line	70
        MVDK      *SP(7),*(AR1)         ; |221| 
        ST        #7,*AR1               ; |221| 
	.line	71

⌨️ 快捷键说明

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