*******************************************************************************
*                                                                             *
*        8290.6 GST 82/0.00                                                   *
*                                                                             *
*        The QDOS parameter file - part 2                                     *
*                                                                             *
*******************************************************************************
 
         NOLIST
*
*   The QDOS parameters are split into two files:  this one is
*   QDOS2_IN and the other one is QDOS1_IN.
*


 
* SYS.SD.SA                         window data block definition
 
*
SD_XMIN   EQU    $18  (word)        window top LHS
SD_YMIN   EQU    $1A  (word)
SD_XSIZE  EQU    $1C  (word)        window size
SD_YSIZE  EQU    $1E  (word)
SD_BORWD  EQU    $20  (word)        border width
*
SD_XPOS   EQU    $22  (word)        cursor position
SD_YPOS   EQU    $24  (word)
SD_XINC   EQU    $26  (word)        cursor increment
SD_YINC   EQU    $28  (word)
*
SD_FONT   EQU    $2A  (2*long)      font addresses
*
SD_SCRB   EQU    $32  (long)        base address of screen
*
SD_PMASK  EQU    $36  (long)        paper colour mask
SD_SMASK  EQU    $3A  (long)        strip colour mask
SD_IMASK  EQU    $3E  (long)        ink colour mask
*
SD_CATTR  EQU    $42  (byte)        character attributes
*
SD_CURF   EQU    $43  (byte)        cursor flag 0=suppressed, >0=visible
SD_PCOLR  EQU    $44  (byte)        paper colour byte
SD_SCOLR  EQU    $45  (byte)        strip colour byte
SD_ICOLR  EQU    $46  (byte)        ink colour byte
SD_BCOLR  EQU    $47  (byte)        border colour byte
*
SD_NLSTA  EQU    $48  (byte)        new line status (>0 implicit, <0 explicit)
*
SD_FMOD   EQU    $49  (byte)        fill mode (0=off, 1=on)
SD_YORG   EQU    $4A  (float)       graphics window origin
SD_XORG   EQU    $50  (float)       graphics window origin
SD_SCAL   EQU    $56  (float)       graphics scale factor
SD_FBUF   EQU    $5C  (long)        pointer to fill buffer
SD_FUSE   EQU    $60  (long)        pointer to user defined fill vectors
 
SD_END    EQU    $64
*
* character attribute and other flag bits
*
SD..ULIN  EQU    0                  underline bit
SD..FLSH  EQU    1                  flash bit
SD..TRNS  EQU    2                  transparent background
SD..XOR   EQU    3                  XOR characters/graphics
SD..DBHT  EQU    4                  double height
SD..EXWD  EQU    5                  extended width
SD..DBWD  EQU    6                  double width
SD..GCHR  EQU    7                  graphics positioned characters
*
*                                   screen entry parameter definition
*
SD.EXTOP  EQU    $09                external operation (A3)
SD.PXENQ  EQU    $0A                pixel based size / position enquiry
SD.CHENQ  EQU    $0B                character based size / position enquiry
SD.BORDR  EQU    $0C                define window border
SD.WDEF   EQU    $0D                define window
SD.CURE   EQU    $0E                enable cursor
SD.CURS   EQU    $0F                suppress cursor
SD.POS    EQU    $10                absolute position
SD.TAB    EQU    $11                tab (horizontal position)
SD.NL     EQU    $12                newline
SD.PCOL   EQU    $13                previous column
SD.NCOL   EQU    $14                next column
SD.PROW   EQU    $15                previous row
SD.NROW   EQU    $16                next row
SD.PIXP   EQU    $17                set pixel position
SD.SCROL  EQU    $18                scroll whole window
SD.SCRTP  EQU    $19                scroll top of window
SD.SCRBT  EQU    $1A                scroll bottom of window
SD.PAN    EQU    $1B                pan window
*
SD.PANLN  EQU    $1E                pan cursor line
SD.PANRT  EQU    $1F                pan RHS of cursor line
SD.CLEAR  EQU    $20                clear whole window
SD.CLRTP  EQU    $21                clear top of window
SD.CLRBT  EQU    $22                clear bottom of window
SD.CLRLN  EQU    $23                clear cursor line
SD.CLRRT  EQU    $24                clear to right of cursor
SD.FOUNT  EQU    $25                set fount addresses
SD.RECOL  EQU    $26                recolour a window
SD.SETPA  EQU    $27                set paper colour
SD.SETST  EQU    $28                set strip colour
SD.SETIN  EQU    $29                set ink colour
SD.SETFL  EQU    $2A                set flash on/off
SD.SETUL  EQU    $2B                set underline on/off
SD.SETMD  EQU    $2C                set write mode
SD.SETSZ  EQU    $2D                set character size
SD.FILL   EQU    $2E                fill block
SD.DONL   EQU    $2F                do pending newline
SD.POINT  EQU    $30                set point in window
SD.LINE   EQU    $31                draw line
SD.ARC    EQU    $32                draw arc
SD.ELIPS  EQU    $33                draw ellipse
SD.SCALE  EQU    $34                set graphics scale
SD.FLOOD  EQU    $35                set fill mode/vectors
SD.GCUR   EQU    $36                set text cursor using graphics coords
*
* SYS.MD.SA                         microdrive physical layer definition
 
*
MD_DRIVR  EQU    $10  long          pointer to driver
MD_DRIVN  EQU    $14  byte          drive number
*
MD_MNAME  EQU    $16  10 bytes+word medium name and check number
MD_FILES  EQU    $22  byte          number of files open
MD_ESTAT  EQU    $23  byte          error status 0=OK -1=bad
MD_FAIL   EQU    $24  byte          failure count
*
MD_MAP    EQU    $28  256*2 bytes   microdrive map
MD_FILMP  EQU    $28                files by sector number*2 (FE bad, FD vac,
*                                          ... FC pending delete)
MD_BLKMP  EQU    $29                block by sector number*2
MD_LSECT  EQU    $226 word          last sector allocated.
MD_PENDG  EQU    $228 256 words     pending operations map by sector nr*2
*                                          ... 0 not, >0 slave block nr
*                                          ... -1 write map, -2 verify map
MD_END    EQU    $428
*
* directory structure definitions
*
MD_DELEN  EQU    $00  long word     file length
MD_DEACS  EQU    $04  byte          file access key
MD_DETYP  EQU    $05  byte          file type
MD_DEINF  EQU    $06  8 bytes       file information
MD_DENAM  EQU    $0E  2+36 bytes    file name
*
MD_DEEND  EQU    $40
 
 
 
* SYS.SER.SA                        Serial I/O definitions
 
SER_RXQL  EQU    81                 Length of receive buffer (odd!)
SER_TXQL  EQU    81                 Length of transmit buffer (odd!)
*
* Channel definition block
*
SER_CHNO  EQU    24                 Channel number (1 or 2)
SER_PAR   EQU    26                 Parity requirement
SER_TXHS  EQU    28                 Transmit handshake flag
SER_PROT  EQU    30                 Protocol, +ve CR/LF, 0 CTRLZ, -ve RAW
SER_RXQ   EQU    32                 Receive queue header
SER_TXQ   EQU    32+SER_RXQL+Q_QUEUE+1       Transmit queue header
SER_END   EQU    SER_TXQ+SER_TXQL+Q_QUEUE+1  Total memory required
 
 
 
* SYS.NET.SA                        net data block definition
 
*
NET_HEDR  EQU    $18  (8 bytes)     network packet header
NET_DEST  EQU    $18  (byte)        destination station number
NET_SELF  EQU    $19  (byte)        own station number
NET_BLKL  EQU    $1A  (byte)        data block number (low byte)
NET_BLKH  EQU    $1B  (byte)        data block number (high byte)
NET_TYPE  EQU    $1C  (byte)        send blocks: 0=not EOF 1=EOF
NET_NBYT  EQU    $1D  (byte)        number of bytes sent or received
NET_DCHK  EQU    $1E  (byte)        data checksum
NET_HCHK  EQU    $1F  (byte)        header checksum
*
NET_DATA  EQU    $20  (255 bytes)   data block
*
NET_RPNT  EQU    $11F (byte)        running pointer to data block
NET_END   EQU    $120               length of data definition block
*
* SYS.IPCMD.SA                      IPC link commands
 
RSET_CMD  EQU    0                  System reset
STAT_CMD  EQU    1                  Report input status
OPS1_CMD  EQU    2                  Open  RS232 channel 1
OPS2_CMD  EQU    3                  Open  RS232 channel 2
CLS1_CMD  EQU    4                  Close RS232 channel 1
CLS2_CMD  EQU    5                  Close RS232 channel 2
RDS1_CMD  EQU    6                  Read  RS232 channel 1
RDS2_CMD  EQU    7                  Read  RS232 channel 2
RDKB_CMD  EQU    8                  Read keyboard
KBDR_CMD  EQU    9                  Keyboard direct read
INSO_CMD  EQU    10                 Initiate sound process
KISO_CMD  EQU    11                 Kill sound process
MDRS_CMD  EQU    12                 Microdrive reduced sensitivity
BAUD_CMD  EQU    13                 Change baud rate
RAND_CMD  EQU    14                 Random number generator
TEST_CMD  EQU    15                 Test
SBSIZE    EQU    25                 Maximum length of an RS232 buffer
 
 
 
* SYS.RI.SA                         arithmetic interpreter op codes
 
*
RI.TERM   EQU    $00
RI.NINT   EQU    $02
RI.INT    EQU    $04
RI.NLINT  EQU    $06
RI.FLOAT  EQU    $08
RI.ADD    EQU    $0A
RI.SUB    EQU    $0C
RI.MULT   EQU    $0E
RI.DIV    EQU    $10
RI.ABS    EQU    $12
RI.NEG    EQU    $14
RI.DUP    EQU    $16
RI.COS    EQU    $18
RI.SIN    EQU    $1A
RI.TAN    EQU    $1C
RI.COT    EQU    $1E
RI.ASIN   EQU    $20
RI.ACOS   EQU    $22
RI.ATAN   EQU    $24
RI.ACOT   EQU    $26
RI.SQRT   EQU    $28
RI.LN     EQU    $2A
RI.LOG10  EQU    $2C
RI.EXP    EQU    $2E
RI.POWFP  EQU    $30
*
RI.MAXOP  EQU    $30
*
RI.LOAD   EQU    $00                load operand key
RI.STORE  EQU    $01                store operand key (sets bit 0)
 
 
 
* PA.SA                             Token types
 
SPC.B     EQU    $80                space token
KEY.B     EQU    $81                keyword token
BIP.B     EQU    $82                built-in-procedure
BIF.B     EQU    $83                built-in-function
SYM.B     EQU    $84                symbol
OPS.B     EQU    $85                operation symbol
MON.B     EQU    $86                mono-operation symbol
SYV.B     EQU    $87                system variable
NAM.B     EQU    $88                name
SHI.B     EQU    $89                short integer
LGI.B     EQU    $8A                long integer
FP.B      EQU    $F0                floating point number
STR.B     EQU    $8B                string
TXT.B     EQU    $8C                text
LNO.B     EQU    $8D                line number
SEP.B     EQU    $8E                separator
 
 
 
* LPOFF.SA                          Offsets within loop index decription
 
LP.IEXP   EQU    0                  index exponent (word)
LP.IMANT  EQU    2                  index mantissa (long)
LP.LNVAR  EQU    6                  length of a simple variable
*
LP.SL     EQU    6                  start line (word)
LP.EL     EQU    8                  end line (word)
LP.SS     EQU    $A                 statement on start line (byte)
LP.ES     EQU    $B                 statement on end line (byte)
LP.LNREP  EQU    $C                 length of a REP description
*
LP.EEXP   EQU    $C                 endval exponent (word)
LP.EMANT  EQU    $E                 endval mantissa (long)
LP.SEXP   EQU    $12                step exponent (word)
LP.SMANT  EQU    $14                step mantissa (long)
LP.CHPOS  EQU    $18                character position along line (word)
LP.LNFOR  EQU    $1A                length of a FOR description
 
 
 
* CHOFF.SA                          Offsets on BASIC channel definitions
 
CH.ID     EQU    0                  Channel id
CH.CCPY   EQU    $4     (float)     Current cursor position, y
CH.CCPX   EQU    $A     (float)     Current cursor position, x
CH.ANGLE  EQU    $10    (float)     Turtle angle
CH.PEN    EQU    $16    (byte)      Pen status (up or down)
CH.CHPOS  EQU    $20    (word)      character position on line
CH.WIDTH  EQU    $22    (word)      Width of line in characters
CH.SPARE  EQU    $24                ..spare..
*
CH.LENCH  EQU    $28                Length of a channel definition block
 
 
 
* RT.SA                             Return Stack pointers
*
 
RT.SVBA   EQU    0                  base of args                 .L
RT.SVBL   EQU    4                  base of locals               .L
RT.SVTL   EQU    8                  top of locals                .L
RT.SVDFL  EQU    $C                 DEF line number              .W
RT.SVFNT  EQU    $E                 function type                .B
RT.SVSWP  EQU    $F                 args swapped($FF) or not (0) .B
*
RT.LENPR  EQU    $10                length of pr/fn bits
*
* add $10 to next 4 if total wanted from base
*
RT.SVRTT  EQU    0                  return type- 0 gosub, 1 proc, 2 fn .B
RT.SVSTM  EQU    1                  statement to return to             .B
RT.SVLNO  EQU    2                  line number to return to           .W
RT.SVSTA  EQU    4                  status flags - inlin, sing, index  .L
*
RT.LENTL  EQU    $18                total length
*
* Restoring wants offsets working downwards
*
RT.RSBA   EQU    $18
RT.RSBL   EQU    $14
RT.RSTL   EQU    $10
RT.RSDFL  EQU    $C
RT.RSFNT  EQU    $A
RT.RSSWP  EQU    9
RT.RSRTT  EQU    8
RT.RSSTM  EQU    7
RT.RSLNO  EQU    6
RT.RSSTA  EQU    4
 
 
 
* BV.SA                             Pointers to Basic Variable lists & stacks
 
*
* $20 bytes before this are PCB
*
BV_START  EQU    0                  start of pointers
*
BV_BFBAS  EQU    0                  buffer base
BV_BFP    EQU    4                  buffer running pointer
BV_TKBAS  EQU    8                  token list
BV_TKP    EQU    $C
BV_PFBAS  EQU    $10                program file
BV_PFP    EQU    $14
BV_NTBAS  EQU    $18                name table
BV_NTP    EQU    $1C
BV_NLBAS  EQU    $20                name list
BV_NLP    EQU    $24
BV_VVBAS  EQU    $28                variable values
BV_VVP    EQU    $2C
BV_CHBAS  EQU    $30                channel table
BV_CHP    EQU    $34
BV_RTBAS  EQU    $38                return table
BV_RTP    EQU    $3C
BV_LNBAS  EQU    $40                line number table
BV_LNP    EQU    $44
*
BV_CHANGE EQU    $48                change of direction marker
*
BV_BTP    EQU    $48                backtrack stack during parsing
BV_BTBAS  EQU    $4C
BV_TGP    EQU    $50                temporary graph stack during parsing
BV_TGBAS  EQU    $54
BV_RIP    EQU    $58                arithmetic stack
BV_RIBAS  EQU    $5C
BV_SSP    EQU    $60                system stack (real one!)
BV_SSBAS  EQU    $64
*
BV_ENDPT  EQU    $64                end of pointers
*
BV_LINUM  EQU    $68                current line number (word)
BV_LENGTH EQU    $6A                current length (word)
BV_STMNT  EQU    $6C                current statement on line (byte)
BV_CONT   EQU    $6D                continue($80) or stop(0) processing (byte)
BV_INLIN  EQU    $6E                processing in-line clause or not (byte)
*                                   loop (1), other ($FF), not (0)
BV_SING   EQU    $6F              single line execution on($FF) or off(0)(byte)
BV_INDEX  EQU    $70             name tab row of last inlin lp index read(word)
BV_VVFREE EQU    $72                first free space in vvtable (long)
BV_SSSAV  EQU    $76                saved sp for out/mem to go back to (long)
*
*             gap of 6 !
*
BV_RAND   EQU    $80                random number (long)
BV_COMCH  EQU    $84                command channel (long)
*
BV_NXLIN  EQU    $88                which line number to start after (word)
BV_NXSTM  EQU    $8A                which statement to start after (byte)
BV_COMLN  EQU    $8B                command line saved($FF) or not(0) (byte)
BV_STOPN  EQU    $8C                which stop number set (word)
BV_EDIT   EQU    $8E             program has been editted($FF) or not(0)(byte)
BV_BRK    EQU    $8F                there has been a break (0) or not ($80)(b)
BV_UNRVL  EQU    $90                need to unravel($FF) or not (0) (byte)
BV_CNSTM  EQU    $91                statement to CONTINUE from (byte)
BV_CNLNO  EQU    $92                line to CONTINUE from (word)
*
BV_DALNO  EQU    $94                current DATA line number (word)
BV_DASTM  EQU    $96                current DATA statement number (byte)
BV_DAITM  EQU    $97                next DATA item to read (byte)
*
BV_CNIND  EQU    $98                inline loop index to CONTINUE with (word)
BV_CNINL  EQU    $9A                inline loop flag for CONTINUE (byte)
*
BV_LSANY  EQU    $9B                whether checking list(ff) or not(0) (byte)
BV_LSBEF  EQU    $9C                invisible top line (word)
BV_LSBAS  EQU    $9E                bottom line in window (word)
BV_LSAFT  EQU    $A0                invisible bottom line (word)
BV_LENLN  EQU    $A2                length of window line (word)
BV_MAXLN  EQU    $A4                max no of window lines (word)
*   note. The 2 words immediately following this will be overwritten on
*   changing lenln and maxln
BV_TOTLN  EQU    $A6                no of window lines so far (word)
*              gap of 2
*
BV_AUTO   EQU    $AA                whether AUTO/EDIT on(FF) or off(0) (byte)
BV_PRINT  EQU    $AB          print from prtok (FF) or leave in buffer (0) (b)
BV_EDLIN  EQU    $AC                line number to edit next (word)
BV_EDINC  EQU    $AE                increment on edit range (word)
*
BV_TKPOS  EQU    $B0                pos of A4 in tklist on entry to PROC (long)
BV_PTEMP  EQU    $B4                temp pointer for GO_PROC (long)
BV_UNDO   EQU    $B8        undo rt stack IMMEDIATELY then redo procedure(byte)
*
BV_ARROW  EQU    $B9                down(FF) or up(01) or no(0  arrow (byte)
*
BV_LSFIL  EQU    $BA         fill window when relisting at least to here (word)
*
BV_END    EQU    $100               top of BV area
*
         LIST
