MSX2-Technical-Handbook

APPENDIX 4 - WORK AREA LISTING

 

Index

Subroutines for read/write calls of the inter-slot

Starting address of assembly language program of USR function, text screen

Work for initialisation

Area to save VDP registers

Work area for PLAY statement

Work area for key input

Parameters for Cassette

Work used by BASIC internally

Work for user function parameter

Work for Math-Pack

Data area used by BASIC interpreter

Data area used by CIRCLE statement

Data area used in PAINT statement

Data area used in PLAY statement

Work area added in MSX2

Data area used by RS-232C

Data area used by DOS

Data area used by PLAY statement

Data area

Hooks

Changes from the original

 

Figure A.5 shows the map of the MSX2 work area. In this section, the system work area and hook from F380H to FFCAH in the figure are described. The following notation is used. Length is in bytes.

Label name (address, length)

Figure A.5 Work area
FFFF    ---------------------------
        | slot selection register |
FFFC    |-------------------------|
        |         reserved        |
FFF8    |-------------------------|
FFF7    |  MAIN-ROM slot address  |
        |-------------------------|
        |  register reservation   |
        |      area for new       |
FFE7    |       VDP (9938)        |
        |-------------------------|
        |       program for       |
FFCA    |  expansion BIOS calls   |
        |-------------------------|
        |                         |
        |       hook area         |
FD9A    |                         |
        |-------------------------|
        |                         |
        |    system work area     |
F380    |                         |
        ---------------------------

 

Subroutines for read/write calls of the inter-slot

RDPRIM (F380H, 5)

WRPRIM (F385H, 7)

CLPRIM (F38CH, 14)

 

Starting address of assembly language program of USR function, text screen

USRTAB (F39AH, 20)

LINL40 (F3AEH, 1)

LINL32 (F3AFH, 1)

LINLEN (F3B0H, 1)

CRTCNT (F3B1H, 1)

CLMLST (F3B2H, 1)

 

Work for initialisation

SCREEN 0

TXTNAM (F3B3H, 2)

TXTCOL (F3B5H, 2)

TXTCGP (F3B7H, 2)

TXTATR (F3B9H, 2)

TXTPAT (F3BBH, 2)

 

SCREEN 1

T32NAM (F3BDH, 2)

T32COL (F3BFH, 2)

T32CGP (F3C1H, 2)

T32ATR (F3C3H, 2)

T32PAT (F3C5H, 2)

 

SCREEN 2

GRPNAM (F3C7H, 2)

GRPCOL (F3C9H, 2)

GRPCGP (F3CBH, 2)

GRPATR (F3CDH, 2)

GRPPAT (F3CFH, 2)

 

SCREEN 3

MLTNAM (F3D1H, 2)

MLTCOL (F3D3H, 2)

MLTCGP (F3D5H, 2)

MLTATR (F3D7H, 2)

MLTPAT (F3D9H, 2)

 

Other screen settings

CLIKSW (F3DBH, 1)

CSRY (F3DCH, 1)

CSRX (F3DDH, 1)

CNSDFG (F3DEH, 1)

 

Area to save VDP registers

RG0SAV (F3DFH, 1)

RG1SAV (F3E0H, 1)

RG2SAV (F3E1H, 1)

RG3SAV (F3E2H, 1)

RG4SAV (F3E3H, 1)

RG5SAV (F3E4H, 1)

RG6SAV (F3E5H, 1)

RG7SAV (F3E6H, 1)

STATFL (F3E7H, 1)

TRGFLG (F3E8H, 1)

FORCLR (F3E9H, 1)

BAKCLR (F3EAH, 1)

BDRCLR (F3EBH, 1)

MAXUPD (F3ECH, 3)

MINUPD (F3EFH, 3)

ATRBYT (F3F2H, 1)

 

Work area for PLAY statement

QUEUES (F3F3H, 2)

FRCNEW (F3F5H)

 

Work area for key input

SCNCNT (F3F6H, 1)

REPCNT (F3F7H, 1)

PUTPNT (F3F8H, 2)

GETPNT (F3FAH, 2)

 

Parameters for Cassette

 

CS120 (F3FCH, 5*2)

LOW (F406H, 2)

HIGH (F408H, 2)

HEADER (F40AH, 1)

ASPCT1 (F40BH, 1)

ASPCT2 (F40DH, 1)

ENDPRG (F40FH, 5)

 

Work used by BASIC internally

ERRFLG (F414H, 1)

LPTPOS (F415H, 1)

PRTFLG (F416H, 1)

NTMSXP (F417H, 1)

RAWPRT (F418H, 1)

VLZADR (F419H, 2)

VLZDAT (F41BH, 1)

CURLIN (F41CH, 2)

KBUF (F41FH, 318)

BUFMIN (F55DH, 1)

BUF (F55EH, 258)

ENDBUF (F660H, 1)

TTYPOS (F661H, 1)

DIMFLG (F662H, 1)

VALTYP (F663H, 1)

DORES (F664H, 1)

DONUM (F665H, 1)

CONTXT (F666H, 2)

CONSAV (F668H, 1)

CONTYP (F669H, 1)

CONLO (F66AH, 8)

MEMSIZ (F672H, 2)

STKTOP (F674H, 2)

TXTTAB (F676H, 2)

TEMPPT (F768H, 2)

TEMPST (F67AH, 3 * NUMTMP)

DSCTMP (F698H, 3)

FRETOP (F69BH, 2)

TEMP3 (F69DH, 2)

TEMP8 (F69FH, 2)

ENDFOR (F6A1H, 2)

DATLIN (F6A3H, 2)

SUBFLG (F6A5H, 1)

FLGINP (F6A6H, 1)

TEMP (F6A7H, 2)

PTRFLG (F6A9H, 1)

AUTFLG (F6AAH, 1)

AUTLIN (F6ABH, 2)

AUTINC (F6ADH, 2)

SAVTXT (F6AFH, 2)

ERRLIN (F6B3H, 2)

DOT (F6B5H, 2)

ERRTXT (F6B7H, 2)

ONELIN (F6B9H, 2)

ONEFLG (F6BBH, 1)

TEMP2 (F6BCH, 2)

OLDLIN (F6BEH, 2)

OLDTXT (F6C0H, 2)

VARTAB (F6C2H, 2)

ARYTAB (F6C4H, 2)

STREND (F6C6H, 2)

DATPTR (F6C8H, 2)

DEFTBL (F6CAH, 26)

 

Work for user function parameter

PRMSTK (F6E4H, 2)

PRMLEN (F6E6H, 2)

PARM1 (F6E8H, PRMSIZ)

PRMPRV (F74CH, 2)

PRMLN2 (F74EH, 2)

PARM2 (F750H, 100)

PRMFLG (F7B4H, 1)

ARYTA2 (F7B5H, 2)

NOFUNS (F7B7H, 1)

TEMP9 (F7B8H, 2)

FUNACT (F7BAH, 2)

SWPTMP (F7BCH, 8)

TRCFLG (F7C4H, 1)

 

Work for Math-Pack

FBUFFR (F7C5H, 43)

DECTMP (F7F0H, 2)

DECTM2 (F7F2H, 2)

DECCNT (F7F4H, 2)

DAC (F7F6H, 16)

HOLD8 (F806H, 48)

HOLD2 (F836H, 8)

HOLD (F83EH, 8)

ARG (F847H, 16)

RNDX (F857H, 8)

 

Data area used by BASIC interpreter

MAXFIL (F85FH, 1)

FILTAB (F860H, 2)

NULBUF (F862H, 2)

PTRFIL (F864H, 2)

RUNFLG (F866H, 2)

FILNAM (F866H, 11)

FILNM2 (F871H, 11)

NLONLY (F87CH, 1)

SAVEND (F87DH, 2)

FNKSTR (F87FH, 160)

CGPNT (F91FH, 3)

NAMBAS (F922H, 2)

CGPBAS (F924H, 2)

PATBAS (F926H, 2)

ATRBAS (F928H, 2)

CLOC (F92AH, 2)

CMASK (F92CH, 1)

MINDEL (F92DH, 1)

MAXDEL (F92FH, 2)

 

Data area used by CIRCLE statement

ASPECT (F931H, 2)

CENCNT (F933H, 2)

CLINEF (F935H, 1)

CNPNTS (F936H, 2)

CPLOTF (F938H, 1)

CPCNT (F939H, 2)

CPNCNT8 (F93BH, 2)

CPCSUM (F93DH, 2)

CSTCNT (F93FH, 2)

CSCLXY (F941H, 1)

CSAVEA (F942H, 2)

CSAVEM (F944H, 1)

CXOFF (F945H, 2)

CYOFF (F947H, 2)

 

Data area used in PAINT statement

LOHMSK (F949H, 1)

LOHDIR (F94AH, 1)

LOHADR (F94BH, 2)

LOHCNT (F94DH, 2)

SKPCNT (F94FH, 2)

MIVCNT (F951H, 2)

PDIREC (F953H, 1)

LFPROG (F954H, 1)

RTPROG (F955H, 1)

 

Data area used in PLAY statement

MCLTAB (F956H, 2)

MCLFLG (F958H, 1)

QUETAB (F959H, 24)

QUEBAK (F971H, 4)

VOICAQ (F975H, 128)

VOICBQ (F9F5H, 128)

VOICCQ (FA75H, 128)

 

Work area added in MSX2

DPPAGE (FAF5H, 1)

ACPAGE (FAF6H, 1)

AVCSAV (FAF7H, 1)

EXBRSA (FAF8H, 1)

CHRCNT (FAF9H, 1)

ROMA (FAFAH, 2)

MODE (FAFCH, 1)

        (0000WVV0)
             ---
             |||
             |++--- 00 = 16K VRAM
             |      01 = 64K VRAM
             |      11 = 128K VRAM
             |
             +----- 1 = mask, 0 = no mask
                    Flags whether to specify VRAM address
                    ANDed with 3FFFH in SCREEN 0 to 3;
                    in SCREEN 4 to 8, never masked

NORUSE (FAFDH, 1)

XSAVE (FAFEH, 2)

YSAVE (FB00H, 2)

        I = 1 lightpen interrupt request
        OOOOOOO = unsigned offset
        XXXXXXX = X-coordinate
        YYYYYYY = Y-coordinate

LOGOPR (FB02H, 1)

 

Data area used by RS-232C

RSTMP (FB03H, 50)

TOCNT (FB03H, 1)

RSFCB (FB04H, 2)

RSIQLN (FB06H, 5)

MEXBIH (FB07H, 5)

OLDSTT (FB0CH, 5)

OLDINT (FB12H, 5)

DEVNUM (FB17H, 1)

DATCNT (FB18H, 3)

ERRORS (FB1BH, 1)

FLAGS (FB1CH, 1)

ESTBLS (FB1DH, 1)

COMMSK (FB1EH, 1)

LSTCOM (FB1FH, 1)

LSTMOD (FB20H, 1)

 

Data area used by DOS

reserved (FB21H to FB34H)

 

Data area used by PLAY statement

(the following is the same as with MSX1)

PRSCNT (FB35H, 1)

SAVSP (FB36H, 2)

VOICEN (FB38H, 1)

SAVVOL (FB39H, 2)

MCLLEN (FB3BH, 1)

MCLPTR (FB3CH, 1)

QUEUEN (FB3EH, 1)

MUSICF (FC3FH, 1)

PLYCNT (FB40H, 1)

 

Offset from voice static data area

(offset is in decimal)

METREX (+0, 2)

VCXLEN (+2, 1)

VCXPTR (+3, 2)

VCXSTP (+5, 2)

QLENGX (+7, 1)

NTICSX (+8, 2)

TONPRX (+10, 2)

AMPPRX (+12, 1)

ENVPRX (+13, 2)

OCTAVX (+15, 1)

NOTELX (+16, 1)

TEMPOX (+17, 1)

VOLUMX (+18, 1)

ENVLPX (+19, 14)

MCLSTX (+33, 3)

MCLSEX (+36, 1)

VCBSIZ (+37, 1)

 

Voice static data area

VCBA (FB41H, 37)

VCBB (FB66H, 37)

VCBC (FB8BH, 37)

 

Data area

ENSTOP (FBB0H, 1)

BASROM (FBB1H, 1)

LINTTB (FBB2H, 24)

FSTPOS (FBCAH, 2)

CODSAV (FBCCH, 1)

FNKSW1 (FBCDH, 1)

FNKFLG (FBCEH, 10)

ONGSBF (FBD8H, 1)

CLIKFL (FBD9H, 1)

OLDKEY (FBDAH, 11)

NEWKEY (FBE5H, 11)

KEYBUF (FBF0H, 40)

LINWRK (FC18H, 40)

PATWRK (FC40H, 8)

BOTTOM (FC48H, 2)

HIMEM (FC4AH, 2)

TRAPTBL (FC4CH, 78)

RTYCNT (FC9AH, 1)

INTFLG (FC9BH, 1)

PADY (FC9CH, 1)

PADX (FC9DH, 1)

JIFFY (FC9EH, 2)

INTVAL (FCA0H, 2)

INTCNT (FCA2H, 2)

LOWLIM (FCA4H, 1)

WINWID (FCA5H, 1)

GRPHED (FCA6H, 1)

ESCCNT (FCA7H, 1)

INSFLG (FCA8H, 1)

CSRSW (FCA9H, 1)

CSTYLE (FCAAH, 1)

CAPST (FCABH, 1)

KANAST (FCACH, 1)

KANAMD (FCADH, 1)

FLBMEM (FCAEH, 1)

SCRMOD (FCAFH, 1)

OLDSCR (FCB0H, 1)

CASPRV (FCB1H, 1)

BRDATR (FCB2H, 1)

GXPOS (FCB3H, 2)

GYPOS (FCB5H, 2)

GRPACX (FCB7H, 2)

GRPACY (FCB9H, 2)

DRWFLG (FCBBH, 1)

DRWSCL (FCBCH, 1)

DRWANG (FCBDH, 1)

RUNBNF (FCBEH, 1)

SAVENT (FCBFH, 2)

EXPTBL (FCC1H, 4)

SLTTBL (FCC5H, 4)

SLTATR (FCC9H, 64)

SLTWRK (FD09H, 128)

PROCNM (FD89H, 16)

DEVICE (FD99H, 1)

 

Hooks

H.KEYI (FD9AH)

H.TIMI (FD9FH)

H.CHPH (FDA4H)

H.DSPC (FDA9H)

H.ERAC (FDAEH)

H.DSPF (FDB3H)

H.ERAF (FDB8H)

H.TOTE (FDBDH)

H.CHGE (FDC2H)

H.INIP (FDC7H)

H.KEYC (FDCCH)

H.KYEA (FDD1H)

H.NMI (FDD6H)

H.PINL (FDDBH)

H.QINL (FDE0H)

H.INLI (FDE5H)

H.ONGO (FDEAH)

H.DSKO (FDEFH)

H.SETS (FDF4H)

H.NAME (FDF9H)

H.KILL (FDFEH)

H.IPL (FE03H)

H.COPY (FE08H)

H.CMD (FE0DH)

H.DSKF (FE12H)

H.DSKI (FE17H)

H.ATTR (FE1CH)

H.LSET (FE21H)

H.RSET (FE26H)

H.FIEL (FE2BH)

H.MKI$ (FE30H)

H.MKS$ (FE35H)

H.MKD$ (FE3AH)

H.CVI (FE3FH)

H.CVS (FE44H)

H.CVD (FE49H)

H.GETP (FE4EH)

H.SETF (FE53H)

H.NOFO (FE58H)

H.NULO (FE5DH)

H.NTFL (FE62H)

H.MERG (FE67H)

H.SAVE (FE6CH)

H.BINS (FE71H)

H.BINL (FE76H)

H.FILE (FD7BH)

H.DGET (FE80H)

H.FILO (FE85H)

H.INDS (FE8AH)

H.RSLF (FE8FH)

H.SAVD (FE94H)

H.LOC (FE99H)

H.LOF (FE9EH)

H.EOF (FEA3H)

H.FPOS (FEA8H)

H.BAKU (FEADH)

H.PARD (FEB2H)

H.NODE (FEB7H)

H.POSD (FEBCH)

H.DEVN (FEC1H)

H.GEND (FEC6H)

H.RUNC (FECBH)

H.CLEAR (FED0H)

H.LOPD (FED5H)

H.STKE (FEDAH)

H.ISFL (FEDFH)

H.OUTD (FEE4H)

H.CRDO (FEE9H)

H.DSKC (FEEEH)

H.DOGR (FEF3H)

H.PRGE (FEF8H)

H.ERRP (FEFDH)

H.ERRF (FF02H)

H.READ (FF07H)

H.MAIN (FF0CH)

H.DIRD (FF11H)

H.FINI (FF16H)

H.FINE (FF1BH)

H.CRUN (FF20H)

H.CRUN (FF20H)

H.CRUS (FF25H)

H.ISRE (FF2AH)

H.NTFN (FF2FH)

H.NOTR (FF34H)

H.SNGF (FF39H)

H.NEWS (FF3EH)

H.GONE (FF43H)

H.CHRG (FF48H)

H.RETU (FF4DH)

H.PRTF (FF52H)

H.COMP (FF57H)

H.FINP (FF5CH)

H.TRMN (FF61H)

H.FRME (FF66H)

H.NTPL (FF6BH)

H.EVAL (FF70H)

H.OKNO (FF75H)

H.FING (FF7AH)

H.ISMI (FF7FH)

H.WIDT (FF84H)

H.LIST (FF89H)

H.BUFL (FF8EH)

H.FRQI (FF93H)

H.SCNE (FF98H)

H.FRET (FF9DH)

H.PTRG (FFA2H)

H.PHYD (FFA7H)

H.FORM (FFACH)

H.ERRO (FFB1H)

H.LPTO (FFB6H)

H.LPTS (FFBBH)

H.SCRE (FFC0H)

 

Changes from the original