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

📄 test.lst

📁 Keil UV3中自带操作系统ARTX的应用例程
💻 LST
字号:
ARM COMPILER V2.42,  test                                                                  20/02/06  16:27:39  PAGE 1   


ARM COMPILER V2.42, COMPILATION OF MODULE test
OBJECT MODULE PLACED IN test.OBJ
COMPILER INVOKED BY: d:\Keil\ARM\BIN\CA.exe test.c THUMB DEBUG TABS(4) 

stmt  level    source

    1          /*----------------------------------------------------------------------------
    2           *      A R T X   K e r n e l   E x a m p l e
    3           *----------------------------------------------------------------------------
    4           *      Name:    ARTX_EX1.C
    5           *      Purpose: Your First Advanced RTX example program
    6           *      Rev.:    V2.00 / 19-oct-2005
    7           *----------------------------------------------------------------------------
    8           *      This code is part of the ARTX-ARM kernel package of Keil Software.
    9           *      Copyright (c) 2004-2005 Keil Software. All rights reserved. 
   10           *---------------------------------------------------------------------------*/
   11          
   12          #include <ARTX.h>                      /* ARTX kernel functions & defines    */
   13          #include <AT91SAM7S64.h> 
   14          /* id1, id2 will contain task identifications at run-time */
   15          OS_TID t_light_on,t_light_off;
   16          
   17          unsigned int i;
   18          
   19          /* Forward reference */
   20          //void init (void) __task;
   21          void light_on (void) __task;
   22          void light_off (void) __task;
   23          
   24          
   25          void init (void) __task 
   26          {
   27   1          *AT91C_PMC_PCER=0x0000000F;     //PMC外设时钟使能
   28   1          *AT91C_PIOA_PER=0x0000000F;     //PIOA0-3作为I/O使用
   29   1          *AT91C_PIOA_OER=0x0000000F;     //PIOA0-3输出使能
   30   1          
   31   1          t_light_on   = os_tsk_create (light_on,  0); /* start clock task                 */
   32   1          //亮灯的任务                                   /* start command task               */
   33   1         // t_light_off   = os_tsk_create (light_off,  0);
   34   1        t_light_off  = os_tsk_create (light_off, 0); /* start lights task               */
   35   1          //熄灯的任务
   36   1          os_tsk_delete_self ();               /* stop init task (no longer needed)  */
   37   1         //初始化任务执行完后就把它删除
   38   1      }
   39          
   40          
   41          
   42          /*----------------------------------------------------------------------------
   43           *   Task 1:  ARTX Kernel starts this task with os_sys_init (task1)
   44           *---------------------------------------------------------------------------*/
   45          void light_on (void) __task {
   46   1        /* Obtain own system task identification number */
   47   1        //t_light_on = os_tsk_self ();
   48   1        /* Assign system identification number of task2 to id2 */
   49   1        //id2 = os_tsk_create (task2, 1);
   50   1        for (;;) 
   51   1        {   
   52   2        if(i<15) i++;
   53   2        else i=0;
   54   2        *AT91C_PIOA_SODR=i;     //点亮对应的LED
   55   2          /* Wait now for 50 ms */
   56   2          os_dly_wait (50);
   57   2        }
   58   1      }
   59          
ARM COMPILER V2.42,  test                                                                  20/02/06  16:27:39  PAGE 2   

   60          /*----------------------------------------------------------------------------
   61           *   Task 2:  ARTX Kernel starts this task with os_tsk_create (task2, 1)
   62           *---------------------------------------------------------------------------*/
   63          void light_off (void) __task {
   64   1        for (;;) 
   65   1        {   
   66   2        //if(i<15) i++;
   67   2       // else i=0;
   68   2        *AT91C_PIOA_CODR=i;     //熄灭对应的LED
   69   2          /* Wait now for 50 ms */
   70   2          os_dly_wait (50);
   71   2        }
   72   1      }
   73          
   74          /*----------------------------------------------------------------------------
   75           *        Main: Initialize and start ARTX Kernel
   76           *---------------------------------------------------------------------------*/
   77          void main (void) 
   78          {
   79   1      
   80   1        os_sys_init (init);   //从最开始的init任务开始
   81   1      }
   82          
   83          /*----------------------------------------------------------------------------
   84           * end of file
   85           *---------------------------------------------------------------------------*/
   86          
ARM COMPILER V2.42,  test                                                                  20/02/06  16:27:39  PAGE 3   

ASSEMBLY LISTING OF GENERATED OBJECT CODE



*** EXTERNALS:
 EXTERN CODE16 (os_tsk_create_user?T)
 EXTERN CODE16 (os_sys_init_user?T)
 EXTERN CODE16 (os_tsk_delete?T)
 EXTERN CODE16 (os_dly_wait?T)
 EXTERN NUMBER (__startup)



*** PUBLICS:
 PUBLIC         light_on?T
 PUBLIC         light_off?T
 PUBLIC         init?T
 PUBLIC         main
 PUBLIC         t_light_on
 PUBLIC         t_light_off
 PUBLIC         i



*** DATA SEGMENT '?DT0?test':
 00000000          t_light_on:
 00000000            DS          4
 00000004          t_light_off:
 00000004            DS          4
 00000008          i:
 00000008            DS          4



*** CODE SEGMENT '?PR?init?T?test':
   27:      *AT91C_PMC_PCER=0x0000000F;        //PMC外设时钟使能
 00000000  210F      MOV         R1,#0xF
 00000002  4800      LDR         R0,=0xFFFFFC10
 00000004  6001      STR         R1,[R0,#0x0]
   28:     *AT91C_PIOA_PER=0x0000000F;     //PIOA0-3作为I/O使用
 00000006  4800      LDR         R0,=0xFFFFF400
 00000008  6001      STR         R1,[R0,#0x0]
   29:     *AT91C_PIOA_OER=0x0000000F;     //PIOA0-3输出使能
 0000000A  4800      LDR         R0,=0xFFFFF410
 0000000C  6001      STR         R1,[R0,#0x0]
   31:     t_light_on   = os_tsk_create (light_on,  0); /* start clock task                 */
 0000000E  4800      LDR         R0,=light_on?T ; light_on?T
 00000010  2200      MOV         R2,#0x0
 00000012  2300      MOV         R3,#0x0
 00000014  1C19      MOV         R1,R3
 00000016  F7FF      BL          os_tsk_create_user?T  ; T=0x0001  (1)
 00000018  FFF3      BL          os_tsk_create_user?T  ; T=0x0001  (2)
 0000001A  4800      LDR         R1,=t_light_on ; t_light_on
 0000001C  6008      STR         R0,[R1,#0x0] ; t_light_on
   34:   t_light_off  = os_tsk_create (light_off, 0); /* start lights task               */
 0000001E  4800      LDR         R0,=light_off?T ; light_off?T
 00000020  2200      MOV         R2,#0x0
 00000022  2300      MOV         R3,#0x0
 00000024  1C19      MOV         R1,R3
 00000026  F7FF      BL          os_tsk_create_user?T  ; T=0x0001  (1)
 00000028  FFEB      BL          os_tsk_create_user?T  ; T=0x0001  (2)
 0000002A  4800      LDR         R1,=t_light_off ; t_light_off
 0000002C  6008      STR         R0,[R1,#0x0] ; t_light_off
   36:     os_tsk_delete_self ();               /* stop init task (no longer needed)  */
 0000002E  2000      MOV         R0,#0x0
 00000030  F7FF      BL          os_tsk_delete?T  ; T=0x0001  (1)
 00000032  FFE6      BL          os_tsk_delete?T  ; T=0x0001  (2)
   38: }
 00000034          ENDP ; 'init?T'


*** CODE SEGMENT '?PR?light_on?T?test':
   50:   for (;;) 
 00000000          L_4:
   52:   if(i<15) i++;
ARM COMPILER V2.42,  test                                                                  20/02/06  16:27:39  PAGE 4   

 00000000  4800      LDR         R0,=i ; i
 00000002  6801      LDR         R1,[R0,#0x0] ; i
 00000004  290F      CMP         R1,#0xF
 00000006  D203      BCS         L_6  ; T=0x00000010
 00000008  4800      LDR         R0,=i ; i
 0000000A  3101      ADD         R1,#0x1
 0000000C  6001      STR         R1,[R0,#0x0] ; i
 0000000E  E002      B           L_7  ; T=0x00000016
 00000010          L_6:
   53:   else i=0;
 00000010  2100      MOV         R1,#0x0
 00000012  4800      LDR         R0,=i ; i
 00000014  6001      STR         R1,[R0,#0x0] ; i
 00000016          L_7:
   54:   *AT91C_PIOA_SODR=i;     //点亮对应的LED
 00000016  4800      LDR         R0,=i ; i
 00000018  6801      LDR         R1,[R0,#0x0] ; i
 0000001A  4800      LDR         R0,=0xFFFFF430
 0000001C  6001      STR         R1,[R0,#0x0]
   56:     os_dly_wait (50);
 0000001E  2032      MOV         R0,#0x32
 00000020  F7FF      BL          os_dly_wait?T  ; T=0x0001  (1)
 00000022  FFEE      BL          os_dly_wait?T  ; T=0x0001  (2)
   57:   }
 00000024  E7EC      B           L_4  ; T=0x00000000
   58: }
 00000026          ENDP ; 'light_on?T'


*** CODE SEGMENT '?PR?light_off?T?test':
   64:   for (;;) 
 00000000          L_11:
   68:   *AT91C_PIOA_CODR=i;     //熄灭对应的LED
 00000000  4800      LDR         R0,=i ; i
 00000002  6801      LDR         R1,[R0,#0x0] ; i
 00000004  4800      LDR         R0,=0xFFFFF434
 00000006  6001      STR         R1,[R0,#0x0]
   70:     os_dly_wait (50);
 00000008  2032      MOV         R0,#0x32
 0000000A  F7FF      BL          os_dly_wait?T  ; T=0x0001  (1)
 0000000C  FFF9      BL          os_dly_wait?T  ; T=0x0001  (2)
   71:   }
 0000000E  E7F7      B           L_11  ; T=0x00000000
   72: }
 00000010          ENDP ; 'light_off?T'


*** CODE SEGMENT '?PR?main?test':
   77: void main (void) 
 00000000  B500      PUSH        {LR}
   80:   os_sys_init (init);   //从最开始的init任务开始
 00000002  4800      LDR         R0,=init?T ; init?T
 00000004  2200      MOV         R2,#0x0
 00000006  2300      MOV         R3,#0x0
 00000008  1C19      MOV         R1,R3
 0000000A  F7FF      BL          os_sys_init_user?T  ; T=0x0001  (1)
 0000000C  FFF9      BL          os_sys_init_user?T  ; T=0x0001  (2)
   81: }
 0000000E  BC08      POP         {R3}
 00000010  4718      BX          R3
 00000012          ENDP ; 'main'



Module Information          Static
----------------------------------
  code size            =    ------
  data size            =        12
  const size           =    ------
End of Module Information.


ARM COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

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