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

📄 os_viewa.asm

📁 uCOS-View,与UCOS II配套使用
💻 ASM
字号:
;**********************************************************************************************
;                                           uC/OS-View
;
;                            (c) Copyright 2002, Micrium, Inc., WESTON, FL
;                                       All Rights Reserved
;
;
;                                     Intel 80x86 (Large Model)
;
; File : OS_VIEWa.ASM
; By   : Jean J. Labrosse
;**********************************************************************************************
;
;********************************************************************************************************
;                                    PUBLIC and EXTERNAL REFERENCES
;********************************************************************************************************

            PUBLIC _OSView_RxTxISR

            EXTRN  _OSIntExit:FAR
            EXTRN  _OSView_RxTxISRHandler:FAR

            EXTRN  _OSIntNesting:BYTE
            EXTRN  _OSTCBCur:DWORD

.MODEL      LARGE
.CODE
.186
            PAGE
;**********************************************************************************************
;*                                  uC/OS-View COM Rx/Tx
;*
;* Description: This function is invoked when a character is received/transmitted from/to the
;*              serial port.
;*
;* Arguments  : none
;*
;* Note(s)    : 1) Pseudo code:
;*
;*                 Save all registers
;*                 OSIntNesting++
;*                 if (OSIntNesting == 1) {
;*                     OSTCBCur->OSTCBStkPtr = SP
;*                 }
;*                 OSView_RxTxISRHandler();
;*                 OSIntExit();
;*                 Restore all registers
;*                 Return from interrupt;
;**********************************************************************************************
;
_OSView_RxTxISR  PROC   FAR
;
                 PUSHA                                  ; Save interrupted task's context
                 PUSH   ES
                 PUSH   DS
;
                 MOV    AX, SEG(_OSIntNesting)          ; Reload DS
                 MOV    DS, AX
                 INC    BYTE PTR DS:_OSIntNesting       ; Notify uC/OS-II of ISR
;
                 CMP    BYTE PTR DS:_OSIntNesting, 1    ; if (OSIntNesting == 1)
                 JNE    SHORT _OSView_RxTxISR1
                 MOV    AX, SEG(_OSTCBCur)              ;     Reload DS
                 MOV    DS, AX
                 LES    BX, DWORD PTR DS:_OSTCBCur      ;     OSTCBCur->OSTCBStkPtr = SS:SP
                 MOV    ES:[BX+2], SS
                 MOV    ES:[BX+0], SP
;
_OSView_RxTxISR1:
                 CALL   FAR PTR _OSView_RxTxISRHandler  ; Handle character received interrupt
;
                 CALL   FAR PTR _OSIntExit              ; Notify uC/OS-II of end of ISR
;
                 POP    DS                              ; Restore interrupted task's context
                 POP    ES
                 POPA
;
                 IRET                                   ; Return to interrupted task
;
_OSView_RxTxISR  ENDP
;
                 END

⌨️ 快捷键说明

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