Contents |
Main BIOS (Basic Input/Output System)
The main BIOS is a set of routines designed to allow the programmer to access to the hardware without it being always the same. The BIOS is composed of routines in ROM which mainly allow to access in the same way to more or less different devices.
0000h (STARTUP) (called CHKRAM at first)
Function: | Initializes the MSX. (Search for memory, initialization of system variables, etc.) |
Entry: | None |
Output: | None |
Modify: | All Registers |
Notes: | This routine is the first to be executed when the MSX is switched on. Here is a summary of what the routine does.
MSX1:
MSX2:
MSX2+:
MSX Turbo R:
|
Slots and Basic interpreter
0008h (SYNCHR)
Function: | Compares whether the character pointed by HL with thespecified character behind RST 8. If same, it executs theroutine CHRGTR (4666h, not 0010h), otherwise it executs theroutine of error treatment of Basic interpreter. |
Entry: | HL = Address of character to compareComparison character must be behind RST 8 instruction.
Example: ld hl,LETTER rst 08h db "A" rst 08h db "B" ret LETTER: db "AB" |
Output: | HL is increased by one and A receives [HL]. When the testedcharacter is numerical, the CY flag is set; the end of thestatement 00H or 3Ah) causes the Z flag to be set. |
Modify: | AF, HL |
000Ch (RDSLT)
Function: | Reads one byte from memory of the slot specified. |
Entry: | A = Slot ID to read (F000EEPP format) HL = Address of byte to read (from 0000h to BFFFh) |
Output: | A = Byte read |
Modify: | AF, BC, DE |
Notes: |
|
0010h (CHRGTR)
Function: | Gets a character (or a token) from BASIC text |
Entry: | HL = Address of the character to be read (pointer) |
Output: | HL = HL incremented by one A = New character pointed by HL F = When the character is numerical, the CY flag is set; The instruction end (00h or ":") sets the Z flag. |
Modify: | AF, HL |
Notes: |
|
0014h (WRSLT)
Function: | Writes one byte to memory of the slot specified. |
Entry: | A = Slot ID E = Byte to write HL = Writing address (from 0000h to BFFFh) |
Output: | None |
Modify: | AF, BC, D |
Notes: |
|
0018h (OUTDO)
Function: | Sends one character to current device. |
Entry: | A = Character to sent. PRTFLG (0F416h) = Must be different from zero to sends output to the printer or disk. PTRFIL (0F864h) = Address of data file to sends the character. If 0000h, the character is sent to printer. |
Output: | None |
Modify: | None |
Note: | Call the Hook H.OUTD (0FEE4h). |
001Ch (CALSLT)
Function: | Calls the routine in another slot (inter-slot call) |
Entry: | IX = Address to call IY = Slot ID |
Output: | Depends on the calling routine. |
Modify: | AF, IX, IY, auxiliary registers, and other registers depending on thecalling routine |
Notes: |
|
0020h (DCOMPR)
Function: | Compares the contents of HL and DE |
Entry: | HL, DE |
Output: | F = Sets the Z flag if HL = DE; CY flag if HL < DE |
Modify: | AF |
0024h (ENASLT)
Function: | Selects the specified slot. |
Entry: | HL = Page to select the slot A = Slot ID to select |
Output: | None |
Modify: | All Registers |
Notes: |
|
Example: | ; Back to Basic from MSX-DOS MNROM equ 0FCC1h ENASLT equ 00024h RETURN equ 0409Bh org 0D000h DEBUT: ld a,(MNROM) ld h,0 call ENASLT ; Select main ROM on page 0000H~3FFFh ld a,(MNROM) ld h,040h call ENASLT ; Select main ROM on page 4000H~7FFFh jp RETURN ; |
0028h (GETYPR)
Function: | Returns the type of DAC (decimal accumulator). |
Entry: | None. |
Output: | F = S, Z, P/V flags are changed depending on the type of DAC:
integer type single precision real type C = 1 C = 1 S = 1 * S = 0 Z = 0 Z = 0 P/V = 1 P/V = 0 * string type double precision real type C = 1 C = 0 * S = 0 S = 0 Z = 1 * Z = 0 P/V = 1 P/V = 1 Types can be recognised by the flag marked by "*". |
Modify: | AF |
Note: | The Main-Rom must be selected in the page 4000h~7FFFh to call this routine. |
0030h (CALLF)
Function: | Calls the routine in another slot. |
Entry: | Calling sequence:
RST 30H DB n ;n is the slot number (same as RDSLT) DW nn ;nn is the called address |
Output: | Depends on the calling routine |
Modify: | AF, IX, IY, auxiliary registers, and other registers depending on thecalling routine |
Notes: |
|
0038h (KEYINT)
Function: | Interrupt process routine. |
Entry: | None |
Output: | None |
Notes: |
|
003Bh (INITIO)
Function: | Initialises the devices. |
Entry: | None |
Output: | None |
Modify: | All Registers |
VDP
003Eh (INIFNK)
Function: | Initialises the contents of function keys |
Entry: | None |
Output: | None |
Modify: | All Registers |
Note: | VDP access. |
0041h (DISSCR)
Function: | Inhibits the screen display |
Entry: | None |
Output: | None |
Modify: | AF, BC |
0044h (ENASCR)
Function: | Displays the screen |
Entry: | None |
Output: | None |
Modify: | AF, BC |
0047h (WRTVDP)
Function: | Writes data in the VDP register |
Entry: | C = Register number (0~7 on MSX1; 0~23, 32~46 on MSX2; 0~25, 32~46 on MSX2+/Turbo R) B = value to write |
Output: | None |
Modify: | AF, B |
Note: | Call Sub-ROM on MSX2 or later if the bit EV of VDP register 0 is changed or if register number is greater than 7. |
004Ah (RDVRM)
Function: | Reads the contents of VRAM. |
Entry: | HL = VRAM address to read (00000h~03FFFh) |
Output: | A = Value read at VRAM address |
Modify: | AF |
Note: | Routine for MSX1, so only the 14 low order bits of the VRAM address are valid. To use all bits, call NRDVRM (00174h). |
004Dh (WRTVRM)
Function: | Writes a data in VRAM. |
Entry: | HL = VRAM address to write data (00000h~03FFFh) A = Data |
Output: | None |
Modify: | None |
Note: | Routine for MSX1, so only the 14 low order bits of the VRAM address are valid. To use all bits, call NWRVRM (00177h). |
0050h (SETRD)
Function: | Sets VRAM address to read a byte or more. This isused to read data from the sequential VRAM area by using the address auto-increment function of VDP. This enables faster readout than using RDVRM in a loop. |
Entry: | HL = VRAM address (00000h~03FFFh) |
Output: | None |
Modify: | AF |
Note: | Routine for MSX1, so only the 14 low order bits of the VRAM address are valid. To use all bits, call NSETRD (0016Eh). |
Example: | ;Read 4 bytes from VRAM VDP.DR equ 0006h ld hl,0 ;VRAM address call SETWRT ld hl,DATA ld b,7 ;Text length ld a,(VDP.DR) ;Data read port ld c,a LOOP: ini ;You can replace this two jr nz,LOOP ;lines with inir on MSX2/2+/turbo R ret DATA: db 0,0,0,0 ;Data read from VRAM are stored here |
0053h (SETWRT)
Function: | Sets VRAM address to write or more. The purpose is the same as SETRD. |
Entry: | HL for VRAM address (00000h~03FFFh) |
Output: | None |
Modify: | AF |
Note: | Routine for MSX1, so only the 14 low order bits of the VRAM address are valid. To use all bits, call NSTWRT (00171h). |
Example: | ;Print "Hello!" at the top left of the screen (SCREEN1) VDP.DW equ 0007h ld hl,(T32NAM) ;Characters table address in SCREEN1 call SETWRT ld hl,TXT ld b,7 ;Text length ld a,(VDP.DW) ;Data write port ld c,a HELLO: outi ;You can replace this two jr nz,HELLO ;lines with otir on MSX2/2+/turbo R ret TXT: db "Hello!" |
0056h (FILVRM)
Function: | fills the specified VRAM area with the same data. |
Entry: | HL = VRAM address to begin writing BC = The length of the area to be written A = Data |
Output: | None |
Modify: | AF, BC |
Note: | Routine for MSX1, so only the 14 low order bits of the VRAM address are valid. To use all bits, call BIGFIL (0016Bh). |
0059h (LDIRMV)
Function: | block transfer from VRAM to memory |
Entry: | HL = Source address in VRAM (00000h~03FFFh ou 0FFFFh) DE = Destination address in main Ram (00000h~0FFFFh) BC = Length (00000h~0FFFFh). |
Output: | None |
Modify: | All Registers |
Note: | In screen modes other than MSX1. The variable ACPAGE (0FAF6h) indicates the page from which the transfer must take place. |
005Ch (LDIRVM)
Function: | block transfer from memory to VRAM |
Entry: | HL = Source address in Ram (00000h~0FFFFh) DE = Destination address in VRAM (00000h~03FFFh ou 0FFFFh) BC = Length (00000h~0FFFFh) |
Output: | None |
Modify: | All Registers |
Note: | In screen modes other than MSX1. The variable ACPAGE (0FAF6h) indicates the page from which the transfer must take place. |
005Fh (CHGMOD)
Function: | Changes the screen mode. The palette is not initialised. Toinitialise it, see CHGMDP in SUB-ROM. |
Entry: | A = Screen mode (0~3, 0~8 or 0~8/12, 9 Korean MSX2 only) |
Output: | None |
Modify: | All Registers |
Note: | Colors palette is not initialized by this routine, call the routine CHGMDP (001B5h in Sub-ROM) if you need to initialize the palette. |
0062h (CHGCLR)
Function: | Changes the colours of screen |
Entry: | A = Screen mode FORCLR (F3E9h) = foreground color BAKCLR (F3EAh) = background color BDRCLR (F3EBh) = border colour |
Output: | None |
Modify: | All Registers |
Note: | Same function as CHGCLR (00111h in Sub-ROM) |
0066h (NMI)
Function: | NMI (Non-Maskable Interrupt) handling routine |
Entry: | None |
Output: | None |
Modify: | ? |
Note: | This routine is used at start on MSX turbo R only. |
0069h (CLRSPR)
Function: | Initialises all sprites. The sprite patterns are cleared to null, the sprite number to the sprite plane number, the sprites colour define with FORCLR (0F3E9h). The vertical ordinate of sprites are set to 209 (screen mode 0 to 3) or 217 (mode 4 to 8). |
Entry: | None |
Output: | None |
Modify: | All Registers |
006Ch (INITXT)
Function: | Initialises the screen to TEXT1 mode (40 x 24). In thisRoutine, the palette is not initialised. To initialise thepalette, call INIPLT in SUB-ROM after this call. |
Entry: | TXTNAM (F3B3h) = Address of pattern name table TXTCGP (F3B7h) = Address of pattern generator table LINL40 (F3AEh) = Character per line FORCLR (0F3E9h) = Text color BAKCLR (0F3EAh) = Background color BDRCLR (F3EBh) = Border colour |
Output: | None |
Modify: | All Registers |
Note: | The palette is not initialized by this routine. If you want to initialize the palette, call the routine INIPLT (00141h) in Sub-ROM just after this one. |
006Fh (INIT32)
Function: | Initialises the screen to GRAPHIC1 mode (32x24). In thisRoutine, the palette is not initialised. |
Entry: | T32NAM (F3BDh) = Address of pattern name table T32COL (F3BFh) = Address of colors table T32CGP (F3C1h) = Address of pattern generator table T32ATR (F3C3h) = Address of sprite attribute table T32PAT (F3C5h) = Address of sprite generator table FORCLR (0F3E9h) = Text color BAKCLR (0F3EAh) = Background color BDRCLR (0F3EBh) = Border color |
Output: | None |
Modify: | All Registers |
Note: | The palette is not initialized by this routine. If you want to initialize the palette, call the routine INIPLT (00141h) in Sub-ROM just after this one. |
0072h (INIGRP)
Function: | Initialises the screen to the high-resolution graphics mode.In this routine, the palette is not initialised. |
Entry: | GRPNAM (F3C7h) = Address of pattern name table GRPCOL (F3C9h) = Address of colors table GRPCGP (F3CBh) = Address of pattern generator table GRPATR (F3CDh) = Address of sprite attribute table GRPPAT (F3CFh) = Address of sprite generator table FORCLR (0F3E9h) = Text color BAKCLR (0F3EAh) = Background color BDRCLR (0F3EBh) = Border color |
Output: | None |
Modify: | All Registers |
Note: | The palette is not initialized by this routine. If you want to initialize the palette, call the routine INIPLT (00141h) in Sub-ROM just after this one. |
0075h (INIMLT)
Function: | Initialises the screen to MULTI colour mode. In this routine,the palette is not initialised. |
Entry: | MLTNAM (F3D1h) = Address of pattern name table MLTCOL (F3D3h) = Address of colors table MLTCGP (F3D5h) = Address of pattern generator table MLTATR (F3D7h) = Address of sprite attribute table MLTPAT (F3D9h) = Address of sprite generator table FORCLR (0F3E9h) = Text color BAKCLR (0F3EAh) = Background color BDRCLR (0F3EBh) = Border color |
Output: | None |
Modify: | All Registers |
Note: | The palette is not initialized by this routine. If you want to initialize the palette, call the routine INIPLT (00141h) in Sub-ROM just after this one. |
0078h (SETTXT)
Function: | Set only VDP in TEXT1 mode (40x24, SCREEN0) without initializing the tables. |
Entry: | TXTNAM (0F3B3h) = Address of pattern table TXTCGP (0F3B7h) = Address of the shape table. |
Output: | None |
Modify: | All Registers |
Note: | same as INITXT |
007Bh (SETT32)
Function: | Set only VDP in GRAPHIC1 mode (32x24, SCREEN1) without initializing the tables. |
Entry: | T32NAM (F3BDh) = Address of pattern name table T32COL (F3BFh) = Address of colors table T32CGP (F3C1h) = Address of pattern generator table T32ATR (F3C3h) = Address of sprite attribute table T32PAT (F3C5h) = Address of sprite generator table |
Entry: | same as INIT32 |
Output: | None |
Modify: | All Registers |
007Eh (SETGRP)
Function: | Set only VDP in GRAPHIC2 mode (SCREEN2) without initializing the tables. |
Entry: | GRPNAM (F3C7h) = Address of pattern name table GRPCOL (F3C9h) = Address of colors table GRPCGP (F3CBh) = Address of pattern generator table GRPATR (F3CDh) = Address of sprite attribute table GRPPAT (F3CFh) = Address of sprite generator table |
Output: | None |
Modify: | All Registers |
0081h (SETMLT)
Function: | Set only VDP in MULTI colour mode (SCREEN3) without initializing the tables. |
Entry: | MLTNAM (F3D1h) = Address of pattern name table MLTCOL (F3D3h) = Address of colors table MLTCGP (F3D5h) = Address of pattern generator table MLTATR (F3D7h) = Address of sprite attribute table MLTPAT (F3D9h) = Address of sprite generator table |
Output: | None |
Modify: | All Registers |
0084h (CALPAT)
Funtion: | Returns the address of sprite generator table. |
Entry: | A = Sprite number |
Output: | HL = Address |
Modify: | AF, DE, HL |
0087h (CALATR)
Function: | Returns the address of sprite attribute table. |
Entry: | A = Sprite number |
Output: | HL = Address |
Modify: | AF, DE, HL |
008Ah (GSPSIZ)
Function: | Returns the current sprite size. |
Entry: | None |
Output: | A = Sprite size (8 when 16 x 16, 8 when 8 x 8) F = CY flag is set when the size is 16 x 16, otherwise reset. |
Modify: | AF |
008Dh (GRPPRT)
Function: | Displays a character on the graphic screen. |
Entry: | A = Character code to display. CLOC (0F92Ah) = In SCREEN 2 to 4 and 10 to 12, address where is the graphical cursor in VRAM. In SCREEN 5 to 8, the current abscissa of the graphical cursor. CMASK (0F92Ch) = In SCREEN 2 to 4 and 10 to 12, mask to apply. In SCREEN 5 to 8, current ordinate of the graphical cursor. LOGOPR (FB02h) = Logical operation code (for graphic modes of SCREEN 5 to 12). |
Output: | None |
Modify: | None |
Note: | Call to the sub-ROM if the screen mode is higher than SCREEN 4. |
PSG
0090h (GICINI)
Function: | Initialises PSG and sets the initial value for the PLAY instruction. |
Entry: | None |
Output: | None |
Modify: | All Registers |
Notes: |
R#0 = 01010101 R#1 = 00000000 R#2 = 00000000 R#3 = 00000000 R#4 = 00000000 R#5 = 00000000 R#6 = 00000000 R#7 = 10111000 R#8 = 00000000 R#9 = 00000000 R#10 = 00000000 R#11 = 00001011 R#12 = 00000000 R#13 = 00000000 |
0093h (WRTPSG)
Function: | Writes data in the PSG register |
Entry: | A = PSG register number (0~15) E = Parameter |
Output: | None |
Modify: | None |
Notes: |
|
0096h (RDPSG)
Function: | Reads the PSG register value |
Entry: | A = PSG register number |
Output: | A = Value read |
Modify: | None |
Notes: |
|
0099h (STRTMS)
Function: | Plays the MML for the instruction PLAY in background. |
Entry: | None |
Output: | None |
Modify: | All Registers |
Note: | Do not play if a MML is already playing. |
Keyboard, CRT, printer input-output
009Ch (CHSNS)
Function: | Update the function key display then tests the status of the keyboard buffer. |
Entry: | None |
Output: | F = Z flag is set when the buffer is empty, otherwise Z is reset. |
Modify: | AF |
009Fh (CHGET)
Function: | Wait one character input |
Entry: | None |
Output: | A = Code of the input character |
Modify: | AF |
Notes: |
|
00A2h (CHPUT)
Function: | Displays a character |
Entry: | A = Character code to display |
Output: | None |
Modify: | None |
Note: | Calls the hook H.CHPU (0FDA4h). |
00A5h (LPTOUT)
Function: | Sends one character to the printer |
Entry: | A = Character code to send |
Output: | F = CY flag is set if the routine was interrupted by a CTRL+STOP |
Modify: | F |
Notes: |
|
00A8h (LPTSTT)
Function: | Tests the printer status. |
Entry: | None |
Output: | A = 255 and the Z flag is reset when the printer is ready. A = 0 and the Z flag is set when not ready. |
Modify: | AF |
00ABh (CNVCHR)
Function: | Allows to manage the characters obtained with routine CHGET (0009Fh) for a possible conversion of the extended graphic characters. |
Entry: | A = Code of a character or 1 to announce an extended graphic character |
Output: | GRPHED (0FCA6h) is set when the entered code is 1 F = CY flag is reset if graphic header, the CY flag and the Z flag are set when the code is an extended graphic character, the CY flag is set and the Z flag is reset when code is set in A is an ordinary character. |
Modify: | AF |
Notes: |
|
00AEh (PINLIN)
Function: | Stores in the buffer BUF (0F55Eh) the character codes input until the RETURN key or STOP is pressed then place the cursor on the next line. |
Entry: | None |
Output: | HL = 0F55Eh F = CY flag is set only when it ends with the STOP key BUF (0F55Eh) contains the characters entered on the keyboard LINTTB (0FBB2h) is updated. |
Notes: |
|
Modify: | All Registers |
00B1h (INLIN)
Function: | Stores in the buffer BUF (0F55Eh) the character codes input until the RETURN key or STOP is pressed. |
Entry: | None |
Output: | HL = 0F55Eh F = CY flag is set only when it ends with the STOP key BUF (0F55Eh) contains the characters entered on the keyboard LINTTB (0FBB2h) is updated. |
Modify: | All Registers |
Notes: |
|
00B4h (QINLIN)
Function: | Executes INLIN with displaying "?" and one space |
Entry: | None |
Output: | HL = Starting address of the buffer minus 1, the CYflag is set only when it ends with the STOP key. |
Modify: | All Registers |
00B7h (BREAKX)
Function: | Tests Ctrl-STOP key. In this routine, interrupts areinhibited. |
Entry: | None |
Output: | F = CY flag is set when pressed |
Modify: | AF |
00C0h (BEEP)
Function: | Initializes the PLAY instruction and generates a beep sound |
Entry: | None |
Output: | None |
Note: | Call the Sub-ROM on MSX2 or later. |
Modify: | All Registers |
00C3h (CLS)
Function: | Clears the screen |
Entry: | F = Z flag must be set |
Output: | None |
Modify: | AF, BC, DE |
Note: | Call the Sub-ROM on MSX2 or later. |
00C6h (POSIT)
Function: | Moves the cursor |
Entry: | H = X-coordinate of the cursor, L for the Y-coordinate |
Output: | None |
Modify: | AF |
00C9h (FNKSB)
Function: | Tests whether the function key display is active (FNKFLG). If so, displays them, otherwise erases them. |
Entry: | FNKFLG (FBCEh) |
Output: | None |
Modify: | All Registers |
Notes: |
|
00CCh (ERAFNK)
Function: | Erases the function key display |
Entry: | None |
Output: | None |
Modify: | All Registers |
Note: |
00CFh (DSPFNK)
Function: | Displays the function keys |
Entry: | None |
Output: | None |
Modify: | All Registers |
Note: |
00D2h (TOTEXT)
Function: | Forces the screen to be in the text mode |
Entry: | None |
Output: | None |
Modify: | All Registers |
Notes: |
|
Game controllers, Mouse, Touch pad I/O access
00D5h (GTSTCK)
Function: | Returns the joystick status |
Entry: | A for the joystick number to be tested |
Output: | A for the joystick direction |
Modify: | All Registers |
(00D8H GTTRIG)
Function: | Returns the trigger button status |
Entry: | A = Trigger button to test |
Output: | A = 0 if the trigger button is not pressed, FFH when pressed. |
Modify: | AF |
00DBh (GTPAD)
Function: | Returns the touch pad status |
Entry: | A = Touch pad number to test |
Output: | A for the value |
Modify: | All Registers |
00DEh (GTPDL)
Function: | Returns the paddle value |
Entry: | A = Paddle number |
Output: | A = Paddle value |
Modify: | All Registers |
Cassette input-output routine
00E1h (TAPION)
Function: | Reads the header block after turning the cassette motor ON. |
Entry: | None |
Output: | F = CY flag is set if failed |
Modify: | All Registers |
00E4h (TAPIN)
Function: | Reads data from the tape |
Entry: | None |
Output: | A = Read data. F = CY flag is set if failed. |
Modify: | All Registers |
00E7h (TAPIOF)
Function: | Stops reading the tape |
Entry: | None |
Output: | None |
Modify: | None |
00EAh (TAPOON)
Function: | Writes the header block after turning the cassette motor ON |
Entry: | A = 0 for short header, otherwise long header |
Output: | F = CY flag is set if failed |
Modify: | All Registers |
00EDh (TAPOUT)
Function: | Writes data on the tape |
Entry: | A = Written data |
Output: | F = CY flag is set if failed |
Modify: | All Registers |
00F0h (TAPOOF)
Function: | Stops writing to the tape |
Entry: | A for data |
Output: | F = CY flag is set if failed |
Modify: | All Registers |
00F3h (STMOTR)
Function: | Sets the cassette motor action |
Entry: | A = 0 for stop, 1 for start and 0FFH for reverse the current action |
Output: | None |
Modify: | AF |
MML
00F6h (LFTQ)
Function: | Returns the number of remaining bytes in a queue |
Entry: | A = Queue number |
Output: | A = Lenght |
Modify: | AF, BC, HL |
00F9h (PUTQ)
Function: | Put byte in queue |
Entry: | A = Queue number E = Data |
Output: | F = Flag Z if queue full |
Modify: | AF, BC, HL |
Graphic Draw
00FCh (RIGHTC)
Function: | Move Right Coordinate |
Entry: | None |
Output: | None |
Modify: | AF, CLOC (0F92Ah) and possibly CMASK (0F92Ch) |
Note: | Call the sub-ROM if the screen mode is higher than SCREEN 4 |
00FFh (LEFTC)
Function: | Move Left Coordinate |
Entry: | None |
Output: | None |
Modify: | AF, CLOC (0F92Ah) and possibly CMASK (0F92Ch) |
Note: | Call the sub-ROM if the screen mode is higher than SCREEN 4 |
0102h (UPC)
Function: | Move Up Coordinate |
Entry: | None |
Output: | None |
Modify: | AF and possibly CLOC (0F92Ah) |
Note: | Call the sub-ROM if the screen mode is higher than SCREEN 4 |
0105h (TUPC)
Function: | Test and move Up Coordinate |
Entry: | None |
Output: | F = Flag C is set if exit from the screen |
Modify: | AF and possibly CLOC (0F92Ah) |
Note: | Call the sub-ROM if the screen mode is higher than SCREEN 4 |
0108h (DOWNC)
Function: | Move Down Coordinate |
Entry: | None |
Output: | None |
Modify: | AF and possibly CLOC (0F92Ah) |
Note: | Call the sub-ROM if the screen mode is higher than SCREEN 4 |
010Bh (TDOWNC)
Function: | Test and move Down Coordinate |
Entry: | None |
Output: | F = Flag C is set if exit from the screen |
Modify: | AF and possibly CLOC (0F92Ah) |
Note: | Call the sub-ROM if the screen mode is higher than SCREEN 4 |
010Eh (SCALXY)
Function: | Check if the coordinates contained in BC and DE go out or not on the screen. The coordinates will be adjusted if exceeded. |
Entry: | BC = X coordinate DE = Y coordinate |
Output: | BC = Valid X coordinate the closest DE = Valid Y coordinate the closest F = Carry is reset if BC or DE was off the screen. |
Modify: | AF |
Note: | Call the sub-ROM if the screen mode is higher than SCREEN 4 |
0111h (MAPXYC)
Function: | Convert the graphic coordinates contained in BC and DE into a VRAM address and mask. (Not useful in SCREEN 5 to 8). |
Entry: | BC = X coordinate DE = Y coordinate |
Output: | CLOC (0F92Ah) = In SCREEN 2 to 4 and 10 to 12, address in VRAM corresponding to the coordinates. In SCREEN 5 to 8, abscissa. In SCREEN 2 to 4 and 10 to 12, mask to apply. In SCREEN 5 to 8, ordinate. |
Modify: | F |
Note: | Call the sub-ROM if the screen mode is higher than SCREEN 4 |
0114h (FETCHC)
Function: | Fetch the current VRAM address and current mask (or pixel coordinates for SCREEN 5-8). |
Entry: | None |
Output: | A = In SCREEN 2 to 4, graphical cursor mask. In SCREEN 5 to 8, the ordinate of the pixel. HL = In SCREEN 2 to 4, VRAM address of the graphic cursor. In SCREEN 5 to 8, the abscissa of the pixel. |
Modify: | AF, HL |
0117h (STOREC)
Function: | Store the current VRAM address and current mask (or coordinates). |
Entry: | A = In SCREEN 2 to 4, graphical cursor mask. In SCREEN 5 to 8, the ordinate of the pixel. HL = In SCREEN 2 to 4, VRAM address of the graphic cursor. In SCREEN 5 to 8, the abscissa of the pixel. |
Output: | None |
Modify: | None |
011Ah (SETATR)
Function: | Set the attribute byte ATRBYT (0F3F2h). |
Entry: | A = Color code |
Output: | F = Carry is set if illegal code (>15) |
Modify: | F |
Note: | This routine is only valid in SCREEN 0 to 4 |
011Dh (READC)
Function: | Read the color of the pixel at the current graphic cursor |
Entry: | CLOC (0F92Ah) = In SCREEN 2 to 4 and 10 to 12, address where is the graphic cursor in VRAM. In SCREEN 5 to 8, the current abscissa of the graphical cursor. CMASK (0F92Ch) = In SCREEN 2 to 4 and 10 to 12, mask to apply. In SCREEN 5 to 8, current ordinate of the graphical cursor. |
Output: | A = Color code read (0~15 in SCREEN 5 to 7, 0~255 in SCREEN 8 to 12) |
Modify: | AF |
Note: | Call the sub-ROM if the screen mode is higher than SCREEN 4 |
0120h (SETC)
Function: | Set a pixel on the screen at the current graphical cursor. |
Entry: | CLOC (0F92Ah) = In SCREEN 2 to 4 and 10 to 12, address where is the graphic cursor in VRAM. In SCREEN 5 to 8, the current abscissa of the graphical cursor. CMASK (0F92Ch) = In SCREEN 2 to 4 and 10 to 12, mask to apply. In SCREEN 5 to 8, current ordinate of the graphical cursor. ATRBYT (0F3F2h) = Color of the pixel (0~3 in SCREEN 6, 0~15 in SCREEN 5 and 7, 0~255 in SCREEN 8 to 12). |
Output: | None |
Modify: | AF |
Note: | Call the sub-ROM if the screen mode is higher than SCREEN 4 |
0123h (NSETCX)
Function: | Set N pixels from the current graphics cursor to the right. |
Entry: | HL = Number of pixels to set CLOC (0F92Ah) = In SCREEN 2 to 4 and 10 to 12, address where is the graphic cursor in VRAM. In SCREEN 5 to 8, the current abscissa of the graphical cursor. CMASK (0F92Ch) = In SCREEN 2 to 4 and 10 to 12, mask to apply. In SCREEN 5 to 8, current ordinate of the graphical cursor. ATRBYT (0F3F2h) = Color of the pixel (0~3 in SCREEN 6, 0~15 in SCREEN 5 and 7, 0~255 in SCREEN 8 to 12). |
Output: | None |
Modify: | All |
0126h (GTASPC)
Function: | Get circle Aspect |
Entry: | None |
Output: | DE = Content of ASPCT1 (0F40Bh) HL = Content of ASPCT2 (0F40Dh) |
Modify: | None |
0129h (PNTINI)
Function: | PAINT initialization |
Entry: | None |
Output: | None |
Modify: | AF |
Note: |
012Ch (SCANR)
Function: | Search to the right of the first pixel of another color |
Entry: | DE = Number of pixels on which the search must take place |
Output: | DE = Value entered minus the number of pixels traveled until the color encountered |
Modify: | AF, BC, DE, HL |
Note: | Call the sub-ROM if the screen mode is higher than SCREEN 4 |
012Fh (SCANL)
Function: | Search to the left of the first pixel of another color |
Entry: | DE = Number of pixels on which the search must take place |
Output: | DE = Value entered minus the number of pixels traveled until the color encountered |
Modify: | AF, BC, DE, HL |
Note: | Call the sub-ROM if the screen mode is higher than SCREEN 4 |
Miscellaneous
0132h (CHGCAP)
Function: | Alternates the CAP LED status |
Entry: | A = 0 for LED off, otherwise LED goes on |
Output: | None |
Modify: | AF |
0135h (CHGSND)
Function: | Alternates the 1-bit sound port status |
Entry: | A = 0 for OFF, otherwise ON |
Output: | None |
Modify: | AF |
0138h (RSLREG)
Function: | Reads the contents of current output to the basic slot register |
Entry: | None |
Output: | A = Value read |
Modify: | A |
013Bh (WSLREG)
Function: | Writes to the primary slot register |
Entry: | A = value to write |
Output: | None |
Modify: | None |
013Eh (RDVDP)
Function: | Reads VDP status register |
Entry: | None |
Output: | A = Value read |
Modify: | A |
0141h (SNSMAT)
Function: | Reads the value of the specified line from the keyboard matrix |
Entry: | A = specified line |
Output: | A for data (the bit corresponding to the pressed key willbe 0) |
Modify: | AF, C |
0144h (PHYDIO)
Function: | Physical input/output for disk devices |
Entry: | A = drive number 0 = A:, 1 = B:,...) B = number of sector to be read from or written to C = media ID DE = first sector number to be read rom or written to HL = starting address of the RAM buffer to be read from or written to specified sectors F = CY set/reset for sector writing/reading |
Output: | F = CY set if failed B = Number of sectors actually read or written A = Error code (only if CY set): 0 = Write protected 2 = Not ready 4 = Data error 6 = Seek error 8 = Record not found 10 = Write error 12 = Bad parameter 14 = Out of memory 16 = Other error |
Modify: | All Registers |
014Ah (ISFLIO)
Function: | Tests whether the device is active |
Entry: | None |
Output: | A = 0 for active, otherwise inactive |
Modify: | AF |
014Dh (OUTDLP)
Function: | printer output.Different from LPTOUT in the following points: 1. TAB is expanded to spaces 2. For non-MSX printers, hiragana is transformed to katakana and graphic characters are transformed to 1-byte characters. 3. If failed, device I/O error occurs. |
Entry: | A for data |
Output: | None |
Modify: | F |
0156h (KILBUF)
Function: | Clears the keyboard buffer |
Entry: | None |
Output: | None |
Modify: | HL |
0159h (CALBAS)
Function: | Executes inter-slot call to the routine in BASIC interpreter |
Entry: | IX for the calling address |
Output: | Depends on the called routine |
Modify: | Depends on the called routine |
Entries appended since MSX2
Call to SUB-ROM
015Ch (SUBROM)
Function: | Executes inter-slot call to SUB-ROM |
Entry: | IX for the calling address and, at the same time, pushes IX on the stack |
Output: | Depends on the called routine |
Modify: | Background registers and IY are reserved |
015Fh (EXTROM)
Function: | Executes inter-slot call to SUB-ROM |
Entry: | IX for the calling address |
Output: | Depends on the called routine |
Modify: | Background registers and IY are reserved |
VDP
0168h (EOL)
Function: | Deletes to the end of the line |
Entry: | H for X-coordinate of the cursor, L for Y-coordinate |
Output: | None |
Modify: | All Registers |
016Bh (BIGFIL)
Function: | Same function as FILVRM. Differences are as follows: In FILVRM, it is tested whether the screen mode is 0 to 3. If so, it treats VDP as the one which has only 16K bytes VRAM (for the compatibility with MSX1). In BIGFIL, the mode is not tested and actions are carried out by the given parameters. |
Entry: | same as FILVRM |
Output: | same as FILVRM |
Modify: | same as FILVRM |
016Eh (NSETRD)
Function: | Enables VRAM to be read by setting the address |
Entry: | HL for VRAM address |
Output: | None |
Modify: | AF |
0171h (NSTWRT)
Function: | Enables VRAM to be written by setting the address |
Entry: | HL for VRAM address |
Output: | None |
Modify: | AF |
0174h (NRDVRM)
Function: | Reads the contents of VRAM |
Entry: | HL for VRAM address to be read |
Output: | A for the value which was read |
Modify: | F |
0177h (NWRVRM)
Function: | Writes data in VRAM |
Entry: | HL for VRAM address, A for data |
Output: | None |
Modify: | AF |
Entries appended since MSX2+
Reset
017Ah (RDRES)
Function: | Read the status of system initialization |
Entry: | None |
Output: | A = Parameters
x 0 x 0 0 0 0 0 | | | 1 if the system has already initialized. (MSX turbo R) | This bit is reset when a hard reset is performed then set during the hard reset. |
Modify: | AF |
Note: | Must be used by the system only. |
017Dh (WRRES)
Function: | Modify the flags that indicates the status of system initialization |
Entry: | A = Parameters
x 0 x 0 0 0 0 0 | | | Remains set until a hard reset. (MSX turbo R) | This bit is reset when a hard reset is performed then set during the hard reset. Must not be changed by the user. |
Output: | None |
Modify: | AF |
Note: | Must be used by the system only. |
Entries appended since MSX turbo R
CPU
0180h (CHGCPU)
Function: | Changes CPU mode |
Entry: | A = CPU mode and LED control.
LED 0 0 0 0 0 x x | 0 0 = Z80 mode (with ROM) | 0 1 = R800 mode with ROM +----------- 1 0 = R800 mode with RAM |
Output: | None |
Modify: | None |
Notes: |
|
0183h (GETCPU)
Function: | Returns current CPU mode |
Entry: | None |
Output: | A = 0 for Z80 mode, 1 for R800 mode with ROM, and 2 for R800 mode with RAM |
Modify: | AF |
PCM
0186h (PCMPLY)
Function: | Plays specified memory area through the PCM chip |
Entry: | A = Parameters
v 0 0 0 0 0 x x | | | | +-+-- Quality parameter (00 = 15,75kHz ; | 01 =7,875kHz ; 10 = 5,25kHz et 11 = 3,9375kHz) +---------------- VRAM usage flag BC = Length of area to play |
Output: | A = 1 if the sampling frequency is wrong, 2 when aborted with CTRL-STOP F = CY flag is set if the reading went off normally E = Most signifiant 3 bits of VRAM address when aborted with CTRL-STOP HL = Address when aborted with CTRL-STOP. |
Modify: | All registers |
Notes: |
|
0189h (PCMREC)
Function: | Records audio using the PCM chip into the specified memory area |
Entry: | A = PCM parameters
v t t t t c x x | | | | | | | | | | | | | | +-+-- Quality parameter (00 = 15,75kHz ; | | | | | | 01 =7,875kHz ; 10 = 5,25kHz et 11 = 3,9375kHz) | | | | | +------ Zero-data compression | +-+-+-+-------- Treshold +---------------- VRAM usage flag BC = Length of area to play |
Output: | A = 1 if the sampling frequency is wrong, 2 when aborted with CTRL-STOP F = CY flag is set if the recording went off normally E = Most signifiant 3 bits of the address when aborted with CTRL-STOP. (VRAM) HL = Address when aborted with CTRL-STOP. |
Modify: | All registers |
Notes: |
|
Links
- MSX BIOS by Grauw.
- BIOS of Main-ROM and Sub-ROM from MSX2 Technical Hand Book by Nyagosu (Japanese)