* SMS2 - System variables
*
* This file - SMS2_in - contains the SMS2 versions of the QDOS system variables
*
* The following list gives the offset of each system variable from the base of
* the system variables
*
sys_idnt  equ    $00  long          system variables identification
sysid.ql  equ    $d2450000          QL (QDOS) system variable identifier
sysid.at  equ    'S2AT'             SMS Atari system variable identifier
*
* The following variables are the pointers which define the current state of
* the memory map
*
sys_chpb  equ    $04  long          common heap base
sys_chpf  equ    $08  long          common heap free space pointer
sys_fsbb  equ    $0c  long          filing system slave block area base
sys_sbab  equ    $10  long          QL SuperBASIC area base
sys_tpab  equ    $14  long          transient program area base
sys_tpaf  equ    $18  long          transient program area free space pointer
sys_rpab  equ    $1c  long          resident procedure area base
sys_ramt  equ    $20  long          user ram top (+1)
sys_mxfr  equ    $24  long          maximum return from free memory call
sys_rtc   equ    $28  long          real time (seconds)
sys_rtcf  equ    $2c  word          real time fractional, count down
sys_rand  equ    $2e  word          random number
sys_pict  equ    $30  word          polling interupt count
sys_dtyp  equ    $32  byte          display type (0=normal, 1=TV 625, 2=TV 525
sys_dfrz  equ    $33  byte          display frozen (T or F)
sys_qlmr  equ    $34  byte          QL master chip register value
sys_qlir  equ    $35  byte          QL interrupt register value
sys_rshd  equ    $36  byte          true to reschedule
sys_nnnr  equ    $37  byte          network node number
*
* The following are pointers to the list of tasks and drivers
*
sys_exil  equ    $38  long          external interrupt action list
sys_poll  equ    $3c  long          polled action list
sys_shdl  equ    $40  long          scheduler loop action list
sys_iodl  equ    $44  long          io driver list
sys_fsdl  equ    $48  long          filing system driver list
sys_ckyq  equ    $4c  long          current keyboard queue
sys_ertb  equ    $50  long          exception redirection table base
*
* The following are pointers to the resource management tables. The slave block
* tables have 8 byte entries, the others 4 byte entries
*
sys_sbrp  equ    $54  long          slave block running pointer
sys_sbtb  equ    $58  long          slave block table base
sys_sbtt  equ    $5c  long          slave block table top
*
sys_jbtg  equ    $60  word          next job tag
sys_jbtp  equ    $62  word          highest job in table (top one)
sys_jbpt  equ    $64  long          current job pointer
sys_jbtb  equ    $68  long          job table base
sys_jbtt  equ    $6c  long          job table top
*
sys_chtg  equ    $70  word          next channel tag
sys_chtp  equ    $72  word          highest channel in table (top one)
sys_chpt  equ    $74  long          last checked channel pointer
sys_chtb  equ    $78  long          channel table base
sys_chtt  equ    $7c  long          channel table top
*
sys_frbl  equ    $80  long          free block list (to be returned to common heap
*
* The following variables contain information about how to treat the keyboard,
* an about other aspects of the IPC and serial port communications.
*
sys_caps  equ    $88  word          caps lock
sys_lchr  equ    $8a  word          last character
sys_rdel  equ    $8c  word          repeat delay (20ms units)
sys.rdel  equ    25                 number of repeat delay units
sys_rtim  equ    $8e  word          repeat time (20ms units)
sys.rtim  equ    2                  number of repeat time units
sys_rcnt  equ    $90  word          repeat counter (decremented every 20ms)
sys_swtc  equ    $92  word          switch queues character
sys_qlbp  equ    $96  byte          QL beeping
sys_ser1  equ    $98  long          receive  channel 1 queue address
sys_ser2  equ    $9c  long          receive  channel 2 queue address
sys_tmod  equ    $a0  byte          zx8302 transmit mode (includes baudrate)
sys_csub  equ    $a2  long          subroutine to jump to on capslock
sys_dmiu  equ    $a6  byte          DMA in use
sys_tmot  equ    $a6  word          timeout for switching transmit mode
sys_tmov  equ    $a8  word          value of switching timeout (two characters)
sys_fstt  equ    $aa  word          flashing cursor status
*
sys_prgd  equ    $ac  long          pointer to program default
sys_datd  equ    $b0  long          pointer to data default
sys_dstd  equ    $b4  long          pointer to destination default
*
sys_thgl  equ    $b8  long          pointer to thing list
*
sys_mdrn  equ    $ee  byte          which microdrive drive is running?
sys_mdct  equ    $ef  byte          microdrive run-up run-down counter
sys_mdid  equ    $f0  8 bytes       drive id*4 of each microdrive
sys_mdst  equ    $f8  8 bytes       status 0= no pending ops
*
sys_fsdd  equ    $100 16 long       filing system drive definitions
sys_fsdt  equ    $140 long          filing system drive definition table top
sys.nfsd  equ    $10                max number of filing system drive definitions
sys_fsch  equ    $140 long          linked list of filing system channel blocks
*
sys_xact  equ    $144 byte          set if translate active
sys_xtab  equ    $146 long          pointer to translation table
sys_erms  equ    $14a long          pointer to error message table
*
sys_top   equ    $180               top of system variables bottom of stack
*
* The following area between $180 and $480 is reserved for the supervisor stack.
*

          list
