BASIC developers/experts: I need your help!

Страница 3/4
1 | 2 | | 4

By sd_snatcher

Prophet (3642)

Аватар пользователя sd_snatcher

09-10-2011, 22:16


There are plenty of things that I would like to squeeze in (like for example DO / LOOP) but where to put the code! That 16KB has only ~ 50 bytes left ATM and I'm sort of good ideas:
- If I take out commands -> I break compatibility with existing applications -> Not a good idea
- If I expand up (>#8000) I will break compatibility with major number of existing applications and I will reduce the space needed for source, variables & compiled code -> Not a good idea
- If I expand down (<#4000) I end up doing heavy page switching as XBASIC is pretty BIOS intensive -> Huge work, more slow -> Not a good idea
- If I implement mapper support, then mapper hardware is required and I will break compatibility with Nestor BASIC and possibly other software that require mapper -> Not a good idea

AFAIK, the MSX BASIC-Kun was meant to be a ROM. You can adopt the ROM approach, then expand it to >8000h without too much trouble.

Also, another source for ideas may be the MSX BASIC-Kun that was built in inside the Sanyo PHC-70FD* machines. This version runs on 8000h and probably does some things differently. It may worth a look.

By PingPong

Prophet (4093)

Аватар пользователя PingPong

09-10-2011, 23:21

Yes, it is possible. I've actually tried this long time ago. Theory goes something like this: you need to POKE correct compile address to memory. Start your program with END command, execute _RUN, BSAVE the compiled code, patch the first jump to "END" with call to own init routine where you select X-BASIC to #4000-#7FFF area and call variable init routine. You also need to patch the real end of code with own code that sets the slots back.

Even if you want DOS COM-files you just need rip the runtime and order the memory correctly... Although that is not very easy there is no need re-implementing BIOS or anything like that. So far I have anyway always found space also for the source, so I have not needed to do tricks like these.

Ok. I explain my idea: assuming xbasic kun compiler sources are available, my idea is to adapt those sources to compile an entire program and write a stand alone binary, for later use.
Are those sources available?

Or you know about internal workings because you have disassebled or rev. engineered the xbasic rom?

By NYYRIKKI

Enlighted (6016)

Аватар пользователя NYYRIKKI

10-10-2011, 00:52

AFAIK, the MSX BASIC-Kun was meant to be a ROM. You can adopt the ROM approach, then expand it to >8000h without too much trouble.

Do I need to explain how bad idea that is? If you want to use the program then on real MSX you need external cartridge to put XBASIC. Also everytime the compiler needs to read a byte from source or write a byte of compiled code, it needs to swap slots. Also using runtime routines needs interslot calls -> horrible slow, huge work to make it work -> extremely bad idea.

Also, another source for ideas may be the MSX BASIC-Kun that was built in inside the Sanyo PHC-70FD* machines. This version runs on 8000h and probably does some things differently. It may worth a look.

No, don't let them fool you... It works pretty much same as the BIN-version that I posted. Difference is that it is stored to ROM instead of disk. Trick is this: In this machine the XBASIC is stored in #8000 but when you activate it, it will be copied to RAM #4000 so only special thing in this ROM is that some brilliant engineer from Sanyo has hacked internal ROM-loader to it. Smile Ugly stuff...

By NYYRIKKI

Enlighted (6016)

Аватар пользователя NYYRIKKI

10-10-2011, 01:05

Yes, it is possible. I've actually tried this long time ago. Theory goes something like this: you need to POKE correct compile address to memory. Start your program with END command, execute _RUN, BSAVE the compiled code, patch the first jump to "END" with call to own init routine where you select X-BASIC to #4000-#7FFF area and call variable init routine. You also need to patch the real end of code with own code that sets the slots back.

Even if you want DOS COM-files you just need rip the runtime and order the memory correctly... Although that is not very easy there is no need re-implementing BIOS or anything like that. So far I have anyway always found space also for the source, so I have not needed to do tricks like these.

Ok. I explain my idea: assuming xbasic kun compiler sources are available, my idea is to adapt those sources to compile an entire program and write a stand alone binary, for later use.
Yes, I was trying to explain theory of how to make stand alone binary. (Although you still need at least runtime part of XBASIC)

Or you know about internal workings because you have disassebled or rev. engineered the xbasic rom?

Yes... This new version has been made by disassembling the original ROM and then recompiling it with these modifications.

I agree that disassembling compiler that has code, data, tables, commands inside commands, code that becomes code after compiler is compiled and compiler compiles packed code Face and all the other possible tricks used is maybe not the brightest idea, but I newer tend to take the most easy projects. Tongue Anyway: Now it is moved to different address and no complaints so far... I think I've done pretty good job Cool

By NYYRIKKI

Enlighted (6016)

Аватар пользователя NYYRIKKI

10-10-2011, 18:11

... or then just no one has tested this version (?)

By Manuel

Ascended (19273)

Аватар пользователя Manuel

10-10-2011, 19:55

How is the ROM of MSX-BASIC kun divided? How much is runtime? How much is the compiler? What else is there?

By frits9164

Resident (64)

Аватар пользователя frits9164

11-10-2011, 12:38

Hyvää päivää NYYRIKKI,
May I ask you a question: "are you a son of Tapio?".
It is of course no need to reply! (Joke)
Already have an answer to your question above, about XBasic and MSX-KUN?
But I do have a question! Is there a manual or a description of these compilers?
About what can or can not, what new or old? Or a list of syntax with explanation?
That would be very welcome for me, because I do it now with a lot of trial!
Greetings to Finland!
Terveiset Suomen kanssa loputtomia metsiä, järviä ja saaria.

PS. I was in Finland a long time ago: Helsinki, Lathi, Tampere, Turku and Somero, etc.
Frits9164

By MsxKun

Paragon (1115)

Аватар пользователя MsxKun

11-10-2011, 13:49

Already have an answer to your question above, about XBasic and MSX-KUN?

Me? Tongue I think you mean Basic-Kun? BA-team

By NYYRIKKI

Enlighted (6016)

Аватар пользователя NYYRIKKI

11-10-2011, 14:27

How is the ROM of MSX-BASIC kun divided? How much is runtime? How much is the compiler? What else is there?

First 11KB is the compiler and last 5KB is the runtime library.

By NYYRIKKI

Enlighted (6016)

Аватар пользователя NYYRIKKI

11-10-2011, 14:32

Hyvää päivää NYYRIKKI,
May I ask you a question: "are you a son of Tapio?".

Yes, I'm the son of god of forest, master of the squirrels. In Finland we say "meni metsään" = "Went to the forest" when something goes horribly wrong.

But I do have a question! Is there a manual or a description of these compilers?
About what can or can not, what new or old? Or a list of syntax with explanation?

It works pretty much same as MSX-BASIC but with some limitations. You can find manual here:
http://www.mccm.hetlab.tk/millennium/milc/basic/topic_0.htm

New commands are mentioned in first post.

Страница 3/4
1 | 2 | | 4