|
| | Hay 36 invitados y 3 miembros en línea
Eres un usuario anónimo.
|
| |
Autor
| MSX-DOS and access to BIOS
| pitpan msx master Mensajes: 1418 | Publicado: Febrero 05 2003, 01:36   | Whoow! Today is "question's day".
I am starting to get used to MSX-DOS, and the time has come to code my own programs. My problem is that I do not know what is the best option to access the MSX BIOS present in slot 0.
My newbie ideas are the following:
-Use an interslot call (slow but secure, any idea of how to do this exactly?)
-Manipulate directly the pages, selecting page 0 from slot 0 (using PPI register). The problem here is that the program is loaded in 0100h, and page 0 is from 0000h to 3FFFh. Should I do a "loader" that copies the executable part in RAM begining at 4000h and then switches that memory register in the PPI?
I am completly lost, but I do need the info. I do not want to code in pure asm without BIOS calls all the keyboard stuff, for example. And I repeat that it is the first time that I am coding MSX-DOS apps. Until now, I have only coded ROM files (easily locatable) and BASIC loadable binaries.
Thank you for all your help!
| | BiFi msx guru Mensajes: 3142 | Publicado: Febrero 05 2003, 08:45   | The best way is using an interslot call. I agree it isn't the fastest way, but most of the BIOS calls itself aren't written with real speed in mind either. There are two ways of interslot call procedures:
1. Using RST #30, which requires two parameters which are read right after the RST:
RST #30
DB slot ; format ExxxSSPP (standard MSX format for slots)
DW address ; address of the call
The slot for the BIOS is always located in primary slot 0 and secundary slot 0 in case that slot is expanded. For this the simple of #80 (10000000 in binary) is sufficient to tell the call is in the BIOS slot. It will work in all MSX computers.
2. Using address #001C, which requires IX and IY for the extra parameters:
LD IX,address ; address of the call
LD IY,slot *256 + 0 ; slot is to be put in the high byte
CALL #001C
The slot for the BIOS is located in a system variable: #FCC1. If you use LD IY,(#FCC1 - 1) the BIOS slot will be automatically put in the high byte.
Of course you need to set up the other registers first according to the BIOS call you are about to execute.
| | pitpan msx master Mensajes: 1418 | Publicado: Febrero 05 2003, 15:50   | Strange enogh!
Thank you for your reply: I have been trying both systems and they work great with MSX2 machines. But the first system, using RST 30h, does not work at all with MSX1 computers, it hangs and after a while it resets. Is this normal?
Anyway, I will continue using the other system:
ld IY,(FCC1h-1)
ld IX,LDIRVM
ld DE,NAMTBL
ld HL,TEXT
ld BC,7
call 001Ch
TEXT: db "Thanks!"
Kind regards,
| | BiFi msx guru Mensajes: 3142 | Publicado: Febrero 05 2003, 16:15   | Strange, the RST #30 method should work on MSX 1 as well. The behaviour of it hanging and resetting after a while isn't normal. To use your sample:
ld DE,NAMTBL
ld HL,TEXT
ld BC,7
rst 30h
db 80h
dw LDIRVM
ret
TEXT: db "Thanks!"
should wor fine on MSX1.
You can try this of course:
ld DE,NAMTBL
ld HL,TEXT
ld BC,7
ld a,(FCC1h)
ld (slot),a
rst 30h
slot: db 0
dw LDIRVM
ret
TEXT: db "Thanks!"
With this code, the slot is read from FCC1h and written in the code before it does the interslot call.
| |
| |
| |
| |