Efficiency of ROM and BIOS

Page 1/2
| 2

By rolandve

Champion (372)

rolandve's picture

04-05-2016, 14:37

Just curious: there are people on this forum that have good skills in assembly and know MSX machines inside out. Are the MSX-BIOS(es) and Basic roms efficient or is there room for improvement in performance and size?

Login or register to post comments

By flyguille

Prophet (3031)

flyguille's picture

04-05-2016, 15:24

the msx rom bios is very very inneficient starting with v2.0 and on...

It start with the problem of adding a complete set of graphics functions for the new vdp, but the 32K rom was already full.

So, the original msx1 version was chopped badly, and moved so much functions to the slot 3-0 16K rom.

This mean that there was inserted lots of interslot calls, forcing to use the shitty slower BADly designed slotting routines that the ROM has.

Also the ROM already has from v1.0 lots extra jumps to save few bytes here and there, like by example:

jp .escape

escape: pop hl
pop de
pop bc
ret

So, just for saving one single byte, there is an extra jump.

Ant that is just one example of it.

And there is a number of claims that today I am forgetting.

Yes, it is bad, and has some bugs, like the PUT SPRITE bug, but works 99%.

But is what we got.

Not to mention that so many msx1 software hardcoded jumps to illegal entries like the jumps to the BLOAD routine, complete illegal but handy if we assume that all MSX1 shared the same BASIC version with just the variant of the keyboard layout tables.

By Metalion

Paragon (1629)

Metalion's picture

04-05-2016, 15:54

For those who would want to take a look, I have the assembler version of the MSX1 BIOS, complete with comments from the programers Jey Suzuki & Rick Yamashita.

Big smile

By flyguille

Prophet (3031)

flyguille's picture

04-05-2016, 16:33

Metalion wrote:

For those who would want to take a look, I have the assembler version of the MSX1 BIOS, complete with comments from the programers Jey Suzuki & Rick Yamashita.

Big smile

it is a inverse engineering? or the original source? Big smile

By Metalion

Paragon (1629)

Metalion's picture

04-05-2016, 16:35

It seems to be the original source.

;
;       (C) Copyright by ASCII Corp., 1983
;       Proprietary information. All rights reserved.
;
;       File:   BIOHDR.MAC
;       USE:    Restart calls and ROM entries table
;       Written by Jey Suzuki, Rick Yamashita
;               ASCII Corporation, Japan
;
;       Edit:   January, 1985
;       Reason: Zilog Z80 Mnemonic version and cleanup
;       Edited by:  Steven M. Ting
;
; Labels referenced in this listing, are the absolute locations
; within the MSX ROM. However, "ONLY" this BIOS entry point table,
; and RAM variables are guaranteed to be permanent.
;
; All other locations in the ROM, will be changed without notice.
;
SUBTTL -BIOS header- BIOS calls (Basic Interpreter, Slot I/O)

;
;  The following RST's (RST 0 thru RST 5) are reserved for BASIC
;  interpreter, RST 6 for inter-slot calls, and RST 7 for
;  hardware interrupt
;
BEGIN:  DI                      ;Fail safe
        JP      CHKRAM          ;Finds all connected RAM
                                ;and cartridges

By flyguille

Prophet (3031)

flyguille's picture

04-05-2016, 16:38

Metalion wrote:

It seems to be the original source.

;
;       (C) Copyright by ASCII Corp., 1983
;       Proprietary information. All rights reserved.
;
;       File:   BIOHDR.MAC
;       USE:    Restart calls and ROM entries table
;       Written by Jey Suzuki, Rick Yamashita
;               ASCII Corporation, Japan
;
;       Edit:   January, 1985
;       Reason: Zilog Z80 Mnemonic version and cleanup
;       Edited by:  Steven M. Ting
;
; Labels referenced in this listing, are the absolute locations
; within the MSX ROM. However, "ONLY" this BIOS entry point table,
; and RAM variables are guaranteed to be permanent.
;
; All other locations in the ROM, will be changed without notice.
;
SUBTTL -BIOS header- BIOS calls (Basic Interpreter, Slot I/O)

;
;  The following RST's (RST 0 thru RST 5) are reserved for BASIC
;  interpreter, RST 6 for inter-slot calls, and RST 7 for
;  hardware interrupt
;
BEGIN:  DI                      ;Fail safe
        JP      CHKRAM          ;Finds all connected RAM
                                ;and cartridges

so it is just the BIOS part , not the basic?. anyway I want to see.

By tvalenca

Paladin (747)

tvalenca's picture

04-05-2016, 17:54

Metalion wrote:

It seems to be the original source.

;
;       (C) Copyright by ASCII Corp., 1983
;       Proprietary information. All rights reserved.
;
;       File:   BIOHDR.MAC
;       USE:    Restart calls and ROM entries table
;       Written by Jey Suzuki, Rick Yamashita
;               ASCII Corporation, Japan
;
;       Edit:   January, 1985
;       Reason: Zilog Z80 Mnemonic version and cleanup
;       Edited by:  Steven M. Ting
;
; Labels referenced in this listing, are the absolute locations
; within the MSX ROM. However, "ONLY" this BIOS entry point table,
; and RAM variables are guaranteed to be permanent.
;
; All other locations in the ROM, will be changed without notice.
;
SUBTTL -BIOS header- BIOS calls (Basic Interpreter, Slot I/O)

;
;  The following RST's (RST 0 thru RST 5) are reserved for BASIC
;  interpreter, RST 6 for inter-slot calls, and RST 7 for
;  hardware interrupt
;
BEGIN:  DI                      ;Fail safe
        JP      CHKRAM          ;Finds all connected RAM
                                ;and cartridges

WOW! This is gold on its purest form!
Can I have it?

By Metalion

Paragon (1629)

Metalion's picture

04-05-2016, 18:13

flyguille wrote:

so it is just the BIOS part , not the basic?. anyway I want to see.

Yes, it's only BIOS, as far as I know.

tvalenca wrote:

WOW! This is gold on its purest form!
Can I have it?

Well of course, everyone can have it.

I don't remember where I found it, but I'm pretty sure it was from within the community.

By Grauw

Ascended (10821)

Grauw's picture

04-05-2016, 19:40

I’d like a copy too please Smile.

By NYYRIKKI

Enlighted (6095)

NYYRIKKI's picture

05-05-2016, 01:11

Yes, indeed performance was clearly not a very high priority when they made MSX-BASIC.

I think BIOS source was published on some book, but I have not seen text file version either, so one copy for me too, please Smile

By flyguille

Prophet (3031)

flyguille's picture

05-05-2016, 01:38

NYYRIKKI wrote:

Yes, indeed performance was clearly not a very high priority when they made MSX-BASIC.

I think BIOS source was published on some book, but I have not seen text file version either, so one copy for me too, please Smile

most probably most functions of the msx-basic were imported from other platforms like the 8080, converted to z80, and that is the reason why too much use of "ex (sp), hl" and that kind of trick, as if using the stack for parameters.

Page 1/2
| 2