From X-Basic to ROM?

Pagina 4/4
1 | 2 | 3 |

Van Amaury Carvalho

Resident (36)

afbeelding van Amaury Carvalho

11-08-2021, 19:07

Hi guys! Thanks for testing the msxbas2rom compiler!

While the compiled code generated by msxbas2rom does have optimization opportunities, much of the difference in speed compared to xBasic stems from design decisions that result in more controls embbeded on the binary code which gives msxbas2rom greater compatibility and flexibility of use than xbasic.

For example, there is greater support for data type casting, broader support in FOR/NEXT, support for additional functions and commands...

Also, since compilation does not occur at runtime on MSX (it occurs on PC), there's also saving of that runtime compilation time that occurs on xbasic when reading a larger program, as well as more memory space freed for the final compiled code.

I suggest starting by compiling small programs to identify the nuances and differences of this new compiler, and incrementally evolve to compile a more complex program.

Van PingPong

Prophet (4093)

afbeelding van PingPong

11-08-2021, 20:59

hi, effectively one thing i like it is the ability to print text in graphic mode.
I see also you call the same routine we used to call when using the print #n msxbasic routine.
this is one thing i've also dreamed i i did not knew why the big cousin (GWBASIC) running on IBM PC could print even in gfx modes.
Is there a way to achieve also the vertical scroll? In GWBASIC i can type LIST even in CGA 320x200 4 color Gfx mode.
Obviously is rather slow but it works!

Van Amaury Carvalho

Resident (36)

afbeelding van Amaury Carvalho

11-08-2021, 21:08

PingPong, for now you can use SET SCROLL (works only on MSX2 machines) or COPY (works only the first syntax explained on the page and with some limitations) to achieve a kind of scroll effect....

But its on my backlog to research and implement more specialized scroll commands that can run smoothly on msx 1 machines....

Van Pineapple

Resident (45)

afbeelding van Pineapple

11-08-2021, 21:20

gdx wrote:

What is the size of your Basic program exactly? I can make a ROM in the you will just have to insert your program with a hexa editor if you want.

That would be quite helpful, thanks. My basic program is at about 17K right now, but I still need to add sound and music, so it will get a little bigger by the time I'm done.

Van Amaury Carvalho

Resident (36)

afbeelding van Amaury Carvalho

11-08-2021, 22:12

For large source codes you can try to compile it in MegaROM mode, just like that:

msxbas2rom -c -x program.bas

But be warned that MegaROM mode its even more experimental in current stage of msxbas2rom development...

Van PingPong

Prophet (4093)

afbeelding van PingPong

11-08-2021, 22:12

thx, already knew. I do msx programming in assembler and know vdp registers and msx2 blitter.
By the way is there an option to get the asm source of the compiled basic code?
I'm a passionate about compilers, lexers, parsers and code generator, do i would like to see some internals

Van Amaury Carvalho

Resident (36)

afbeelding van Amaury Carvalho

11-08-2021, 22:17

PingPong you can compile your program using -s parameter to get a symbol file that can be loaded on OpenMSX Debugger.

With the symbol file loaded, you will have tags to each line of your code (and variables address) on the debugger assembly list.

Pagina 4/4
1 | 2 | 3 |