Инструменты пользователя

Инструменты сайта


msx:bios

Это старая версия документа!


MSX BIOS

Программы BIOS хранятся в ПЗУ.


Выражаем огромную благодарность А.Б. Родионову на предоставленную информацию!

BIOS

MSX BIOS Entry List

0010CHRGTRGets next char from BASIC text
0014WRSLTSel. appropriate slot & writes to memory
0018OUTDOOutputs to current device
001CCALSLTPerforms inter-slot call
0020DCOMPRCompares HL with DE
0024ENASLTSel. appropriate slot & enables it
0028GETYPRReturns type of FAC
002D–002FReserved area. Filled with zero
0030CALLFPerforms far-call (inter-slot) call
0038KEYINTPerforms hardware interrupt procedure
003BINITIOPerforms device initialisation
003EINIFNKInitializes function key strings
0041DISSCRDisables screen display
0044ENASCREnables screen display
0047WRTVDPWrites to VDP regirster
004ARDVRMReads VRAM addressed by HL
004DWRTVRMWrites to VRAM addressed by HL
0050SETRDSets up VDP for read
0053SETWRTSets up VDP for write
0056FILVRMFills VRAM with specified data
0059LDIRMVMoves a VRAM block to memory
005CLDIRVMMoves a memory block to VRAM
005FCHGMODSets VDP mode according to SCRMOD
0062CHGCLRChange color of screen
0066NMIPerforms non-maskable interrupt proc.
0069CLRSPRInitializes all sprites
006CINITXTInit.screen for TEXT1 & sets VDP
006FINIT32Init.screen for GRAPHIC1 & sets VDP
0072INIGRPInit.screen for GRAPHIC2 & sets VDP
0075INIMLTInit.screen for MULTICOLOR & sets VDP
0078SETTXTSets VDP for TEXT1
007BSETT32Sets VDP for GRAPHIC1
007ESETGRPSets VDP for GRAPHIC2
0081SETMLTSets VDP for MULTICOLOR
0084CALPATReturns address of sprite pattern table
0087CALATRReturns address of sprite attrib. table
008AGSPSIZReturns current sprite size
008DGRPPTRPrints a char on graphic screen
Routines used to access the PSG
0090GICINIInit. PSG & static data for PLAY stmt
0093WRTPSGWrites data to PSG register
0096RDPSGReads data from PSG register
0099STRTMSChecks/starts background tasks for PLAY
Routines used to access the KB & CRT
009CCHSNSChecks status of keyboard buffer
009FCHGETWaits for char_be_input & ret.its codes
00A2CHPUTOutputs char to console
00A5LPTOUTOutputs char to line printer
00A8LPTSTTChecks line printer status
00ABCNVCHRChecks grph_headr_byte & converts codes
00AEPINLINGet line_from_kb_till_CR & put to buff.
00B1INLINSame as PINLIN, except if AUTFLG is set
00B4QINLINOutputs '?' & SPбCE then falls to INLIN
00B7BREAKXChecks status of Control-STOP key
00BAISCNTCChecks status of SHIFT-STOP key
00BDCKCNTCSame as ISCNTC, used by BASIC
00C0BEEPSounds buzzer
00C3CLSClears screen
00C6POSITLocates cursor at specified position
00C9FNKSBChecks fun_key_displ_active? if so,does
00CCERAFNKErases function key display
00CFDSPFNKDisplays function key display
00D2TOTEXTForcibly places screen in text mode
00E1TAPIONSets motor on & reads header from tape
00E4TAPINInputs from tape
00E7TAPIOFStops reading from tape
00EATAPOONSets motor on & writes header to cas.
00EDTAPOUTOutputs to tape
00F0TAPOOFStops writing to tape
00F3STMOTRStarts cassette motor
Routines used to handle queues
00F6LFTQ
00F9PUTQPlaces byte in queue
Routines used by GENGRP & ADVGRP
00FCRIGHTCMoves one pixel right
00FFLEFTCMoves one pixel left
0102UPCMoves one pixel up
0105TUPCMoves one pixel up
0108DOWNCMoves one pixel down
010BTDOWNCMoves one pixel down
010ESCALXYScales X-Y coordinates
0111MAPXYCMaps coordinate to physical address
0114FETCHCFetches cur_phys_addr & mask pattern
0117STORECStores physical address & mask patrn
011ASETATRSets attribute byte
011DREADCReads attribute of current pixel
0120SETCSets cur_pixel to specified attribute
0123NSETCXSets pixel horizontally
0126GTASPCReturns the aspect ratio
0129PNTINIInitializes PAINT function
012CSCANRScans pixels to the right
012FSCANLScans pixels to the left
Additional entries
0132CHGCAPChanges status of CAP lamp
0135CHGSNDChanges status of 1 bit sound port
0138RSLREGReads current output to prim_slot_reg
013BWSLREGWrites to primary slot register
013ERDVDPReads VDP status register
0141SNSMATRet.status of specfd_row_of_kb_matrix
0144RHYDIOPerfrms oprtn for mass storag.devices
0147FORMATInitializes mass storage devices
014AISFLIOChecks if device I/O is being done
014DOUTDLPOutputs to line printer
0150GETVCPRet.addr_2nd_byte in spec_voice_buff
0153GETVC2Ret.addr_any_byte in spec_voice_buff
0156KILBUFClears keyboard buffer
0159CALBASPerforms inter-slot call into BASIC
MSX-2 additional entries
015CSUBROMPerforms inter-slot call into SUBROM
015FEXTROMPerforms inter-slot call into SUBROM
0162CHKSIZDoes slot scan for SUBROM
0165CHKNEWCheck screen mode
0168EOLErase to_end_of_line
016BBIGFILSame as FILVRM except few things
016E1NSETRDSet-up VDP to read
01741NRDVRMReads VRAM_addr_by_HL:valid all bits
0177NWRVRMWrites A to VRAM_addr_by_HL:v.al.bts

SUB-ROM

MSX SUBROM Entry List

Graphic handler for BASIC
0069PAINTPaints the graphic screen
006DPSETSets the point
0071ATRSCNScans color attribute
0075GLINEDraws a line
0079DOBOXFDraws a filled box
007DDOLINEDraws a line
0081BOXLINDraws a box
Low level graphics
0085DOGRPHDraws a line
0089GRPPRTPrints char on graphic screen
008DSCALXYScales X-Y coordinate
0091MAPXYCMaps coordinate to physical address
0095READCReads attribute of current pixel
0099SETATRSets attribute byte
009DSETCSets cur_pixel to specified attribute
00A1TRIGHTMoves one pixel right
00A5RIGHTCMoves one pixel right
00A9TLEFTCMoves one pixel left
00ADLEFTCMoves one pixel left
00B1TDOWNCMoves one pixel down
00B5DOWNCMoves one pixel down
00B9TUPCMoves one pixel up
00BDUPCMoves one pixel up
00C1SCANRScans pixels to the right
00C5SCANLScans pixels to the left
00C9NVBXLNDraws a box
00CDNVBXFLDraws a filled box
Access VDP
00D1CHGMODSets VDP mode according to SCRMOD
00D5INITXTInit.screen for TEXT1 & sets VDP
00D9INIT32Init.screen for GRAPHIC1 & sets VDP
00DDINIGRPInit.screen for GRAPHIC2 & sets VDP
00E1INIMLTInit.screen for MULTICOLOR & sets VDP
00E5SETTXTSets VDP for TEXT1
00E9SETT32Sets VDP for GRAPHIC1
00EDSETGRPSets VDP for GRAPHIC2
00F1SETMLTSets VDP for MULTICOLOR
00F5CLRSPRInitializes all sprites
00F9CALPATReturns address of sprite pattern table
00FDCALATRReturns address of sprite attrib. table
0101GSPSIZReturns current sprite size
0105GETPAT?
0109WRTVRMWrites to VRAM addressed by HL
010DRDVRMReads VRAM addressed by HL
0111CHGCLRChange color of screen
0115CLSClears screen
0119CLRTXTClears the text screen
011DDSPFNKDisplays function key display
0121DELLNODelets a line in text mode
0125INSLNOInserts a line in text mode
0129PUTVRMPut char in text screen
012DWRTVDPWrites to VDP regirster
0131VDPSTARead VDP status
Handle ROMA-KANA Conversion
0135KYKLOKHandle KANA key and lamp
0139PUTCHRGet_key_fr_KB & conv_it_KANA & put_Buff
Access VDP
013DSETPAGSet VDP registers to page changes
Access palette
0141INIPLTInit. palette and VRAM for pal_sav_area
0145RSTPLTRestore palette from VRAM
0149GETPLTGet color codes from palette
014DSETPLTSet color codes to palette
BASIC extended statement
0151PUTSPRPut sprites
0155COLORChange screen color, sprite color, palette
0159SCREENChange screen mode
015DWIDHTSChange text screen width
0161VDPSet VDP register
0165VDPFRead current VDP reg.
0169BASESet VDP bas registers
016DBASEFRead VDP bas registers
0171VPOKEWrite a byte to VRAM
0175VPEEKRead a byte from VRAM
0179SETSSets beep sound, scr adjust, time & data
Miscellaneous
017DBEEPBeeps buzzer
0181PROMPTDisplays prompt
Restore screen
0185SDFSCRRestore scr_param from RAM on clock chip
0189SETSCRRestore screen & print opening message
VRAM data transfer function
018DSCOPYCopies VRAM, array & disk file
0191BLTVVCopies VRAM to VRAM
0195BLTVMArray to VRAM
0199BLTMVVRAM to array
019DBLTVDDisk file to VRAM
01A1BLTDVVRAM to disk file
01A5BLTMDLoads array data from disk file
01A9BLTDMSaves array data to disk file
Mouse and Track ball
01ADNEWPADRead paddle, mouse & track ball
Miscellaneous
01B1GETPUTGet TIME & get DATE & PUT KANJI
01B5CHGMDPSets VDP mode according to SCRMOD
01B9RESV1Not used. Reserved
01BDKNJPRTPut kanji char to graphic scr(5–8)
Access clock chip
01F5REDCLKRead clock data
01F9WRTCLKWrite clock data

MSX 2 SUBROM BIOS Entries

DISK-ROM

FIXME

Disk Driver table

4010H (DISKIO)

Physical input/output for disk devices (See PHYDIO in main BIOS)

Input:

  • F = Carry set for write, carry reset for read
  • A = Drive number (0=A:)
  • B = Number of sectors to read/write
  • C = Media descriptor
    • F8h for 360K floppy disk, 3,5 inch, sigle-side, 9 sector
    • F9h for 720K floppy disk, 3,5 inch, double-side, 9 sector
    • FAh for 320K floppy disk, 3,5 inch, sigle-side, 8 sector
    • FBh for 640K floppy disk, 3,5 inch, double-side, 8 sector
    • FCh for 180K floppy disk, 5,25 inch, sigle-side, 9 sector
    • FDh for 360K floppy disk, 5,25 inch, double-side, 9 sector
    • FEh for 160K floppy disk, 5,25 inch, sigle-side, 8 sector
    • FFh for 320K floppy disk, 5,25 inch, double-side, 8 sector
  • DE = Logical sector number (starts at 0)
  • HL = Transfer address

Output:

  • F = Carry set on error, carry reset on success
  • A = If error: errorcode
  • B = Number of sectors transferred (always)

Error codes can be:

0Write protected
2Not ready
4Data (CRC) error
6Seek error
8Record not found
10Write fault
12Other error

4013H (DSKCHG)

Check if disk has been changed.

Input:

  • A = Drive number (0=A:)
  • B = Media descriptor
  • C = Media descriptor
  • HL = Base address of DPB

Output:

  • F = Carry set on error, carry reset on success
  • A = If error: errorcode (see DSKIO)
  • B = if success: 1=Disk not changed, 0=Unknown, -1=Disk changed

Note: If the disk has been changed or may have been changed (unknown) read the boot sector or the FAT sector for a disk media descriptor and transfer a new DPB as with GETDPB

4016H (GETDPB)

Get Drive Parameter Block

Input:

  • A = Drive number
  • B = First byte of FAT (media descriptor)
  • C = Media descriptor
  • HL = Base address of DPB

Output: HL+1 … HL+18 = DPB for specified drive

Note: DPB consists of

NameOffsetSizeDescription
MEDIA01Media type (F8..FF)
SECSIZ12Sector size (must be 2^n)
DIRMSK31(SECSIZE/32)-1
DIRSHFT41Number of one bits in DIRMSK
CLUSMSK51(Sectors per cluster)-1
CLUSSHFT61(Number of one bits in CLUSMSK)+1
FIRFAT72Logical sector number of first FAT
FATCNT81Number of FATs
MAXENTA1Number of directory entries (max 254)
FIRRECB2Logical sector number of first data
MAXCLUSD2(Number of clusters (not including reserved, FAT and directory sectors))+1
FATSIZF1Number of sectors used
FIRDIR102FAT logical sector number of start of directory

4019H (CHOICE)

Get string that describes disk formatting options.

Input: None

Output: HL = Address of zero terminated character string (ASCIIZ) with the text with choices for a DSKFMT If there is no choice (only 1 format supported) return HL = 0

401CH (DSKFMT)

Format disk

Input:

  • A = Choice specified by user (1-9). See CHOICE
  • D = Drive number (0=A:)
  • HL = Begin address of work area
  • BC = Length of work area

Output:

  • F = Carry flag reset on success, carry flag set on error
  • A = If error: errorcode

Error codes can be:

0Write protected
2Not ready
4Data (CRC) error
6Seek error
8Record not found
10Write fault
12Bad parameter
14Out of memory
16Other error

Notes: Also writes a MSX boot sector at sector 0, clears all FATs (media descriptor at first byte, 0FFh at second/third byte and rest zero) and clears the directory (filling it with zeros)

401FH (DSKSTP)

Stop the drive motor of the corresponding interface.

Input: None

Output: None

Modify: AF, BC, DE, HL, IX et IY.

Notes: Not all diskinterfaces support this entry. Only valid when 401FH <> 00H


Disk-ROM BIOS

Рабочая область

Some workspace in MSX work area

Диапазон Имя Длина
(дес./шест.)
Описание
F41F–F55CKBUF31813Etokenised form of input line in Direct Mode
F55E–F660BUF259103text from console collected by INLIN
F67A–F697TEMPST3001E stack for string descriptors
F6E8–F74BPARM1100064local variables of «FN» currently evaluted
F750–F7B3PARM2100064used to construct the local vars owned by current «FN»
F7BC–F7C3SWPTMP80081st operand of SWAP
F7C5–F7EFFBUFFR4302Btext produced during numeric output convertion
F7F6–F805DAC16010primary decimal accumulator
F806–F846HOLD865041for double precision multiplication
F847–F856ARG16010secondary decimal accumulator
F857–F85ERNDX8008current double precision random number
F866–F870FILNAM1100Buser-specified filename
F871–F87BFILNM21100Bfilename from I/O device for comparsion with FILNAM
F87F–F91EFNKSTR1600A010 function key strings
F959–F970QUETAB24018parameters for VOICAQ, VOICBQ, VOICCQ and RS232
F971–F974QUEBAK4004putback characters for queues (unused)
F975–F9F4VOICAQ128080voice A queue
F9F5–FA74VOICBQ128080voice B queue
FA75–FAF4VOICCQ128080voice C queue
FAF5–FB35RS2IQ64040RS232 queue
FB41–FB65VCBA37025current parameters for voice A
FB66–FB8AVCBB37025current parameters for voice B
FB8B–FBAFVCBC37025current parameters for voice C
FBB2–FBC9LINTTB24018overflow of screen line
FBCE–FBD7FNKFLG1000Anormally zero, 1 for KEY(n) ON
FBF0–FC17KEYBUF40028circular queue driven by GETPNT & PUTPNT
FC18–FC3FLINWRK40028complete line of screen characters
FC40–FC47PATWRK80088×8 pixel pattern
FC4C–FC81TRPTBL51033(17×3) current state of interrupt generated devices
FC82–FC99 24018rest of TRPTBL (unused)
FD09–FD88SLTWRK12808064×2 bytes workspaces for each of 64 possible slots
FD89–FD98PROCNM16010device or statement name of extension ROM
FD9A–FFC9HKEYI560230hooks
FFCA–…

Ссылки

msx/bios.1651238446.txt.gz · Последние изменения: 2022-04-29 16:20 — GreyWolf