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

📄 os_q.ls1

📁 uCOS-II_2.52在51上的移植程序
💻 LS1
📖 第 1 页 / 共 5 页
字号:
A51 MACRO ASSEMBLER  OS_Q                                                                 08/08/2005 11:36:51 PAGE     1


MACRO ASSEMBLER A51 V7.10
OBJECT MODULE PLACED IN OS_Q.OBJ
ASSEMBLER INVOKED BY: C:\Keil\C51\BIN\A51.EXE OS_Q.src PR(.\OS_Q.ls1) EP DEBUG

LOC  OBJ            LINE     SOURCE

                       1     ; .\OS_Q.SRC generated from: OS_Q.C
                       2     ; COMPILER INVOKED BY:
                       3     ;        C:\Keil\C51\BIN\C51.EXE OS_Q.C LARGE BROWSE ORDER NOAREGS DEBUG OBJECTEXTEND SRC(.
                             \OS_Q.SRC)
                       4     
                       5     $nomod51 
                       6     
                       7     NAME    OS_Q
                       8     
  0080                 9     P0      DATA    080H
  0090                10     P1      DATA    090H
  00A0                11     P2      DATA    0A0H
  00B0                12     P3      DATA    0B0H
  00D0                13     PSW     DATA    0D0H
  00E0                14     ACC     DATA    0E0H
  00F0                15     B       DATA    0F0H
  0081                16     SP      DATA    081H
  0082                17     DPL     DATA    082H
  0083                18     DPH     DATA    083H
  0087                19     PCON    DATA    087H
  0088                20     TCON    DATA    088H
  0089                21     TMOD    DATA    089H
  008A                22     TL0     DATA    08AH
  008B                23     TL1     DATA    08BH
  008C                24     TH0     DATA    08CH
  008D                25     TH1     DATA    08DH
  00A8                26     IE      DATA    0A8H
  00B8                27     IP      DATA    0B8H
  0098                28     SCON    DATA    098H
  0099                29     SBUF    DATA    099H
  00D7                30     CY      BIT     0D0H.7
  00D6                31     AC      BIT     0D0H.6
  00D5                32     F0      BIT     0D0H.5
  00D4                33     RS1     BIT     0D0H.4
  00D3                34     RS0     BIT     0D0H.3
  00D2                35     OV      BIT     0D0H.2
  00D0                36     P       BIT     0D0H.0
  008F                37     TF1     BIT     088H.7
  008E                38     TR1     BIT     088H.6
  008D                39     TF0     BIT     088H.5
  008C                40     TR0     BIT     088H.4
  008B                41     IE1     BIT     088H.3
  008A                42     IT1     BIT     088H.2
  0089                43     IE0     BIT     088H.1
  0088                44     IT0     BIT     088H.0
  00AF                45     EA      BIT     0A8H.7
  00AC                46     ES      BIT     0A8H.4
  00AB                47     ET1     BIT     0A8H.3
  00AA                48     EX1     BIT     0A8H.2
  00A9                49     ET0     BIT     0A8H.1
  00A8                50     EX0     BIT     0A8H.0
  00BC                51     PS      BIT     0B8H.4
  00BB                52     PT1     BIT     0B8H.3
  00BA                53     PX1     BIT     0B8H.2
  00B9                54     PT0     BIT     0B8H.1
  00B8                55     PX0     BIT     0B8H.0
  00B7                56     RD      BIT     0B0H.7
  00B6                57     WR      BIT     0B0H.6
A51 MACRO ASSEMBLER  OS_Q                                                                 08/08/2005 11:36:51 PAGE     2

  00B5                58     T1      BIT     0B0H.5
  00B4                59     T0      BIT     0B0H.4
  00B3                60     INT1    BIT     0B0H.3
  00B2                61     INT0    BIT     0B0H.2
  00B1                62     TXD     BIT     0B0H.1
  00B0                63     RXD     BIT     0B0H.0
  009F                64     SM0     BIT     098H.7
  009E                65     SM1     BIT     098H.6
  009D                66     SM2     BIT     098H.5
  009C                67     REN     BIT     098H.4
  009B                68     TB8     BIT     098H.3
  009A                69     RB8     BIT     098H.2
  0099                70     TI      BIT     098H.1
  0098                71     RI      BIT     098H.0
                      72     ; /*
                      73     ; *****************************************************************************************
                             ****************
                      74     ; *                                                uC/OS-II
                      75     ; *                                          The Real-Time Kernel
                      76     ; *                                        MESSAGE QUEUE MANAGEMENT
                      77     ; *
                      78     ; *                          (c) Copyright 1992-2002, Jean J. Labrosse, Weston, FL
                      79     ; *                                           All Rights Reserved
                      80     ; *
                      81     ; * File : OS_Q.C
                      82     ; * By   : Jean J. Labrosse
                      83     ; *****************************************************************************************
                             ****************
                      84     ; */
                      85     ; 
                      86     ; #ifndef  OS_MASTER_FILE
                      87     ; #include "includes.h"
                      88     ; #endif
                      89     ; 
                      90     ; #if (OS_Q_EN > 0) && (OS_MAX_QS > 0)
                      91     ; /*
                      92     ; *****************************************************************************************
                             ****************
                      93     ; *                                      ACCEPT MESSAGE FROM QUEUE
                      94     ; *
                      95     ; * Description: This function checks the queue to see if a message is available.  Unlike O
                             SQPend(),
                      96     ; *              OSQAccept() does not suspend the calling task if a message is not availabl
                             e.
                      97     ; *
                      98     ; * Arguments  : pevent        is a pointer to the event control block
                      99     ; *
                     100     ; * Returns    : != (void *)0  is the message in the queue if one is available.  The messag
                             e is removed
                     101     ; *                            from the so the next time OSQAccept() is called, the queue w
                             ill contain
                     102     ; *                            one less entry.
                     103     ; *              == (void *)0  if the queue is empty or,
                     104     ; *                            if 'pevent' is a NULL pointer or,
                     105     ; *                            if you passed an invalid event type
                     106     ; *****************************************************************************************
                             ****************
                     107     ; */
                     108     ; 
                     109     ; #if OS_Q_ACCEPT_EN > 0
                     110     ; void  *OSQAccept (OS_EVENT *pevent)
                     111     ; {
                     112     ; 
                     113     ;     void      *msg;
                     114     ;     OS_Q      *pq;
                     115     ; 
A51 MACRO ASSEMBLER  OS_Q                                                                 08/08/2005 11:36:51 PAGE     3

                     116     ; 
                     117     ; #if OS_ARG_CHK_EN > 0
                     118     ;     if (pevent == (OS_EVENT *)0) {               /* Validate 'pevent'                    
                                           */
                     119     ;         return ((void *)0);
                     120     ;     }
                     121     ;     if (pevent->OSEventType != OS_EVENT_TYPE_Q) {/* Validate event block type            
                                           */
                     122     ;         return ((void *)0);
                     123     ;     }
                     124     ; #endif
                     125     ;     OS_ENTER_CRITICAL();
                     126     ;     pq = (OS_Q *)pevent->OSEventPtr;             /* Point at queue control block         
                                           */
                     127     ;     if (pq->OSQEntries > 0) {                    /* See if any messages in the queue     
                                           */
                     128     ;         msg = *pq->OSQOut++;                     /* Yes, extract oldest message from the 
                             queue         */
                     129     ;         pq->OSQEntries--;                        /* Update the number of entries in the q
                             ueue          */
                     130     ;         if (pq->OSQOut == pq->OSQEnd) {          /* Wrap OUT pointer if we are at the end
                              of the queue */
                     131     ;             pq->OSQOut = pq->OSQStart;
                     132     ;         }
                     133     ;     } else {
                     134     ;         msg = (void *)0;                         /* Queue is empty                       
                                           */
                     135     ;     }
                     136     ;     OS_EXIT_CRITICAL();
                     137     ;     return (msg);                                /* Return message received (or NULL)    
                                           */
                     138     ; }
                     139     ; #endif
                     140     ; /*$PAGE*/
                     141     ; /*
                     142     ; *****************************************************************************************
                             ****************
                     143     ; *                                        CREATE A MESSAGE QUEUE
                     144     ; *
                     145     ; * Description: This function creates a message queue if free event control blocks are ava
                             ilable.
                     146     ; *
                     147     ; * Arguments  : start         is a pointer to the base address of the message queue storag
                             e area.  The
                     148     ; *                            storage area MUST be declared as an array of pointers to 'vo
                             id' as follows
                     149     ; *
                     150     ; *                            void *MessageStorage[size]
                     151     ; *
                     152     ; *              size          is the number of elements in the storage area
                     153     ; *
                     154     ; * Returns    : != (OS_EVENT *)0  is a pointer to the event control clock (OS_EVENT) assoc
                             iated with the
                     155     ; *                                created queue
                     156     ; *              == (OS_EVENT *)0  if no event control blocks were available or an error wa
                             s detected
                     157     ; *****************************************************************************************
                             ****************
                     158     ; */
                     159     ; 

⌨️ 快捷键说明

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