home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 1
/
FFMCD01.bin
/
bbs
/
develop
/
mcx11.lha
/
MCX11
/
SYSTEM.AS
< prev
next >
Wrap
Text File
|
1990-12-08
|
25KB
|
409 lines
*SYSTEM.AS *
*******************************************************************************
* *
* SYSTEM CONFIGURATION *
* *
* This information must be entered by the user to define the configuration of *
* the system. These equates are used to define the extents of the MCX11 *
* system tables. THIS FILE MUST BE THE FILE NAMED IN THE ASSEMBLY COMMAND *
* LINE. It may be named anything the user wishes. Remember that AS11 names *
* S-Record object file after the first file name encountered in the assembly *
* command. *
* *
*******************************************************************************
* *
* APPLICATION EQUATES *
* (These VALUES should be changed for your application where indicated) *
* *
* DO NOT CHANGE THE SYMBOL NAMES BECAUSE THEY ARE USED THROUGHOUT MCX11 *
* *
*******************************************************************************
*******************************************************************************
* BASIC CONFIGURATION DATA EQUATES *
* These should change for your application *
*******************************************************************************
NTASKS equ 5 Number of tasks in system
NQUEUES equ 2 Number of queues in system
NNAMSEM equ 8 Number of named semaphores in system
NTIMERS equ 3 Number of timers in system
*******************************************************************************
* SYSTEM MEMORY EQUATES *
* These should change for your application *
*******************************************************************************
MCXVAR equ $EF Base RAM address of MCX variables (17 bytes
* are needed. For example, $ef - $ff)
MCX11 equ $E000 Base ROM address for MCX11
MCXTABL equ MCXVAR-1 Base RAM address of MCX system tables
*******************************************************************************
* CLOCK AND PRESET EQUATES *
* These should change for your application *
*******************************************************************************
TMSK2 equ $1024
TFLG2 equ TMSK2+1
PACTL equ TFLG2+1
RTII equ $40 RTI Interrupt enabled, prescale = 00
RTR equ $02 16.37 ms per TICK @ 8MHz
RTIF equ $40
TOCK equ 3 3 TICKs per TOCK (TOCK = 49.14 ms ~ 20 Hz)
*******************************************************************************
* MCX11 EQUATES *
* (These should not be changed) *
*******************************************************************************
TCBLEN equ 5 Length of a Task Control Block
TIMRLEN equ 8 Length of a Timer Block
QHDRLEN equ 3 Length of a Queue Header
*******************************************************************************
* SYSTEM TABLE EQUATES *
* (These should not be changed) *
*******************************************************************************
NT equ NTIMERS*TIMRLEN
TIMERS equ MCXTABL-NT Base address of timer blocks
NQ equ NQUEUES*QHDRLEN
QHDRTBL equ TIMERS-NQ Base address of queue headers
NQS equ NQUEUES*2
FLGTBL equ QHDRTBL-NNAMSEM-NTASKS-NQS Base address of semaphores
NTS equ NTASKS*TCBLEN
STATLS equ FLGTBL-NTS-TCBLEN Base address of Task Control Blocks (TCB)
QBODBAS equ STATLS-1 Last address of Queue Bodies
*******************************************************************************
* TCB INITIALIZATION DATA BLOCK EQUATES *
* (These should not be changed) *
*******************************************************************************
INITST equ 0 Task STATE at system initialization
STRTADR equ 1 Task starting address
RSTSP equ 3 Base address of task's stack
TCBADDR equ 5 Address of task's TCB
TCBDATL equ 7 Length of a TCB initialization data block
*******************************************************************************
* QUEUE INITIALIZATION DATA BLOCK EQUATES *
* (These should not be changed) *
*******************************************************************************
WIDTH equ 0 Width of the queue entry
DEPTH equ 1 Depth of queue (# of entries)
QHADR equ 2 Queue Header address
QADDR equ 4 Address of the Queue Body
QUEDATL equ 6 Length of a Queue initialization data block
*******************************************************************************
* MCX ESR equates *
*******************************************************************************
.wait. equ 1 Wait for an event to occur
.signal. equ 2 Signal the occurence of an event
.pend. equ 3 Set a semaphore to PENDing state
.send. equ 4 Send a message to a task
.sendw. equ 5 Send a message and wait for response
.receive. equ 6 Receive a message
.deque. equ 7 Dequeue an entery from a FIFO queue
.enque. equ 8 Enqueue an entry into a FIFO queue
.resume. equ 9 Resume a suspended task
.suspend. equ 10 Suspend a task
.terminate. equ 11 Terminate a task
.execute. equ 12 Execute a task
.delay. equ 13 Delay a task for a period of time
.timer. equ 14 Set up a timer
.purge. equ 15 Purge active timer(s)
*******************************************************************************
* *
* TASK AND QUEUE INITIALIZATION DATA BLOCKS *
* These should change for your application *
* *
* The next section contains the initialization data blocks for the TCB's and *
* the queues. The user should construct these tables as they define such data *
* as queue sizes, task starting addresses, and stack sizes. *
* *
*******************************************************************************
*******************************************************************************
* QUEUE INITIALIZATION