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

📄 os_cpu_c.ls1

📁 UCOS在51上的移植,绝对经典!可以较少开发人员的工作量
💻 LS1
📖 第 1 页 / 共 2 页
字号:
                     210     ; void  OSInitHookEnd (void) LG_REENTRANT
                     211     
----                 212             RSEG  ?PR?_?OSInitHookEnd?OS_CPU_C
0000                 213     _?OSInitHookEnd:
                     214                             ; SOURCE LINE # 56
                     215     ; {
                     216     ; }
                     217                             ; SOURCE LINE # 58
0000 22              218             RET     
                     219     ; END OF _?OSInitHookEnd
                     220     
                     221     ; #endif
                     222     ; 
                     223     ; /*$PAGE*/
                     224     ; /*
                     225     ; *****************************************************************************************
                             ****************
                     226     ; *                                          TASK CREATION HOOK
                     227     ; *
                     228     ; * Description: This function is called when a task is created.
                     229     ; *
                     230     ; * Arguments  : ptcb   is a pointer to the task control block of the task being created.
                     231     ; *
                     232     ; * Note(s)    : 1) Interrupts are disabled during this call.
                     233     ; *****************************************************************************************
                             ****************
                     234     ; */
                     235     ; #if OS_CPU_HOOKS_EN > 0 
                     236     ; void  OSTaskCreateHook (OS_TCB *ptcb) LG_REENTRANT
                     237     
----                 238             RSEG  ?PR?_?OSTaskCreateHook?OS_CPU_C
0000                 239     _?OSTaskCreateHook:
                     240             USING   0
                     241                             ; SOURCE LINE # 74
0000 90FFFD          242             MOV     DPTR,#0FFFDH
0003 120000   F      243             LCALL   ?C?ADDXBP
0006 120000   F      244             LCALL   ?C?PSTXDATA
                     245     ; {
                     246     ;     ptcb = ptcb;                       /* Prevent compiler warning                       
A51 MACRO ASSEMBLER  OS_CPU_C                                                             05/17/2005 11:20:03 PAGE     5

                                           */
                     247                             ; SOURCE LINE # 76
0009 850083   F      248             MOV     DPH,?C_XBP
000C 850082   F      249             MOV     DPL,?C_XBP+01H
000F 120000   F      250             LCALL   ?C?PLDXDATA
0012 850083   F      251             MOV     DPH,?C_XBP
0015 850082   F      252             MOV     DPL,?C_XBP+01H
0018 120000   F      253             LCALL   ?C?PSTXDATA
                     254     ; }
                     255                             ; SOURCE LINE # 77
001B 900003          256             MOV     DPTR,#03H
001E 020000   F      257             LJMP    ?C?ADDXBP
                     258     ; END OF _?OSTaskCreateHook
                     259     
                     260     ; #endif
                     261     ; 
                     262     ; 
                     263     ; /*
                     264     ; *****************************************************************************************
                             ****************
                     265     ; *                                           TASK DELETION HOOK
                     266     ; *
                     267     ; * Description: This function is called when a task is deleted.
                     268     ; *
                     269     ; * Arguments  : ptcb   is a pointer to the task control block of the task being deleted.
                     270     ; *
                     271     ; * Note(s)    : 1) Interrupts are disabled during this call.
                     272     ; *****************************************************************************************
                             ****************
                     273     ; */
                     274     ; #if OS_CPU_HOOKS_EN > 0 
                     275     ; void  OSTaskDelHook (OS_TCB *ptcb) LG_REENTRANT
                     276     
----                 277             RSEG  ?PR?_?OSTaskDelHook?OS_CPU_C
0000                 278     _?OSTaskDelHook:
                     279             USING   0
                     280                             ; SOURCE LINE # 93
0000 90FFFD          281             MOV     DPTR,#0FFFDH
0003 120000   F      282             LCALL   ?C?ADDXBP
0006 120000   F      283             LCALL   ?C?PSTXDATA
                     284     ; {
                     285     ;     ptcb = ptcb;                       /* Prevent compiler warning                       
                                           */
                     286                             ; SOURCE LINE # 95
0009 850083   F      287             MOV     DPH,?C_XBP
000C 850082   F      288             MOV     DPL,?C_XBP+01H
000F 120000   F      289             LCALL   ?C?PLDXDATA
0012 850083   F      290             MOV     DPH,?C_XBP
0015 850082   F      291             MOV     DPL,?C_XBP+01H
0018 120000   F      292             LCALL   ?C?PSTXDATA
                     293     ; }
                     294                             ; SOURCE LINE # 96
001B 900003          295             MOV     DPTR,#03H
001E 020000   F      296             LJMP    ?C?ADDXBP
                     297     ; END OF _?OSTaskDelHook
                     298     
                     299     ; #endif
                     300     ; 
                     301     ; /*
                     302     ; *****************************************************************************************
                             ****************
                     303     ; *                                             IDLE TASK HOOK
                     304     ; *
                     305     ; * Description: This function is called by the idle task.  This hook has been added to all
                             ow you to do  
                     306     ; *              such things as STOP the CPU to conserve power.
A51 MACRO ASSEMBLER  OS_CPU_C                                                             05/17/2005 11:20:03 PAGE     6

                     307     ; *
                     308     ; * Arguments  : none
                     309     ; *
                     310     ; * Note(s)    : 1) Interrupts are enabled during this call.
                     311     ; *****************************************************************************************
                             ****************
                     312     ; */
                     313     ; #if OS_CPU_HOOKS_EN > 0 && OS_VERSION >= 251
                     314     ; void  OSTaskIdleHook (void) LG_REENTRANT
                     315     
----                 316             RSEG  ?PR?_?OSTaskIdleHook?OS_CPU_C
0000                 317     _?OSTaskIdleHook:
                     318                             ; SOURCE LINE # 112
                     319     ; {
                     320     ;       if(P1_0==0)P1_0=1;else P1_0=0;
                     321                             ; SOURCE LINE # 114
0000 209004          322             JB      P1_0,?C0005
0003 D290            323             SETB    P1_0
0005 8002            324             SJMP    ?C0006
0007                 325     ?C0005:
0007 C290            326             CLR     P1_0
0009                 327     ?C0006:
                     328     ;       SBUF='i';while(TI==0);TI=0;
                     329                             ; SOURCE LINE # 115
0009 759969          330             MOV     SBUF,#069H
000C                 331     ?C0007:
000C 3099FD          332             JNB     TI,?C0007
000F                 333     ?C0008:
000F C299            334             CLR     TI
                     335     ; 
                     336     ; }
                     337                             ; SOURCE LINE # 117
0011 22              338             RET     
                     339     ; END OF _?OSTaskIdleHook
                     340     
                     341     ; #endif
                     342     ; 
                     343     ; /*
                     344     ; *****************************************************************************************
                             ****************
                     345     ; *                                           STATISTIC TASK HOOK
                     346     ; *
                     347     ; * Description: This function is called every second by uC/OS-II's statistics task.  This 
                             allows your 
                     348     ; *              application to add functionality to the statistics task.
                     349     ; *
                     350     ; * Arguments  : none
                     351     ; *****************************************************************************************
                             ****************
                     352     ; */
                     353     ; 
                     354     ; #if OS_CPU_HOOKS_EN > 0 
                     355     ; void  OSTaskStatHook (void) LG_REENTRANT
                     356     
----                 357             RSEG  ?PR?_?OSTaskStatHook?OS_CPU_C
0000                 358     _?OSTaskStatHook:
                     359                             ; SOURCE LINE # 132
                     360     ; {
                     361     ; }
                     362                             ; SOURCE LINE # 134
0000 22              363             RET     
                     364     ; END OF _?OSTaskStatHook
                     365     
                     366     ; #endif
                     367     ; 
                     368     ; /*$PAGE*/
A51 MACRO ASSEMBLER  OS_CPU_C                                                             05/17/2005 11:20:03 PAGE     7

                     369     ; /*
                     370     ; *****************************************************************************************
                             ****************
                     371     ; *                                        INITIALIZE A TASK'S STACK
                     372     ; *
                     373     ; * Description: This function is called by either OSTaskCreate() or OSTaskCreateExt() to i
                             nitialize the
                     374     ; *              stack frame of the task being created.  This function is highly processor 
                             specific.
                     375     ; *
                     376     ; * Arguments  : task          is a pointer to the task code
                     377     ; *
                     378     ; *              os_pdata         is a pointer to a user supplied data area that will be pa
                             ssed to the task
                     379     ; *                            when the task first executes.
                     380     ; *
                     381     ; *              ptos          is a pointer to the top of stack.  It is assumed that 'ptos'
                              points to
                     382     ; *                            a 'free' entry on the task stack.  If OS_STK_GROWTH is set t
                             o 1 then 
                     383     ; *                            'ptos' will contain the HIGHEST valid address of the stack. 
                              Similarly, if
                     384     ; *                            OS_STK_GROWTH is set to 0, the 'ptos' will contains the LOWE
                             ST valid address
                     385     ; *                            of the stack.
                     386     ; *
                     387     ; *              opt           specifies options that can be used to alter the behavior of 
                             OSTaskStkInit().
                     388     ; *                            (see uCOS_II.H for OS_TASK_OPT_???).
                     389     ; *
                     390     ; * Returns    : Always returns the location of the new top-of-stack' once the processor re
                             gisters have
                     391     ; *              been placed on the stack in the proper order.
                     392     ; *
                     393     ; * Note(s)    : Interrupts are enabled when your task starts executing. You can change thi
                             s by setting the
                     394     ; *              PSW to 0x0002 instead.  In this case, interrupts would be disabled upon ta
                             sk startup.  The
                     395     ; *              application code would be responsible for enabling interrupts at the begin
                             ning of the task
                     396     ; *              code.  You will need to modify OSTaskIdle() and OSTaskStat() so that they 
                             enable 
                     397     ; *              interrupts.  Failure to do this will make your system crash!
                     398     ; *****************************************************************************************
                             ****************
                     399     ; */
                     400     ; /*
                     401     ; at89c55wd PDL(sp form LOW to HIGH):          (堆栈指针所指的栈顶数据为有效数据)
                     402     ;                                                       装入堆栈指针ptos到stk
                     403     ;                                       
                     404     ;                               stk-->          入栈:task底\高                            
                                          (高内存)
                     405     ;                               入      ||              入栈:ACC
                     406     ;                               栈      ||              入栈:B
                     407     ;                               顺      ||              入栈:DPH               //暂时忽略

⌨️ 快捷键说明

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