Why are the DAC and ARG not 8 bytes?

Page 2/3
1 | | 3

By iamweasel2

Paladin (701)

iamweasel2's picture

26-01-2022, 23:33

I remember someone posted a code in a thread here in MRC with some calculation in BASIC that showed an incorrect result due to a bug in Math Pack. I can't find this thread anymore. Anyone remember what bug was that?

By PingPong

Prophet (3885)

PingPong's picture

26-01-2022, 23:52

zeilemaker54 wrote:

A very limited test with SQR(10) learns that MSX-BASIC is 3.5 times slower...
Note also that MBASIC is pure i8080 code, but even the bigest part of MSX-BASIC is still using the original i8080 code, not Z80 optimized.

but the MBASIC ran on an msx?
can you test some basic operations like summing n times a double or single precision number?
Or a multiply / divide operation?

By NYYRIKKI

Enlighted (5917)

NYYRIKKI's picture

27-01-2022, 00:23

zeilemaker54 wrote:

A very limited test with SQR(10) learns that MSX-BASIC is 3.5 times slower...
Note also that MBASIC is pure i8080 code, but even the bigest part of MSX-BASIC is still using the original i8080 code, not Z80 optimized.

It would be interesting experiment to disassemble math pack from i8080 version and plug it back to MSX-BASIC to see how much faster real MSX-BASIC programs would run with it in practice. The speed is affected by this in many places that would not even seem automatically obvious (like in PLAY and CIRCLE commands) Most likely such patch would be quite a bit harder task than it sounds like though. It was anyway not very clever business decision to rewrite that part and I've been wondering why on earth they put the effort here. Even back in the day when MSX was actively marketed the slow math routines were many times mentioned in reviews that compared MSX to other home computers.

Microsoft later switched back to base 2 version, so I guess they came to same conclusion after experimenting with SVI/MSX line of machines. I think they just got mesmerized by the Z80 brand new DAA-instruction and took it as powerful expansion to 8080 command set without actually bothering to evaluate the total cost that it causes in the end. When ASCII released MSX-BASIC kun compiler (aka. X-BASIC) they also went back to base 2 numbers, but in X-BASIC the whole approach is so different, that you can't really compare the speed differences in a fair way. (and it also can't run all MSX-BASIC programs as is)

By zeilemaker54

Champion (338)

zeilemaker54's picture

27-01-2022, 08:30

PingPong wrote:
zeilemaker54 wrote:

A very limited test with SQR(10) learns that MSX-BASIC is 3.5 times slower...
Note also that MBASIC is pure i8080 code, but even the bigest part of MSX-BASIC is still using the original i8080 code, not Z80 optimized.

but the MBASIC ran on an msx?
can you test some basic operations like summing n times a double or single precision number?
Or a multiply / divide operation?

MBASIC is a CP/M program, so yes it runs on MSX-DOS.
We have develope some sort of floating point benchmark basic program to test this. Does anyone have suggestions ?

By zeilemaker54

Champion (338)

zeilemaker54's picture

27-01-2022, 08:35

NYYRIKKI wrote:
zeilemaker54 wrote:

A very limited test with SQR(10) learns that MSX-BASIC is 3.5 times slower...
Note also that MBASIC is pure i8080 code, but even the bigest part of MSX-BASIC is still using the original i8080 code, not Z80 optimized.

It would be interesting experiment to disassemble math pack from i8080 version and plug it back to MSX-BASIC to see how much faster real MSX-BASIC programs would run with it in practice. The speed is affected by this in many places that would not even seem automatically obvious (like in PLAY and CIRCLE commands) Most likely such patch would be quite a bit harder task than it sounds like though. It was anyway not very clever business decision to rewrite that part and I've been wondering why on earth they put the effort here. Even back in the day when MSX was actively marketed the slow math routines were many times mentioned in reviews that compared MSX to other home computers.

Microsoft later switched back to base 2 version, so I guess they came to same conclusion after experimenting with SVI/MSX line of machines. I think they just got mesmerized by the Z80 brand new DAA-instruction and took it as powerful expansion to 8080 command set without actually bothering to evaluate the total cost that it causes in the end. When ASCII released MSX-BASIC kun compiler (aka. X-BASIC) they also went back to base 2 numbers, but in X-BASIC the whole approach is so different, that you can't really compare the speed differences in a fair way. (and it also can't run all MSX-BASIC programs as is)

I have the orginal MBASIC source code including the F4 module. To replace the MSX F4 module should be do-able, but as already stated before, the format of the floating point is different and incompatible.

By Grauw

Ascended (10558)

Grauw's picture

27-01-2022, 12:07

I just happened to watch a Dave’s Garage video which mentioned that the MathPack was written by Monte Davidoff rather than Bill Gates or Paul Allen.

By iamweasel2

Paladin (701)

iamweasel2's picture

27-01-2022, 12:30

Grauw wrote:

I just happened to watch a Dave’s Garage video which mentioned that the MathPack was written by Monte Davidoff rather than Bill Gates or Paul Allen.

Yeah, I remember reading somewhere about that. Turns out Bill / Allen didn't want to get into the trouble of writing Math Pack, so they hired Monte. IIRC his name appears on a manual about MBasic.

By WORP3

Paladin (855)

WORP3's picture

27-01-2022, 14:59

Grauw wrote:

I just happened to watch a Dave’s Garage video which mentioned that the MathPack was written by Monte Davidoff rather than Bill Gates or Paul Allen.

That's a nice video to watch, lot's of old info on how the seems to work and copyrighted there software :)

By WORP3

Paladin (855)

WORP3's picture

27-01-2022, 15:01

So it would be possible to rewrite the math pack and hook it to the default MSX basic, resulting in a quicker basic overall Wink

By iamweasel2

Paladin (701)

iamweasel2's picture

27-01-2022, 15:41

The most important thing is, in Dave's Garage video, he says that the 6502 Basic source code was found. We already have the GW Basic source code.

How long it will take to the MSX Basic source code to appear? Maybe Nishi has it.

Page 2/3
1 | | 3