 sttl FIO Simulation Structure
 pag

*
* Control structure used to simulate Z8038 FIO
* -- As seen by Main 6809 CPU (UniFLEX)
*

FIFO_SIZE equ 128 Size of FIFO buffer

IOP_MAP  equ $F8 -- IOP Mapping at $E000
IO_MAP   equ $FF -- Normal I/O at $E000
*
IO_DAT   equ $F40E

 if UniFLEX
         base $E000 -- Dual port RAM
 else
         org $E000 -- Shared Dual Port RAM
 endif
irq_gen  rmb 1 IRQ generator cell
iop_cpu  rmb 1 IOP -> CPU Mailbox cell
iop_cpu1 rmb 1            -- Additional cell
iop_cpu2 rmb 1            --
iop_cpu3 rmb 1            --
iop_cpuF rmb 1 Non-zero when mailbox has data
cpu_iop  rmb 1 CPU -> IOP Mailbox cell
cpu_iop1 rmb 1            -- Additional cell
cpu_iop2 rmb 1            --
cpu_iop3 rmb 1            --
cpu_iopF rmb 1 Non-zero when mailbox has data
fifo_cnt rmb 1 Count of data in FIFO
fifo_get rmb 2 FIFO consumer pointer
fifo_put rmb 2 FIFO producre pointer
         rmb 16-(*-irq_gen) ** Filler **
fifo     rmb FIFO_SIZE actual FIFO
         rmb $100-(*-irq_gen)
* IOP Configuration constants
NUM_CL   rmb 1 Number of CLISTS
NUM_TRM  rmb 1 Number of terminals
NUM_NEC  rmb 1 Number of NEC/Qume printers
NUM_PPR  rmb 1 Number of parallel printers
NUM_TSK  rmb 1 Number of tasks
 if UniFLEX
*
* IOP Task Priority
*   -- Set to make task uninterruptable while
*   -- actually using the IOP
*
IOPPRI set 15

*
* IOP Control structures
*

* Transaction slots

 base 0
tran_seq rmb 1 Transaction sequence #
tran_resp rmb 1 Transaction response code
tran_val rmb 1 Transaction specific value (returned character, etc)
tran_oval rmb 1 Output specific value
tran_msg rmb 1 Message code sent
tran_dev rmb 1 Device code
*
TRAN_SIZ equ *
MAX_TRAN equ 48 Max # concurrent transactions / IOP

* IOP Control

 base 0
iop_mbx rmb 2 Mailbox interlock - Task id of locker
iop_fifo rmb 2 FIFO interlock - Task id of locker
iop_int rmb 1 Set non-zero if message interrupt was missed
iop_tflg rmb 1 Waiting on transaction slot semaphore
iop_Q rmb 4 Input response queue
iop_tran rmb MAX_TRAN*TRAN_SIZE transaction slots
*
IOP_SIZE equ *
 endif
