home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 1 / FFMCD01.bin / bbs / develop / mcx11.lha / MCX11 / SYSTEM.AS < prev    next >
Text File  |  1990-12-08  |  25KB  |  409 lines

  1. *SYSTEM.AS                                                                    *
  2. *******************************************************************************
  3. *                                                                             *
  4. *                          SYSTEM CONFIGURATION                               *
  5. *                                                                             *
  6. * This information must be entered by the user to define the configuration of *
  7. * the system. These equates are used to define the extents of the MCX11       *
  8. * system tables. THIS FILE MUST BE THE FILE NAMED IN THE ASSEMBLY COMMAND     *
  9. * LINE. It may be named anything the user wishes. Remember that AS11 names    *
  10. * S-Record object file after the first file name encountered in the assembly  *
  11. * command.                                                                    *
  12. *                                                                             *
  13. *******************************************************************************
  14. *                                                                             *
  15. *                             APPLICATION EQUATES                             *
  16. *    (These VALUES should be changed for your application where indicated)    *
  17. *                                                                             *
  18. *    DO NOT CHANGE THE SYMBOL NAMES BECAUSE THEY ARE USED THROUGHOUT MCX11    *
  19. *                                                                             *
  20. *******************************************************************************
  21.  
  22. *******************************************************************************
  23. *                      BASIC CONFIGURATION DATA EQUATES                       *
  24. *                 These should change for your application                    *
  25. *******************************************************************************
  26.  
  27. NTASKS  equ    5                   Number of tasks in system
  28. NQUEUES equ    2                   Number of queues in system
  29. NNAMSEM equ    8                   Number of named semaphores in system
  30. NTIMERS equ    3                   Number of timers in system
  31.  
  32. *******************************************************************************
  33. *                            SYSTEM MEMORY EQUATES                            *
  34. *                 These should change for your application                    *
  35. *******************************************************************************
  36.  
  37. MCXVAR  equ    $EF                 Base RAM address of MCX variables (17 bytes
  38. *                                   are needed. For example, $ef - $ff)
  39. MCX11   equ    $E000               Base ROM address for MCX11
  40. MCXTABL equ    MCXVAR-1            Base RAM address of MCX system tables
  41.  
  42. *******************************************************************************
  43. *                           CLOCK AND PRESET EQUATES                          *
  44. *                 These should change for your application                    *
  45. *******************************************************************************
  46.  
  47. TMSK2   equ    $1024
  48. TFLG2   equ    TMSK2+1
  49. PACTL   equ    TFLG2+1
  50. RTII    equ    $40                 RTI Interrupt enabled, prescale = 00
  51. RTR     equ    $02                 16.37 ms per TICK @ 8MHz
  52. RTIF    equ    $40
  53. TOCK    equ    3                   3 TICKs per TOCK (TOCK = 49.14 ms ~ 20 Hz)
  54.  
  55. *******************************************************************************
  56. *                              MCX11  EQUATES                                 *
  57. *                      (These should not be changed)                          *
  58. *******************************************************************************
  59.  
  60. TCBLEN  equ    5                   Length of a Task Control Block
  61. TIMRLEN equ    8                   Length of a Timer Block
  62. QHDRLEN equ    3                   Length of a Queue Header
  63.  
  64. *******************************************************************************
  65. *                            SYSTEM TABLE EQUATES                             *
  66. *                      (These should not be changed)                          *
  67. *******************************************************************************
  68.  
  69. NT      equ    NTIMERS*TIMRLEN
  70. TIMERS  equ    MCXTABL-NT          Base address of timer blocks
  71. NQ      equ    NQUEUES*QHDRLEN
  72. QHDRTBL equ    TIMERS-NQ           Base address of queue headers
  73. NQS     equ    NQUEUES*2 
  74. FLGTBL  equ    QHDRTBL-NNAMSEM-NTASKS-NQS  Base address of semaphores
  75. NTS     equ    NTASKS*TCBLEN
  76. STATLS  equ    FLGTBL-NTS-TCBLEN   Base address of Task Control Blocks (TCB)
  77. QBODBAS equ    STATLS-1            Last address of Queue Bodies
  78.  
  79. *******************************************************************************
  80. *                   TCB INITIALIZATION DATA BLOCK EQUATES                     *
  81. *                      (These should not be changed)                          *
  82. *******************************************************************************
  83.  
  84. INITST  equ    0                   Task STATE at system initialization
  85. STRTADR equ    1                   Task starting address
  86. RSTSP   equ    3                   Base address of task's stack
  87. TCBADDR equ    5                   Address of task's TCB
  88. TCBDATL equ    7                   Length of a TCB initialization data block
  89.  
  90. *******************************************************************************
  91. *                  QUEUE INITIALIZATION DATA BLOCK EQUATES                    *
  92. *                      (These should not be changed)                          *
  93. *******************************************************************************
  94.  
  95. WIDTH   equ    0                   Width of the queue entry
  96. DEPTH   equ    1                   Depth of queue (# of entries)
  97. QHADR   equ    2                   Queue Header address
  98. QADDR   equ    4                   Address of the Queue Body
  99. QUEDATL equ    6                   Length of a Queue initialization data block
  100.  
  101. *******************************************************************************
  102. *    MCX ESR equates                                                          *
  103. *******************************************************************************
  104.  
  105. .wait.   equ   1                   Wait for an event to occur
  106. .signal. equ   2                   Signal the occurence of an event
  107. .pend.   equ   3                   Set a semaphore to PENDing state
  108. .send.   equ   4                   Send a message to a task
  109. .sendw.  equ   5                   Send a message and wait for response
  110. .receive. equ   6                  Receive a message 
  111. .deque.  equ   7                   Dequeue an entery from a FIFO queue
  112. .enque.  equ   8                   Enqueue an entry into a FIFO queue
  113. .resume. equ   9                   Resume a suspended task
  114. .suspend. equ   10                 Suspend a task
  115. .terminate. equ   11               Terminate a task
  116. .execute. equ   12                 Execute a task
  117. .delay.  equ   13                  Delay a task for a period of time
  118. .timer.  equ   14                  Set up a timer
  119. .purge.  equ   15                  Purge active timer(s)
  120.  
  121. *******************************************************************************
  122. *                                                                             *
  123. *                 TASK AND QUEUE INITIALIZATION DATA BLOCKS                   *
  124. *                 These should change for your application                    *
  125. *                                                                             *
  126. * The next section contains the initialization data blocks for the TCB's and  *
  127. * the queues. The user should construct these tables as they define such data *
  128. * as queue sizes, task starting addresses, and stack sizes.                   *
  129. *                                                                             *
  130. *******************************************************************************
  131. *******************************************************************************
  132. *                      QUEUE INITIALIZATION