Mospeed: a basic v2 compiler

You need an actual VIC.

Moderator: Moderators

Post Reply
nippur72
de Lagash
Posts: 574
Joined: Thu Sep 07, 2006 8:35 am

Mospeed: a basic v2 compiler

Post by nippur72 »

There's a new cool basic V2 compiler for VIC 20 and C64:

https://github.com/EgonOlsen71/basicv2

Features:

- very fast, on average 10% faster than "Basic Boss"
- modern: cross compiles on the PC (generates a .prg)
- produces assembler source
- lots of fine-tuned optimizations

How to use it:

1) install Java or JRE (https://www.java.com/it/download/)
2) download Mospeed from here
3) extract the .ZIP file, (olnly the "dist" folder is needed)
4) copy the .bas program to compile in the "dist" folder
5) from the command prompt CD to the "dist" folder
6) run the compiler with

Code: Select all

mospeed example.bas -target=example -platform=vic20
After compiling it, the file "example" can be loaded on VICE.

The "generatesrc" option generates the assembler if you want to have a look at it:

Code: Select all

mospeed example.bas -target=example -generatesrc=true -platform=vic20
The project is active and issues can be submited on GitHub, the author reviews them quickly.

Mospeed by Egon Olsen
https://github.com/EgonOlsen71/basicv2
groepaz
Vic 20 Scientist
Posts: 1188
Joined: Wed Aug 25, 2010 5:30 pm

Re: Mospeed: a basic v2 compiler

Post by groepaz »

interesting... might come in handy for some things. did anyone try it yet? is it target agnostic?
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
User avatar
vicist
Vic 20 Afficionado
Posts: 352
Joined: Tue Oct 09, 2012 5:26 am
Location: Sheffield, UK

Re: Mospeed: a basic v2 compiler

Post by vicist »

I gave it a go.

It only compiles C64 Basic programs as it uses the 64 BASIC and KERNAL routines. :(
nippur72
de Lagash
Posts: 574
Joined: Thu Sep 07, 2006 8:35 am

Re: Mospeed: a basic v2 compiler

Post by nippur72 »

sorry, in the post above I forgot to include the VIC20 switch:

Code: Select all

mospeed example.bas -target=example -platform=vic20
User avatar
Kweepa
Vic 20 Scientist
Posts: 1315
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

Re: Mospeed: a basic v2 compiler

Post by Kweepa »

Sounds amazing!
User avatar
vicist
Vic 20 Afficionado
Posts: 352
Joined: Tue Oct 09, 2012 5:26 am
Location: Sheffield, UK

Re: Mospeed: a basic v2 compiler

Post by vicist »

I'll give it another go.

P.S. The example.bas is a C64 basic program and does not require the vic20 switch. It works fine.
User avatar
Kweepa
Vic 20 Scientist
Posts: 1315
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

Re: Mospeed: a basic v2 compiler

Post by Kweepa »

I tried it with kweepout but the petcat output (to make the bas file) crashed the compiler.
I suspect lines like this are a problem:
.STRG "{home}"
(Probably should have converted this to a byte array instead?)

Also, the [generated assembler] code was enormous (not surprisingly) so I'd probably have to rewrite it to use 8k instead of unexpanded.

[To answer your questions below without derailing this thread too far, I let kweepa.com lapse when crunching at work a few years back and have only partially recovered it to kweepa.org. I just now uploaded kweepout there, and fixed up the original game thread and the announcement thread. Download]
Last edited by Kweepa on Sat Mar 16, 2019 9:52 am, edited 2 times in total.
nippur72
de Lagash
Posts: 574
Joined: Thu Sep 07, 2006 8:35 am

Re: Mospeed: a basic v2 compiler

Post by nippur72 »

where I can get kweepout? the whole www.kweepa.com seems unreachable (chinese site appears).
User avatar
orion70
VICtalian
Posts: 4341
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Re: Mospeed: a basic v2 compiler

Post by orion70 »

Also, I cannot visualize your avatar Kweepa.
User avatar
R'zo
Vic 20 Nerd
Posts: 514
Joined: Fri Jan 16, 2015 11:48 pm

Re: Mospeed: a basic v2 compiler

Post by R'zo »

I've been using austro compiler. It has limitations such as...
-you can't change the address it runs from
-because of the above this also limits your ability to
relocate character and screen locations.
-it doesn't allow for sys or usr commands or the use of
interupts.

Does this compiler share these or any other limitations?
R'zo
I do not believe in obsolete...
nippur72
de Lagash
Posts: 574
Joined: Thu Sep 07, 2006 8:35 am

Re: Mospeed: a basic v2 compiler

Post by nippur72 »

Yes, you can change the address, you can even change where variables must reside:

Code: Select all

/progstart=xxxxx|$yyyy 
/varstart=xxxxx|$yyyy 
/varend=xxxxx|$yyyy 
/runtimestart=xxxxx|$yyyy 
It also allows the use of SYS, the registers A,X,Y are taken from $030C, $030D, $030E and are written back after the SYS routine ends.

I'm not sure about interrupts, do you mean to call a compiled basic code as interrupt handler?
User avatar
R'zo
Vic 20 Nerd
Posts: 514
Joined: Fri Jan 16, 2015 11:48 pm

Re: Mospeed: a basic v2 compiler

Post by R'zo »

Can you run an irq parallel to to compiled basic?
R'zo
I do not believe in obsolete...
nippur72
de Lagash
Posts: 574
Joined: Thu Sep 07, 2006 8:35 am

Re: Mospeed: a basic v2 compiler

Post by nippur72 »

@Kweepa I managed to compile kweepout, there was a problem with "{cm-*}" that has been fixed. Also with "{left arrow}" that "petcat" renders as "_".

The result is a 13K file that doesn't run on unexpanded VIC, so I added the line:

Code: Select all

0 poke648,30:poke36869,240:poke36866,150
to make it work with a 16K expansion. Now it's so fast that is barely playable :-)

Get it here: https://github.com/nippur72/8-bit-proje ... t-compiled

Needs a 16K expansion and starts with: SYS 8192

BTW, I noticed that the +3K version "kweepoutmc.prg" that you released is slightly different (screen size)... can we have the source for it too? I would like to compile it as well.
User avatar
Kweepa
Vic 20 Scientist
Posts: 1315
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

Re: Mospeed: a basic v2 compiler

Post by Kweepa »

Oh, hah! Yes, it's totally unplayable! Needs a delay loop in there (that gets smaller as the game progresses).
KweepoutMC is mixed C/asm so your compiler wouldn't help...
Thanks!
Post Reply