Это старая версия документа!
Программы BIOS хранятся в ПЗУ.
Выражаем огромную благодарность А.Б. Родионову на предоставленную информацию!
MSX BIOS Entry List
0010 | CHRGTR | Gets next char from BASIC text |
0014 | WRSLT | Sel. appropriate slot & writes to memory |
0018 | OUTDO | Outputs to current device |
001C | CALSLT | Performs inter-slot call |
0020 | DCOMPR | Compares HL with DE |
0024 | ENASLT | Sel. appropriate slot & enables it |
0028 | GETYPR | Returns type of FAC |
002D–002F | Reserved area. Filled with zero | |
0030 | CALLF | Performs far-call (inter-slot) call |
0038 | KEYINT | Performs hardware interrupt procedure |
003B | INITIO | Performs device initialisation |
003E | INIFNK | Initializes function key strings |
0041 | DISSCR | Disables screen display |
0044 | ENASCR | Enables screen display |
0047 | WRTVDP | Writes to VDP regirster |
004A | RDVRM | Reads VRAM addressed by HL |
004D | WRTVRM | Writes to VRAM addressed by HL |
0050 | SETRD | Sets up VDP for read |
0053 | SETWRT | Sets up VDP for write |
0056 | FILVRM | Fills VRAM with specified data |
0059 | LDIRMV | Moves a VRAM block to memory |
005C | LDIRVM | Moves a memory block to VRAM |
005F | CHGMOD | Sets VDP mode according to SCRMOD |
0062 | CHGCLR | Change color of screen |
0066 | NMI | Performs non-maskable interrupt proc. |
0069 | CLRSPR | Initializes all sprites |
006C | INITXT | Init.screen for TEXT1 & sets VDP |
006F | INIT32 | Init.screen for GRAPHIC1 & sets VDP |
0072 | INIGRP | Init.screen for GRAPHIC2 & sets VDP |
0075 | INIMLT | Init.screen for MULTICOLOR & sets VDP |
0078 | SETTXT | Sets VDP for TEXT1 |
007B | SETT32 | Sets VDP for GRAPHIC1 |
007E | SETGRP | Sets VDP for GRAPHIC2 |
0081 | SETMLT | Sets VDP for MULTICOLOR |
0084 | CALPAT | Returns address of sprite pattern table |
0087 | CALATR | Returns address of sprite attrib. table |
008A | GSPSIZ | Returns current sprite size |
008D | GRPPTR | Prints a char on graphic screen |
Routines used to access the PSG | ||
---|---|---|
0090 | GICINI | Init. PSG & static data for PLAY stmt |
0093 | WRTPSG | Writes data to PSG register |
0096 | RDPSG | Reads data from PSG register |
0099 | STRTMS | Checks/starts background tasks for PLAY |
Routines used to access the KB & CRT | ||
009C | CHSNS | Checks status of keyboard buffer |
009F | CHGET | Waits for char_be_input & ret.its codes |
00A2 | CHPUT | Outputs char to console |
00A5 | LPTOUT | Outputs char to line printer |
00A8 | LPTSTT | Checks line printer status |
00AB | CNVCHR | Checks grph_headr_byte & converts codes |
00AE | PINLIN | Get line_from_kb_till_CR & put to buff. |
00B1 | INLIN | Same as PINLIN, except if AUTFLG is set |
00B4 | QINLIN | Outputs '?' & SPбCE then falls to INLIN |
00B7 | BREAKX | Checks status of Control-STOP key |
00BA | ISCNTC | Checks status of SHIFT-STOP key |
00BD | CKCNTC | Same as ISCNTC, used by BASIC |
00C0 | BEEP | Sounds buzzer |
00C3 | CLS | Clears screen |
00C6 | POSIT | Locates cursor at specified position |
00C9 | FNKSB | Checks fun_key_displ_active? if so,does |
00CC | ERAFNK | Erases function key display |
00CF | DSPFNK | Displays function key display |
00D2 | TOTEXT | Forcibly places screen in text mode |
00E1 | TAPION | Sets motor on & reads header from tape |
00E4 | TAPIN | Inputs from tape |
00E7 | TAPIOF | Stops reading from tape |
00EA | TAPOON | Sets motor on & writes header to cas. |
00ED | TAPOUT | Outputs to tape |
00F0 | TAPOOF | Stops writing to tape |
00F3 | STMOTR | Starts cassette motor |
Routines used to handle queues | ||
---|---|---|
00F6 | LFTQ | |
00F9 | PUTQ | Places byte in queue |
Routines used by GENGRP & ADVGRP | ||
00FC | RIGHTC | Moves one pixel right |
00FF | LEFTC | Moves one pixel left |
0102 | UPC | Moves one pixel up |
0105 | TUPC | Moves one pixel up |
0108 | DOWNC | Moves one pixel down |
010B | TDOWNC | Moves one pixel down |
010E | SCALXY | Scales X-Y coordinates |
0111 | MAPXYC | Maps coordinate to physical address |
0114 | FETCHC | Fetches cur_phys_addr & mask pattern |
0117 | STOREC | Stores physical address & mask patrn |
011A | SETATR | Sets attribute byte |
011D | READC | Reads attribute of current pixel |
0120 | SETC | Sets cur_pixel to specified attribute |
0123 | NSETCX | Sets pixel horizontally |
0126 | GTASPC | Returns the aspect ratio |
0129 | PNTINI | Initializes PAINT function |
012C | SCANR | Scans pixels to the right |
012F | SCANL | Scans pixels to the left |
Additional entries | ||
0132 | CHGCAP | Changes status of CAP lamp |
0135 | CHGSND | Changes status of 1 bit sound port |
0138 | RSLREG | Reads current output to prim_slot_reg |
013B | WSLREG | Writes to primary slot register |
013E | RDVDP | Reads VDP status register |
0141 | SNSMAT | Ret.status of specfd_row_of_kb_matrix |
0144 | RHYDIO | Perfrms oprtn for mass storag.devices |
0147 | FORMAT | Initializes mass storage devices |
014A | ISFLIO | Checks if device I/O is being done |
014D | OUTDLP | Outputs to line printer |
0150 | GETVCP | Ret.addr_2nd_byte in spec_voice_buff |
0153 | GETVC2 | Ret.addr_any_byte in spec_voice_buff |
0156 | KILBUF | Clears keyboard buffer |
0159 | CALBAS | Performs inter-slot call into BASIC |
MSX-2 additional entries | ||
015C | SUBROM | Performs inter-slot call into SUBROM |
015F | EXTROM | Performs inter-slot call into SUBROM |
0162 | CHKSIZ | Does slot scan for SUBROM |
0165 | CHKNEW | Check screen mode |
0168 | EOL | Erase to_end_of_line |
016B | BIGFIL | Same as FILVRM except few things |
016E | 1NSETRD | Set-up VDP to read |
0174 | 1NRDVRM | Reads VRAM_addr_by_HL:valid all bits |
0177 | NWRVRM | Writes A to VRAM_addr_by_HL:v.al.bts |
Slot ID (or slot address) is MSX-BIOS way to represent the slot and sub-slot location in a byte. The byte contains following info:
bit 0-1 | Primary slot number |
bit 2-3 | Sub slot number (optional) |
bit 4-6 | Unused |
bit 7 = 1 | if Slot is expanded |
an example to interpret this from pascal is as follows:
procedure slotID(nValue:byte); (** nValue is for example mem[$F344] **) var num,num2: byte; exp : boolean; begin; num:=nValue; num:= (num shl 6); num:= (num shr 6); if ((nValue and 128) = 128) then exp:=True else exp:=false; num2:=nValue; num2:=(num2 shl 4); num2:=(num2 shr 6); writeln('Slot-ID',num); writeln('subslot:',num2); writeln('expanded:',exp); end;
MSX SUBROM Entry List
Graphic handler for BASIC | ||
---|---|---|
0069 | PAINT | Paints the graphic screen |
006D | PSET | Sets the point |
0071 | ATRSCN | Scans color attribute |
0075 | GLINE | Draws a line |
0079 | DOBOXF | Draws a filled box |
007D | DOLINE | Draws a line |
0081 | BOXLIN | Draws a box |
Low level graphics | ||
0085 | DOGRPH | Draws a line |
0089 | GRPPRT | Prints char on graphic screen |
008D | SCALXY | Scales X-Y coordinate |
0091 | MAPXYC | Maps coordinate to physical address |
0095 | READC | Reads attribute of current pixel |
0099 | SETATR | Sets attribute byte |
009D | SETC | Sets cur_pixel to specified attribute |
00A1 | TRIGHT | Moves one pixel right |
00A5 | RIGHTC | Moves one pixel right |
00A9 | TLEFTC | Moves one pixel left |
00AD | LEFTC | Moves one pixel left |
00B1 | TDOWNC | Moves one pixel down |
00B5 | DOWNC | Moves one pixel down |
00B9 | TUPC | Moves one pixel up |
00BD | UPC | Moves one pixel up |
00C1 | SCANR | Scans pixels to the right |
00C5 | SCANL | Scans pixels to the left |
00C9 | NVBXLN | Draws a box |
00CD | NVBXFL | Draws a filled box |
Access VDP | ||
00D1 | CHGMOD | Sets VDP mode according to SCRMOD |
00D5 | INITXT | Init.screen for TEXT1 & sets VDP |
00D9 | INIT32 | Init.screen for GRAPHIC1 & sets VDP |
00DD | INIGRP | Init.screen for GRAPHIC2 & sets VDP |
00E1 | INIMLT | Init.screen for MULTICOLOR & sets VDP |
00E5 | SETTXT | Sets VDP for TEXT1 |
00E9 | SETT32 | Sets VDP for GRAPHIC1 |
00ED | SETGRP | Sets VDP for GRAPHIC2 |
00F1 | SETMLT | Sets VDP for MULTICOLOR |
00F5 | CLRSPR | Initializes all sprites |
00F9 | CALPAT | Returns address of sprite pattern table |
00FD | CALATR | Returns address of sprite attrib. table |
0101 | GSPSIZ | Returns current sprite size |
0105 | GETPAT | ? |
0109 | WRTVRM | Writes to VRAM addressed by HL |
010D | RDVRM | Reads VRAM addressed by HL |
0111 | CHGCLR | Change color of screen |
0115 | CLS | Clears screen |
0119 | CLRTXT | Clears the text screen |
011D | DSPFNK | Displays function key display |
0121 | DELLNO | Delets a line in text mode |
0125 | INSLNO | Inserts a line in text mode |
0129 | PUTVRM | Put char in text screen |
012D | WRTVDP | Writes to VDP regirster |
0131 | VDPSTA | Read VDP status |
Handle ROMA-KANA Conversion | ||
---|---|---|
0135 | KYKLOK | Handle KANA key and lamp |
0139 | PUTCHR | Get_key_fr_KB & conv_it_KANA & put_Buff |
Access VDP | ||
013D | SETPAG | Set VDP registers to page changes |
Access palette | ||
0141 | INIPLT | Init. palette and VRAM for pal_sav_area |
0145 | RSTPLT | Restore palette from VRAM |
0149 | GETPLT | Get color codes from palette |
014D | SETPLT | Set color codes to palette |
BASIC extended statement | ||
0151 | PUTSPR | Put sprites |
0155 | COLOR | Change screen color, sprite color, palette |
0159 | SCREEN | Change screen mode |
015D | WIDHTS | Change text screen width |
0161 | VDP | Set VDP register |
0165 | VDPF | Read current VDP reg. |
0169 | BASE | Set VDP bas registers |
016D | BASEF | Read VDP bas registers |
0171 | VPOKE | Write a byte to VRAM |
0175 | VPEEK | Read a byte from VRAM |
0179 | SETS | Sets beep sound, scr adjust, time & data |
Miscellaneous | ||
017D | BEEP | Beeps buzzer |
0181 | PROMPT | Displays prompt |
Restore screen | ||
0185 | SDFSCR | Restore scr_param from RAM on clock chip |
0189 | SETSCR | Restore screen & print opening message |
VRAM data transfer function | ||
018D | SCOPY | Copies VRAM, array & disk file |
0191 | BLTVV | Copies VRAM to VRAM |
0195 | BLTVM | Array to VRAM |
0199 | BLTMV | VRAM to array |
019D | BLTVD | Disk file to VRAM |
01A1 | BLTDV | VRAM to disk file |
01A5 | BLTMD | Loads array data from disk file |
01A9 | BLTDM | Saves array data to disk file |
Mouse and Track ball | ||
01AD | NEWPAD | Read paddle, mouse & track ball |
Miscellaneous | ||
01B1 | GETPUT | Get TIME & get DATE & PUT KANJI |
01B5 | CHGMDP | Sets VDP mode according to SCRMOD |
01B9 | RESV1 | Not used. Reserved |
01BD | KNJPRT | Put kanji char to graphic scr(5–8) |
Access clock chip | ||
01F5 | REDCLK | Read clock data |
01F9 | WRTCLK | Write clock data |
Physical input/output for disk devices (See PHYDIO in main BIOS)
Input:
Output:
Error codes can be:
0 | Write protected |
2 | Not ready |
4 | Data (CRC) error |
6 | Seek error |
8 | Record not found |
10 | Write fault |
12 | Other error |
Check if disk has been changed.
Input:
Output:
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
Get Drive Parameter Block
Input:
Output: HL+1 … HL+18 = DPB for specified drive
Note: DPB consists of
Name | Offset | Size | Description |
---|---|---|---|
MEDIA | 0 | 1 | Media type (F8..FF) |
SECSIZ | 1 | 2 | Sector size (must be 2^n) |
DIRMSK | 3 | 1 | (SECSIZE/32)-1 |
DIRSHFT | 4 | 1 | Number of one bits in DIRMSK |
CLUSMSK | 5 | 1 | (Sectors per cluster)-1 |
CLUSSHFT | 6 | 1 | (Number of one bits in CLUSMSK)+1 |
FIRFAT | 7 | 2 | Logical sector number of first FAT |
FATCNT | 8 | 1 | Number of FATs |
MAXENT | A | 1 | Number of directory entries (max 254) |
FIRREC | B | 2 | Logical sector number of first data |
MAXCLUS | D | 2 | (Number of clusters (not including reserved, FAT and directory sectors))+1 |
FATSIZ | F | 1 | Number of sectors used |
FIRDIR | 10 | 2 | FAT logical sector number of start of directory |
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
Format disk
Input:
Output:
Error codes can be:
0 | Write protected |
2 | Not ready |
4 | Data (CRC) error |
6 | Seek error |
8 | Record not found |
10 | Write fault |
12 | Bad parameter |
14 | Out of memory |
16 | Other 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)
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
BASIC cold start. Start the Basic environment and eventually run a file of Basic program from a program in machine language.
Set the variable REBOOT (0F340h) to 0 to run the AUTOEXEC.BAS file (at the root of the disk). Otherwise, there will be a return to Basic. Under MSX-DOS, when the REBOOT variable (0F340h) contains a value other than 0 it is possible to run another Basic program whose file name and length is specified in DTA (0080h).
Input: None
Output: None (Does not return)
Examples:
; Quit your DOS program and launch a BASIC program saved as NAME.BAS CALSLT equ 001Ch DTA equ 0080h BASENT equ 04022h REBOOT equ 0F340h MASTER equ 0F348h org 0100h ld a,1 ; Not 0 to ignore the AUTOEXEC.BAS if present ld (REBOOT),a ld hl,NAME ld de,DTA ld bc,END-NAME ldir ; Copy the file name ld ix,BASENT ld iy,(MASTER-1) ; Slot of the Master Disk-ROM jp CALSLT NAME: db END-NAME ; Length db "NAME.BAS",0 END:
; Quit your DOS program and go to BASIC CALSLT equ 001Ch DTA equ 0080h BASENT equ 04022h REBOOT equ 0F340h TEMPST equ 0F67Ah MASTER equ 0F348h org 0100h ld a,1 ; Not 0 to ignore the AUTOEXEC.BAS if present ld (REBOOT),a ld a,0 ld (DTA),a ; No file name ld ix,(TEMPST) ; Erases 3 bytes ld (ix),0 ; from the ld (ix+1),0 ; area reserved for ld (ix+2),0 ; the BASIC program ld ix,BASENT ld iy,(MASTER-1) ; Slot of the Master Disk-ROM jp CALSLT
; Quit your DOS program and launch the AUTOEXEC.BAS under BASIC CALSLT equ 001Ch BASENT equ 04022h REBOOT equ 0F340h TEMPST equ 0F67Ah MASTER equ 0F348h org 0100h ld a,0 ; 0 to run the AUTOEXEC.BAS file ld (REBOOT),a ld ix,(TEMPST) ; Erases 3 bytes ld (ix),0 ; from the ld (ix+1),0 ; area reserved for ld (ix+2),0 ; the BASIC program ld ix,BASENT ld iy,(MASTER-1) ; Slot of the Master Disk-ROM jp CALSLT
ENASLT equ 0024H MASTER equ 0F348H BASENT equ 04022H LD A,(MASTER) LD H,40H CALL ENASLT JP BASENT
Format a disk in BASIC by asking the user for settings.
This routine sets the Carry flag to 1 and then calls the FORMTK (04026h) routine below.
Input: None
Output: None
Note: This is interactive process with user (prompts for drive and format choice)
Format a disk from a program with user-specified parameters.
Input:
Output: None
Stop all drives of all controllers
Input: None
Output: None
Modify: AF, BC, DE, HL, IX et IY.
Note: This routine only exists if the interface manages removable disks. Otherwise, 04029h will contain the zero byte (00h). Some HDD interfaces have wrongly implemented this as a HDD powerdown (HSH/MAK)
Get MSX-DOS system bottom
Input: None
Output: HL = Lowest address used by the base MSX-DOS system
Some workspace in MSX work area
Диапазон | Имя | Длина (дес./шест.) | Описание | |
---|---|---|---|---|
F41F–F55C | KBUF | 318 | 13E | tokenised form of input line in Direct Mode |
F55E–F660 | BUF | 259 | 103 | text from console collected by INLIN |
F67A–F697 | TEMPST | 30 | 01E | stack for string descriptors |
F6E8–F74B | PARM1 | 100 | 064 | local variables of «FN» currently evaluted |
F750–F7B3 | PARM2 | 100 | 064 | used to construct the local vars owned by current «FN» |
F7BC–F7C3 | SWPTMP | 8 | 008 | 1st operand of SWAP |
F7C5–F7EF | FBUFFR | 43 | 02B | text produced during numeric output convertion |
F7F6–F805 | DAC | 16 | 010 | primary decimal accumulator |
F806–F846 | HOLD8 | 65 | 041 | for double precision multiplication |
F847–F856 | ARG | 16 | 010 | secondary decimal accumulator |
F857–F85E | RNDX | 8 | 008 | current double precision random number |
F866–F870 | FILNAM | 11 | 00B | user-specified filename |
F871–F87B | FILNM2 | 11 | 00B | filename from I/O device for comparsion with FILNAM |
F87F–F91E | FNKSTR | 160 | 0A0 | 10 function key strings |
F959–F970 | QUETAB | 24 | 018 | parameters for VOICAQ, VOICBQ, VOICCQ and RS232 |
F971–F974 | QUEBAK | 4 | 004 | putback characters for queues (unused) |
F975–F9F4 | VOICAQ | 128 | 080 | voice A queue |
F9F5–FA74 | VOICBQ | 128 | 080 | voice B queue |
FA75–FAF4 | VOICCQ | 128 | 080 | voice C queue |
FAF5–FB35 | RS2IQ | 64 | 040 | RS232 queue |
FB41–FB65 | VCBA | 37 | 025 | current parameters for voice A |
FB66–FB8A | VCBB | 37 | 025 | current parameters for voice B |
FB8B–FBAF | VCBC | 37 | 025 | current parameters for voice C |
FBB2–FBC9 | LINTTB | 24 | 018 | overflow of screen line |
FBCE–FBD7 | FNKFLG | 10 | 00A | normally zero, 1 for KEY(n) ON |
FBF0–FC17 | KEYBUF | 40 | 028 | circular queue driven by GETPNT & PUTPNT |
FC18–FC3F | LINWRK | 40 | 028 | complete line of screen characters |
FC40–FC47 | PATWRK | 8 | 008 | 8×8 pixel pattern |
FC4C–FC81 | TRPTBL | 51 | 033 | (17×3) current state of interrupt generated devices |
FC82–FC99 | 24 | 018 | rest of TRPTBL (unused) | |
FD09–FD88 | SLTWRK | 128 | 080 | 64×2 bytes workspaces for each of 64 possible slots |
FD89–FD98 | PROCNM | 16 | 010 | device or statement name of extension ROM |
FD9A–FFC9 | HKEYI | 560 | 230 | hooks |
FFCA–… |