Inter-slot calls to BIOS?

By DarkSchneider

Paladin (941)

DarkSchneider's picture

05-05-2016, 19:17

In MSX-DOS environment we have no BIOS available directly (only up to 100H I think), so inter-slot calls are needed I suppose. These are the ones available:

Quote:

CALSLT (001CH) *1
Function: calls the routine in another slot (inter-slot call)
Input: specify the slot in the 8 high order buts of the IY register
(same as RDSLT). IX is for the address to be called.
Output: depends on the calling routine
Registers: depends on the calling routine

Quote:

CALLF (0030H) *1
Function: calls the routine in another slot. The following is the
calling sequence:

RST 30H
DB n ;n is the slot number (same as RDSLT)
DW nn ;nn is the called address

Input: In the method described above
Output: depends on the calling routine
Registers: AF, and other registers depending on the calling routine

How can I use them? Those definitions confuse me.
i.e. to inter-slot call to BEEP (no parameters):

Quote:

BEEP (00C0H) *3
Function: generates BEEP
Input: none
Output: none
Registers: all

And i.e. to inter-slot call to one with parameters:

Quote:

NRDVRM (0174H)
Function: reads the contents of VRAM
Input: HL for VRAM address to be read
Output: A for the value which was read
Registers: F

Thanks.

Login or register to post comments

By NYYRIKKI

Enlighted (5842)

NYYRIKKI's picture

05-05-2016, 20:56

I don't really see what is the problem? I think the information is quite clear...

CALSLT	EQU #1C
CALLF	EQU #30
BEEP	EQU #C0
NRDVRM	EQU #174

	PUSH HL
	LD A,(#FCC1)	; This is the "most standard" way
	LD IYH,A
	LD IX,NRDVRM
	LD HL,0
	CALL CALSLT
	POP HL
	LD (HL),A
	RET
;---------------------

	PUSH HL
	LD HL,0
	RST CALLF
	DB #80		; This works in practise, since #Fcc1 is double booked so that
	DW NRDVRM	; it always must be either 0 or #80
	POP HL
	LD (HL),A
	RET

; Feel free to replace NRDVRM with BEEP.

By flyguille

Prophet (3028)

flyguille's picture

05-05-2016, 21:07

Inter slot calls are very, very slow, don't try to use them for VDP access., program the VDP directly by IN/OUT ports.

I only use it for specific things like set SCREEN 8

and the way to use it

RST $30
DB $80 ; (slot 0-0 aka BIOS/BASIC ROM).
DW address ; of the function to call.

By DarkSchneider

Paladin (941)

DarkSchneider's picture

06-05-2016, 08:59

All clear, thanks.

By snake

Resident (51)

snake's picture

03-11-2016, 19:44

I wonder if using directly in/out commands instead of bios calls to access Vdp and Psg is still Msx compliant. Is there any risk of compatibility issues between different Msx machines (for instance Msx with Toshiba vdp) ?

By ARTRAG

Enlighted (6515)

ARTRAG's picture

03-11-2016, 20:00

No msx 1 machine will have problems even with Toshiba chips, about msx 2 all machines use the same ports but there is a Brazilian expansion for msx1 to msx2 that maps the vdp in ports for the v9938 to 88h and 89h having the msx1chip on 98h and 99h.

By snake

Resident (51)

snake's picture

03-11-2016, 21:08

Thank you! I also noticed this topic: https://www.msx.org/forum/msx-talk/development/using-bios-vs...

And what about the PSG?

By ARTRAG

Enlighted (6515)

ARTRAG's picture

04-11-2016, 07:54

No exceptions on the psg. All machines have the same ports

By Manuel

Ascended (18086)

Manuel's picture

04-11-2016, 21:50

ARTRAG: the Neos MA-20 is a Japanese expansion for MSX1 to upgrade to MSX2.