亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? os_cpu_a.dbg

?? 飛思卡爾HCS12的OS移植(ucosII),實現了三個任務,IDE:CODEWARRIOR
?? DBG
字號:
;********************************************************************************************************
;                                               uC/OS-II
;                                         The Real-Time Kernel
;
;                         (c) Copyright 2002, Jean J. Labrosse, Weston, FL
;                                          All Rights Reserved
;
;
;                                          MC9S12 Specific Code
;                                        Freescale Serial Monitor         
;                                           Banked Memory Model     
;                                             Codewarrior 4.x 
;
; File         : OS_CPU_A.S
; By           : Eric Shufro
;
; Notes        : THIS FILE *MUST* BE LINKED INTO NON_BANKED MEMORY!
;********************************************************************************************************

NON_BANKED:       section  


;********************************************************************************************************
;                                           I/O PORT ADDRESSES
;********************************************************************************************************

PPAGE:            equ    $0030         ; Addres of PPAGE register (assuming MC9S12 (non XGATE part)


;********************************************************************************************************
;                                          PUBLIC DECLARATIONS
;********************************************************************************************************
   
    xdef   OS_CPU_SR_Save
    xdef   OS_CPU_SR_Restore    
    xdef   OSStartHighRdy
    xdef   OSCtxSw
    xdef   OSIntCtxSw
    xdef   OSTickISR
    
    
;********************************************************************************************************
;                                         EXTERNAL DECLARATIONS
;********************************************************************************************************
   
    xref   OSIntExit
    xref   OSIntNesting  
    xref   OSPrioCur    
    xref   OSPrioHighRdy
    xref   OSRunning   
    xref   OSTaskSwHook 
    xref   OSTCBCur     
    xref   OSTCBHighRdy 
    xref   OSTickISR_Handler 
    xref   OSTimeTick
    
    
;********************************************************************************************************
;                                  SAVE THE CCR AND DISABLE INTERRUPTS
;                                                  &
;                                              RESTORE CCR
;
; Description : These function implements OS_CRITICAL_METHOD #3 
;
; Arguments   : The function prototypes for the two functions are:
;               1) OS_CPU_SR  OSCPUSaveSR(void)
;                             where OS_CPU_SR is the contents of the CCR register prior to disabling
;                             interrupts.
;               2) void       OSCPURestoreSR(OS_CPU_SR os_cpu_sr);
;                             'os_cpu_sr' the the value of the CCR to restore.
;
; Note(s)     : 1) It's assumed that the compiler uses the D register to pass a single 16-bit argument
;                  to and from an assembly language function.
;********************************************************************************************************

OS_CPU_SR_Save:
    tfr  ccr,b                         ; It's assumed that 8-bit return value is in register B
    sei                                ; Disable interrupts
    rtc                                ; Return to caller with D containing the previous CCR

OS_CPU_SR_Restore:
    tfr  b,ccr                         ; B contains the CCR value to restore, move to CCR
    rtc


;********************************************************************************************************
;                               START HIGHEST PRIORITY TASK READY-TO-RUN
;
; Description : This function is called by OSStart() to start the highest priority task that was created
;               by your application before calling OSStart().
;
; Arguments   : none
;
; Note(s)     : 1) The stack frame is assumed to look as follows:
;   
;                  OSTCBHighRdy->OSTCBStkPtr +  0       PPAGE
;                                            +  1       CCR
;                                            +  2       B
;                                            +  3       A
;                                            +  4       X (H)
;                                            +  5       X (L)
;                                            +  6       Y (H)
;                                            +  7       Y (L)
;                                            +  8       PC(H)
;                                            +  9       PC(L)
;
;               2) OSStartHighRdy() MUST:
;                      a) Call OSTaskSwHook() then,
;                      b) Set OSRunning to TRUE,
;                      c) Switch to the highest priority task by loading the stack pointer of the
;                         highest priority task into the SP register and execute an RTI instruction.
;********************************************************************************************************

OSStartHighRdy:
    call   OSTaskSwHook                     ; Invoke user defined context switch hook            

    ldab   #$01                             ; Indicate that we are multitasking
    stab   OSRunning                        

    ldx    OSTCBHighRdy                     ; Point to TCB of highest priority task ready to run 
    lds    0,x                              ; Load SP into 68HC12

    pula                                    ; Get value of PPAGE register
    staa   PPAGE                            ; Store into CPU's PPAGE register  
    
    rti                                     ; Restore task context -> Run task  
    

;********************************************************************************************************
;                                       TASK LEVEL CONTEXT SWITCH
;
; Description : This function is called when a task makes a higher priority task ready-to-run. Generally
;               a software exception is used to push the task context on to the stack, however, the
;               Freescale Serial Monitor application requires use of the SWI instruction.  Therefore,
;               this function is called by the OS_TASK_SWITCH macro as a jump to sub routine which does
;               NOT automatically stack the CCR. 
;
; Arguments   : none
;
; Note(s)     : 1) Upon entry, 
;                  OSTCBCur     points to the OS_TCB of the task to suspend
;                  OSTCBHighRdy points to the OS_TCB of the task to resume
;                
;               2) The 'JSR' instruction issued by the OS_TASK_SWITCH macro 
;                  has pushed the PC register on to the stack. SR and PPAGE
;                  must be added to the stack, along with the other CPU
;                  registers in order to save the entire context of the
;                  preempted task.
;
;               3) The stack frame of the task to suspend looks as follows:
;
;                   -->  PUSH REMAINING 
;                        REGISTERS HERE.
;                        STACK GROWS TOWARD
;                        LOW MEMORY.
;
;                  SP +  0       PC(H)
;                     +  1       PC(L)
;
;               4) The stack frame of the task to resume looks as follows:
; 
;                  OSTCBHighRdy->OSTCBStkPtr +  0       PPAGE
;                                            +  1       CCR
;                                            +  2       B
;                                            +  3       A
;                                            +  4       X (H)
;                                            +  5       X (L)
;                                            +  6       Y (H)
;                                            +  7       Y (L)
;                                            +  8       PC(H)
;                                            +  9       PC(L)
;********************************************************************************************************

OSCtxSw:
    pshy                                    ; Manually push preempted task's context on to the stack
    pshx
    psha
    pshb    
    pshc
    
    ldaa   PPAGE                            ; Get current value of PPAGE register                                
    psha                                    ; Push PPAGE register onto current task's stack

    ldy    OSTCBCur                         ; OSTCBCur->OSTCBStkPtr = Stack Pointer     
    sts    0,y

    call   OSTaskSwHook                     ; Call user task switch hook                       
    
    ldx    OSTCBHighRdy                     ; OSTCBCur  = OSTCBHighRdy
    stx    OSTCBCur
    
    ldab   OSPrioHighRdy                    ; OSPrioCur = OSPrioHighRdy                        
    stab   OSPrioCur
    
    lds    0,x                              ; Load SP into MC9S12                              
    
    pula                                    ; Get value of PPAGE register
    staa   PPAGE                            ; Store into CPU's PPAGE register
    
    rti                                     ; Restore preempting task's context -> Run task
    

;********************************************************************************************************
;                                    INTERRUPT LEVEL CONTEXT SWITCH
;
; Description : This function is called by OSIntExit() to perform a context switch to a task that has
;               been made ready-to-run by an ISR. The PPAGE register of the preempted task has already 
;               been stacked during the start of the ISR that is currently running.
;
; Arguments   : none
;
; Note(s)     : 1) The preempted task's stack frame is assumed to look as follows:
;   
;                  OSTCBHighRdy->OSTCBStkPtr +  0       PPAGE      -----  Added by the start of the current ISR (ex: OSTickISR)
;                                            +  1       CCR        -.
;                                            +  2       B            `
;                                            +  3       A             |
;                                            +  4       X (H)         |
;                                            +  5       X (L)          -  Added by the ISR automatic context save.
;                                            +  6       Y (H)         |
;                                            +  7       Y (L)         .
;                                            +  8       PC(H)        ,
;                                            +  9       PC(L)      -'
;
;               2) The stack frame of the task to resume looks as follows:
; 
;                  OSTCBHighRdy->OSTCBStkPtr +  0       PPAGE
;                                            +  1       CCR
;                                            +  2       B
;                                            +  3       A
;                                            +  4       X (H)
;                                            +  5       X (L)
;                                            +  6       Y (H)
;                                            +  7       Y (L)
;                                            +  8       PC(H)
;                                            +  9       PC(L)
;********************************************************************************************************

OSIntCtxSw:
    call   OSTaskSwHook                     ; Call user task switch hook                
    
    ldx    OSTCBHighRdy                     ; OSTCBCur  = OSTCBHighRdy
    stx    OSTCBCur
    
    ldab   OSPrioHighRdy                    ; OSPrioCur = OSPrioHighRdy                        
    stab   OSPrioCur
    
    lds    0,x                              ; Load the SP of the next task
    
    pula                                    ; Get value of PPAGE register
    staa   PPAGE                            ; Store into CPU's PPAGE register                                
    
    rti                                     ; Restore preempting task's context -> Run task                           
    

;********************************************************************************************************
;                                           SYSTEM TICK ISR
;
; Description : This function is the ISR used to notify uC/OS-II that a system tick has occurred.  You 
;               must setup the S12XE's interrupt vector table so that an OUTPUT COMPARE interrupt 
;               vectors to this function.
;
; Arguments   : none
;
; Notes       :  1) The 'tick ISR' assumes the we are using the Output Compare specified by OS_TICK_OC
;                   (see APP_CFG.H and this file) to generate a tick that occurs every OS_TICK_OC_CNTS 
;                   (see APP_CFG.H) which corresponds to the number of FRT (Free Running Timer) 
;                   counts to the next interrupt.
;
;                2) All USER interrupts should be modeled EXACTLY like this where the only
;                   line to be modified is the call to your ISR_Handler and perhaps the call to
;                   the label name OSTickISR1.
;********************************************************************************************************

OSTickISR:
    ldaa   PPAGE                            ; Get current value of PPAGE register                                
    psha                                    ; Push PPAGE register onto current task's stack

    inc    OSIntNesting                     ; Notify uC/OS-II about ISR

    ldab   OSIntNesting                     ; if (OSIntNesting == 1) {    
    cmpb   #$01
    bne    OSTickISR1

    ldy    OSTCBCur                         ;     OSTCBCur->OSTCBStkPtr = Stack Pointer     
    sts    0,y                              ; }                                          

OSTickISR1:
    call   OSTickISR_Handler

;   cli                                     ; Enable interrupts to allow interrupt nesting
       
    call   OSIntExit                        ; Notify uC/OS-II about end of ISR, OSIntCtxSw() possible. 
    
    pula                                    ; Get value of PPAGE register
    staa   PPAGE                            ; Store into CPU's PPAGE register                                
        
    rti                                     ; Return from interrupt, no higher priority tasks ready (no context switch)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人av电影免费在线观看| 亚洲国产成人自拍| youjizz久久| 国产成人在线视频免费播放| 丝袜亚洲另类欧美| 青青草97国产精品免费观看 | 一区二区在线观看av| 中文字幕一区二区三区精华液| 国产精品伦一区| 国产精品蜜臀在线观看| 日本一区二区成人| 久久久久高清精品| 欧美国产成人精品| 亚洲天堂福利av| 亚洲18影院在线观看| 三级久久三级久久久| 日本aⅴ免费视频一区二区三区| 欧美aⅴ一区二区三区视频| 九九九久久久精品| 国产一区二区三区蝌蚪| 国产盗摄一区二区三区| 99国产欧美久久久精品| 欧美特级限制片免费在线观看| 欧美精品777| 国产日韩精品一区二区三区 | 欧美亚洲日本国产| 欧美一区二视频| 国产亚洲综合色| 亚洲精品菠萝久久久久久久| 日韩精品电影在线| 成人精品亚洲人成在线| 日本高清视频一区二区| 日韩精品一区二区三区视频播放| 国产精品欧美极品| 日本不卡视频在线| 北条麻妃一区二区三区| 在线电影欧美成精品| 国产欧美日韩精品a在线观看| 一区二区三区中文字幕电影| 奇米综合一区二区三区精品视频| 成人黄色av网站在线| 欧美伊人久久久久久久久影院| 欧美久久婷婷综合色| 国产精品欧美一级免费| 肉肉av福利一精品导航| 岛国av在线一区| 欧美一区二区免费视频| 国产精品久久三区| 老色鬼精品视频在线观看播放| 日本久久一区二区三区| 欧美成人一区二区三区在线观看| 国产精品久久久久影院亚瑟| 久久av资源网| 欧美日本一区二区三区四区| 中文字幕一区二区三区在线不卡| 婷婷久久综合九色国产成人| 91一区一区三区| 国产欧美一区二区三区网站| 日韩av在线发布| 欧美亚洲国产bt| 综合久久久久久| 国产99精品视频| 精品成人在线观看| 蜜桃一区二区三区在线| 欧美日韩国产美| 久久久久亚洲蜜桃| 精品影视av免费| 日韩欧美亚洲另类制服综合在线| 一个色综合av| 欧美三级乱人伦电影| 亚洲免费观看高清| 日本高清成人免费播放| 日韩理论片一区二区| av电影在线观看一区| 中文字幕一区二区视频| 99这里都是精品| 中文字幕一区二区三区在线不卡 | 中文字幕不卡的av| 国产激情一区二区三区四区| 久久精品水蜜桃av综合天堂| 国内成人自拍视频| 久久久久久日产精品| 久久草av在线| 中文字幕不卡三区| 色悠悠久久综合| 一区二区在线免费观看| 欧美色爱综合网| 日本vs亚洲vs韩国一区三区二区 | 一本久久a久久免费精品不卡| 91在线观看下载| 中文久久乱码一区二区| 国产1区2区3区精品美女| 国产精品久久久久7777按摩| 97精品久久久午夜一区二区三区| 亚洲欧美日韩国产综合在线| 欧美日韩精品一区二区在线播放| 秋霞影院一区二区| 日韩精品专区在线影院观看| 国产成人综合视频| 亚洲影视在线观看| 精品国产一二三| 99久免费精品视频在线观看 | 一本色道亚洲精品aⅴ| 亚洲一区在线免费观看| 精品国产伦一区二区三区观看方式| 国产成人精品aa毛片| 悠悠色在线精品| 日韩欧美一区二区免费| 成人黄色av电影| 图片区日韩欧美亚洲| 国产欧美精品在线观看| 欧美日本不卡视频| 国产电影一区二区三区| 五月天欧美精品| 国产精品久久久久影院老司| 在线成人高清不卡| 99re这里只有精品视频首页| 蜜臀精品一区二区三区在线观看| 国产精品久久久久久久久动漫 | 麻豆一区二区在线| 亚洲色图欧洲色图婷婷| 精品国产三级电影在线观看| 99精品桃花视频在线观看| 美国一区二区三区在线播放| 国产精品国产三级国产aⅴ中文| 欧美一区二区精品在线| 91女厕偷拍女厕偷拍高清| 老司机免费视频一区二区三区| 亚洲黄色性网站| 中国色在线观看另类| 欧美大片在线观看一区| 欧美日韩国产成人在线91| aaa亚洲精品一二三区| 精品一区二区三区欧美| 亚洲大片免费看| 亚洲美女免费在线| 国产精品麻豆久久久| 久久久久高清精品| 欧美日韩国产大片| 91免费在线视频观看| 不卡av在线免费观看| 国产精品77777竹菊影视小说| 美女爽到高潮91| 婷婷久久综合九色综合伊人色| 一区二区三区成人| 国产精品久久久久久久久免费桃花 | 色综合一个色综合亚洲| 成人激情午夜影院| 成人激情午夜影院| 99久久久精品免费观看国产蜜| 国产91在线看| 成人自拍视频在线观看| 成人激情免费网站| 成人一级片在线观看| 国产成人精品在线看| 国产在线不卡一区| 成人丝袜视频网| 成人福利在线看| www.亚洲激情.com| 国产一区二区三区电影在线观看| 中文字幕日本乱码精品影院| 中文字幕一区在线观看视频| 中日韩av电影| 日韩理论片在线| 亚洲妇女屁股眼交7| 免费观看在线色综合| 国产麻豆91精品| 91在线观看高清| 欧美伊人精品成人久久综合97| 欧美日韩高清一区| 久久亚洲精品国产精品紫薇| 中文字幕免费一区| 亚洲欧美日韩久久精品| 亚洲成人精品在线观看| 狠狠色丁香婷婷综合| 不卡免费追剧大全电视剧网站| 91久久线看在观草草青青| 欧美美女视频在线观看| 久久久一区二区三区捆绑**| 亚洲欧美视频在线观看视频| 日韩精品亚洲一区二区三区免费| 国内精品国产成人| 91国偷自产一区二区开放时间| 欧美在线一区二区三区| 久久在线免费观看| 亚洲黄色免费网站| 国内精品视频一区二区三区八戒| 97久久超碰精品国产| 欧美大度的电影原声| 亚洲男帅同性gay1069| 久久电影国产免费久久电影| 9i在线看片成人免费| 日韩一区二区中文字幕| 亚洲男人的天堂av| 国产一区二区精品久久99| 91成人在线观看喷潮| 国产亚洲精品资源在线26u| 亚洲高清一区二区三区| www.成人网.com| 久久精品免视看|