Autor
| which code ?
|
pp msx novice Mensajes: 27 | Publicado: Diciembre 06 2005, 07:28   |
Hi,
Does anyone know which code exactly is executed BEFORE the MSX gives control to a cartridge rom ? It should start with the F3 (Disable Interrupt) instruction, the first instruction of the BIOS. How does it continue ?
Regards,
pp
|
|
zeilemaker54 msx lover Mensajes: 97 | Publicado: Diciembre 06 2005, 07:55   |
Quote:
| Hi,
Does anyone know which code exactly is executed BEFORE the MSX gives control to a cartridge rom ? It should start with the F3 (Disable Interrupt) instruction, the first instruction of the BIOS. How does it continue ?
Regards,
pp
|
Well, you can take a look at the book Hans O has scanned, it contains the bios listing of a MSX1, which is not very different from the suceeding msx versions. Or you take a look at my msx system sourcefiles at cvs.sourceforge.net/viewcvs.py/msxsyssrc/cvs/base410/bios.mac?rev=1.3&view=markup
What is generaly does:
- Initialize hardware
- search RAM
- initialize hooks
- initialize workarea (&HF380 and above)
- show startscreen
- setup for basic
- start init of every expansion rom
- start basic program in expansion rom
- show basic welkom
|
|
pitpan msx master Mensajes: 1418 | Publicado: Diciembre 06 2005, 09:45   |
It does not need to start with a DI. In fact, in an MSX1 machine, when the ROM code is started, interruptions are still enabled.
|
|
zeilemaker54 msx lover Mensajes: 97 | Publicado: Diciembre 06 2005, 11:38   |
Quote:
| It does not need to start with a DI. In fact, in an MSX1 machine, when the ROM code is started, interruptions are still enabled.
|
Yes, it does need the DI instruction! With a cold boot, the Z80 always has the interrupts disabled. But when a MSX is running, and software want the MSX to reboot, a jump (or even a call) to adres 0 shoud also work. Now the BIOS assumes that interrupts are still on, and disables the interrupts. If this was not done, the initialisation routine will soon hang when doing the intialization of the slothardware (page 3 is switched to slot 0-0, and gone is the H.KEYI hook!). |
|
pitpan msx master Mensajes: 1418 | Publicado: Diciembre 06 2005, 14:24   |
I'm afraid that there was a missunderstanding: it meant that interrupts are enabled when a cartridge ROM, different from the BIOS ROM, is executed. Of course that I know that a DI is requiered when initializing the computer for the first time (MSX BIOS).
It was specified on the first question that it was the code executed prior to cartridge ROM execution. When the cartridge ROM is called, interrupts are enabled on MSX1 computers.
|
|
zeilemaker54 msx lover Mensajes: 97 | Publicado: Diciembre 06 2005, 14:53   |
Quote:
| It was specified on the first question that it was the code executed prior to cartridge ROM execution. When the cartridge ROM is called, interrupts are enabled on MSX1 computers.
|
Well, not so sure about that. The initialization routine of a expansion ROM is called by the CALSLT BIOS call, which disables the interrupts when it is executing. So when the initialization routine is called, interrupts are disabled. The MSX technical data book states about CALSLT:
Quote:
| Interrupts are disabled automatically but never enabled by this routine.
|
|
|
pitpan msx master Mensajes: 1418 | Publicado: Diciembre 06 2005, 15:43   |
That's a difference between MSX and MSX2. When the cartridge ROM is executed in an MSX(1) computer interrupts are enabled. In an MSX2 they are disabled. Curious enough!
|
|
zeilemaker54 msx lover Mensajes: 97 | Publicado: Diciembre 06 2005, 20:38   |
Quote:
| That's a difference between MSX and MSX2. When the cartridge ROM is executed in an MSX(1) computer interrupts are enabled. In an MSX2 they are disabled. Curious enough!
|
What you mean is the interrupt state AFTER the CALSLT. If the cartridge enables interrupts and then returns, then CALSLT on a MSX2 and higher returns with interrupts enabled, while a MSX1 can have the interrupts disabled again (this the case for a slotid which is expanded) after CALSLT returns.
I even did run a test with OpenMSX on a MSX1 and MSX2 configuration to make sure that the interrupts are disabled with the following 'ROM' code:
.Z80
ASEG
ORG 04000H
defb "AB"
defw cart_init
defw 0
defw 0
defw 0
defs 6
cart_init:
init: ld a,i ; set parity flag with the interrupt state
ld a,"D" ; leaves flags alone!
jp po,init_prt
ld a,"E"
init_prt: call 0A2H ; print result
call 09FH ; and wait for a key to see
ret
|
|
|
|
|