Jump to content

Photo

BASIC compilers


29 replies to this topic

#1 Gunstar OFFLINE  

Gunstar

    Gunstar

  • 10,258 posts
  • Location:Kellyville, Oklahoma

Posted Thu Apr 11, 2019 8:54 AM

Do any stand-alone* compilers exist for Atari Basic or OSS Basic XE? Is BASIC XL compiler compatible with BASIC XE? (as long as extra BXE commands not in BXL are not in a program to be compiled?

 

*OSS BASIC XL and TBXE come with compilers, these above two do not.


Edited by Gunstar, Thu Apr 11, 2019 9:01 AM.


#2 thorfdbg OFFLINE  

thorfdbg

    Dragonstomper

  • 801 posts

Posted Thu Apr 11, 2019 10:11 AM

Yes, of course. The ABC compiler is a standalone compiler for Atari Basic, to name just one. (Though, to be fair, it is not really a compiler. It compiles to p-code which is then interpreted by its runtime).

#3 ricortes OFFLINE  

ricortes

    Dragonstomper

  • 689 posts

Posted Thu Apr 11, 2019 10:14 AM

For Atari BASIC I liked the performance of the MMG compiler. It had the option to save the assembly language intermediate files so you could fine tune the code or just see how a compiler generated code looked. It also had the option of using either a floating point or integer runtime package depending on what you wanted for accuracy or speed.



#4 Alfred OFFLINE  

Alfred

    Dragonstomper

  • 557 posts
  • Location:Elmwood, Ontario

Posted Thu Apr 11, 2019 10:48 AM

Basic XL doesn’t have a compiler, it just has a standalone run-time interpreter which executes the tokenized code.

#5 Nezgar ONLINE  

Nezgar

    Stargunner

  • 1,980 posts
  • Location:Saskatchewan Canada

Posted Thu Apr 11, 2019 11:25 AM

I found some on the pigwa site. (For Atari BASIC) http://ftp.pigwa.net...t/Holmes Utils/

 

As already mentioned, I'm also pretty sure they are all just runtimes with the Pcode appended. I remember making a program to simply poke 10 bytes, and it was like 10K. I was impressed with myself when I managed to rewrite it in assembler and compile it to 42 bytes. :D

 

Der Basic Compiler (Datasoft) - http://ftp.pigwa.net... (Datasoft).zip

MMG Basic Compiler A - http://ftp.pigwa.net... Compiler A.zip

MMG Basic Compiler B - http://ftp.pigwa.net... Compiler B.zip

MMG Basic Compiler 2.0 [alt] - http://ftp.pigwa.net...r 2.0 [alt].zip

MMG Basic Compiler 2.0 [alt.2] - http://ftp.pigwa.net...2.0 [alt.2].zip

ABC A Basic Compiler 1.02 - http://ftp.pigwa.net...mpiler 1.02.zip

ABC A Basic Compiler 1.03 [pro] - http://ftp.pigwa.net... 1.03 [pro].zip

ABC A Basic Compiler 1.05 - http://ftp.pigwa.net...mpiler 1.05.zip



#6 Gunstar OFFLINE  

Gunstar

    Gunstar

  • Topic Starter
  • 10,258 posts
  • Location:Kellyville, Oklahoma

Posted Thu Apr 11, 2019 12:38 PM

Basic XL doesn’t have a compiler, it just has a standalone run-time interpreter which executes the tokenized code.

Huh, I wonder why I've been under the impression that it came with both. Maybe just mis-remembering from TBXL. Thanks!



#7 Gunstar OFFLINE  

Gunstar

    Gunstar

  • Topic Starter
  • 10,258 posts
  • Location:Kellyville, Oklahoma

Posted Thu Apr 11, 2019 12:52 PM

I found some on the pigwa site. (For Atari BASIC) http://ftp.pigwa.net...t/Holmes Utils/

 

As already mentioned, I'm also pretty sure they are all just runtimes with the Pcode appended. I remember making a program to simply poke 10 bytes, and it was like 10K. I was impressed with myself when I managed to rewrite it in assembler and compile it to 42 bytes. :D

 

Der Basic Compiler (Datasoft) - http://ftp.pigwa.net... (Datasoft).zip

MMG Basic Compiler A - http://ftp.pigwa.net... Compiler A.zip

MMG Basic Compiler B - http://ftp.pigwa.net... Compiler B.zip

MMG Basic Compiler 2.0 [alt] - http://ftp.pigwa.net...r 2.0 [alt].zip

MMG Basic Compiler 2.0 [alt.2] - http://ftp.pigwa.net...2.0 [alt.2].zip

ABC A Basic Compiler 1.02 - http://ftp.pigwa.net...mpiler 1.02.zip

ABC A Basic Compiler 1.03 [pro] - http://ftp.pigwa.net... 1.03 [pro].zip

ABC A Basic Compiler 1.05 - http://ftp.pigwa.net...mpiler 1.05.zip

Thank you, I'll look into them, I see no reason, if they are all just runtimes, to bother for Atari Basic though, as I think enough of the community has access to Atari Basic if I release a program, unless they do actually speed up the execution. And it would have to speed it up more than BASIC XL/XE and TBXL already can do running Atari Basic programs. I'm more interested in a true compiler. I'm mainly using Basic XE (though I don't mind restraining my programming to what would run on Atari Basic or TBXL). I like Basic XE because I use so much main memory with SpartaDOS (even with SD located in extended memory with BANKED) that I'm only left with about 26K free main memory, but I still have 336K extended memory free, even with SpartaDOS and a 180K ramdisk in extended from my 576K 1200XL. With Basic XE I can use the EXTEND command and have a full 64K programming area in extended memory to use without having to worry about banking myself, it's automatic. I was hoping for a true compiler though, like TBXL has...even if it was for Atari Basic and I had to not use Basic XE's extended commands to remain compatible.


Edited by Gunstar, Thu Apr 11, 2019 1:00 PM.


#8 thorfdbg OFFLINE  

thorfdbg

    Dragonstomper

  • 801 posts

Posted Thu Apr 11, 2019 2:00 PM

 

I'm more interested in a true compiler.

 
MMG is a true compiler. But that does not mean that its compiled code is much faster than that of ABC. It will just consist of a series of JSR instructions... similar subroutines are also in the ABC runtime, just dispatched by its p-Code, so it does not make much of a difference.

Do not expect an optimizing compiler as you would find them nowadays. They are all - including the TBXL compiler - pretty straightforward.

ABC has actually been more used for "copy protection" purposes as it is quite hard to follow the program logic through the pCode. A couple of Microprose titles have been written with it. Solo Flight and F15 Strike Eagle are to major parts in ABC-compiled BASIC.

#9 Gunstar OFFLINE  

Gunstar

    Gunstar

  • Topic Starter
  • 10,258 posts
  • Location:Kellyville, Oklahoma

Posted Thu Apr 11, 2019 2:44 PM

   
MMG is a true compiler. But that does not mean that its compiled code is much faster than that of ABC. It will just consist of a series of JSR instructions... similar subroutines are also in the ABC runtime, just dispatched by its p-Code, so it does not make much of a difference.

Do not expect an optimizing compiler as you would find them nowadays. They are all - including the TBXL compiler - pretty straightforward.

ABC has actually been more used for "copy protection" purposes as it is quite hard to follow the program logic through the pCode. A couple of Microprose titles have been written with it. Solo Flight and F15 Strike Eagle are to major parts in ABC-compiled BASIC.

I'm just relearning BASIC after 30 years, and my skills were pretty primitive even back then. So I really don't know what to expect from a compiler, from today or yesteryear. I've never used one.


Edited by Gunstar, Thu Apr 11, 2019 2:47 PM.


#10 jefffulton OFFLINE  

jefffulton

    Chopper Commander

  • 150 posts

Posted Thu Apr 11, 2019 4:17 PM

Even the version of Turbo Basic XL I just played with last night isn't a "true" compiler. It compiles to a runtime type file. 
I would love to find a basic compiler that will make a .com or .xex or .exe file for me that can be run from the L command in DOS 2.5



#11 CharlieChaplin OFFLINE  

CharlieChaplin

    River Patroller

  • 3,137 posts

Posted Thu Apr 11, 2019 4:49 PM

Even the version of Turbo Basic XL I just played with last night isn't a "true" compiler. It compiles to a runtime type file. 
I would love to find a basic compiler that will make a .com or .xex or .exe file for me that can be run from the L command in DOS 2.5

 

MMG does create a COM/XEX file that can be run from the "L" command in DOS 2.5 (alas, not all Basic files will compile and errmm, sometimes even the created COM/XEX does not run). It does compile in several steps and always saves some data to disk, so it is best to copy it on a 180k disk first and use two floppy drives (D1: with MMG on a 180k DOS 2.0d disk, D2: with an empty 180k disk) or two virtual drives under emulation (and set the emulator to full speed, so compiling is done within a few seconds). Don't make the program fully reset-proof, add a Poke 580,1 or some key-combo to reboot the real Atari...

 

For TB XL do the following: step 1 compile the TB XL file (result: a CTB file), step 2 use the CTB-linker and link the Runtime + the CTB file into one COM/XEX file (CTB runtime has a length of 11k, so any linked CTB=>COM/XEX will be 11k longer then), step 3 add a Basic-off routine and a titlescreen, so you don't need to hold down the Option-key or stare at a blue+empty screen while loading. And don't make the program fully reset-proof, add a Poke 580,1 or some key-combo to reboot the real Atari...

 

Alternatively, use Fast-Basic which will also compile into a COM/XEX file.


Edited by CharlieChaplin, Thu Apr 11, 2019 4:57 PM.


#12 jefffulton OFFLINE  

jefffulton

    Chopper Commander

  • 150 posts

Posted Thu Apr 11, 2019 4:55 PM

Thanks, Charlie! 



#13 CharlieChaplin OFFLINE  

CharlieChaplin

    River Patroller

  • 3,137 posts

Posted Thu Apr 11, 2019 4:55 PM

Basic XL doesn’t have a compiler, it just has a standalone run-time interpreter which executes the tokenized code.

 

Correct. The only "runtime" I have seen for BXL is version 1.0 or 1.01 and it looks like this runtime works well with BXL programs created with BXL 1.0. But I also found a few BXL programs created with BXL 1.02 or 1.03 that did not work with that runtime (but worked okay with the latest BXL version)...



#14 jefffulton OFFLINE  

jefffulton

    Chopper Commander

  • 150 posts

Posted Thu Apr 11, 2019 5:20 PM

 Thanks! I think I'll try Fast Basic. I know it's relatively new.  (lats 10- years new). 
But TB XL looks great. The only docs I have are in German! 

 

MMG does create a COM/XEX file that can be run from the "L" command in DOS 2.5 (alas, not all Basic files will compile and errmm, sometimes even the created COM/XEX does not run). It does compile in several steps and always saves some data to disk, so it is best to copy it on a 180k disk first and use two floppy drives (D1: with MMG on a 180k DOS 2.0d disk, D2: with an empty 180k disk) or two virtual drives under emulation (and set the emulator to full speed, so compiling is done within a few seconds). Don't make the program fully reset-proof, add a Poke 580,1 or some key-combo to reboot the real Atari...

 

For TB XL do the following: step 1 compile the TB XL file (result: a CTB file), step 2 use the CTB-linker and link the Runtime + the CTB file into one COM/XEX file (CTB runtime has a length of 11k, so any linked CTB=>COM/XEX will be 11k longer then), step 3 add a Basic-off routine and a titlescreen, so you don't need to hold down the Option-key or stare at a blue+empty screen while loading. And don't make the program fully reset-proof, add a Poke 580,1 or some key-combo to reboot the real Atari...

 

Alternatively, use Fast-Basic which will also compile into a COM/XEX file.



#15 CharlieChaplin OFFLINE  

CharlieChaplin

    River Patroller

  • 3,137 posts

Posted Thu Apr 11, 2019 5:49 PM

 Thanks! I think I'll try Fast Basic. I know it's relatively new.  (lats 10- years new). 
But TB XL looks great. The only docs I have are in German! 

 

Afaik, Ron Fetzer, Dave & Laura Yearke and several others translated the german TB XL docs into english in the 80s (or early 90s). Thus, TB XL was (is) available in several PD-libraries with english docs. One TB XL version with english docs can be found e.g. here:

 

http://www.atarionli...Basic XL Manual

 

(in the DOS use e.g. TYP *.DOC to display the docs on the screen)


Edited by CharlieChaplin, Thu Apr 11, 2019 5:51 PM.


#16 Gunstar OFFLINE  

Gunstar

    Gunstar

  • Topic Starter
  • 10,258 posts
  • Location:Kellyville, Oklahoma

Posted Fri Apr 12, 2019 8:02 AM

 

MMG does create a COM/XEX file that can be run from the "L" command in DOS 2.5 (alas, not all Basic files will compile and errmm, sometimes even the created COM/XEX does not run). It does compile in several steps and always saves some data to disk, so it is best to copy it on a 180k disk first and use two floppy drives (D1: with MMG on a 180k DOS 2.0d disk, D2: with an empty 180k disk) or two virtual drives under emulation (and set the emulator to full speed, so compiling is done within a few seconds). Don't make the program fully reset-proof, add a Poke 580,1 or some key-combo to reboot the real Atari...

 

For TB XL do the following: step 1 compile the TB XL file (result: a CTB file), step 2 use the CTB-linker and link the Runtime + the CTB file into one COM/XEX file (CTB runtime has a length of 11k, so any linked CTB=>COM/XEX will be 11k longer then), step 3 add a Basic-off routine and a titlescreen, so you don't need to hold down the Option-key or stare at a blue+empty screen while loading. And don't make the program fully reset-proof, add a Poke 580,1 or some key-combo to reboot the real Atari...

 

Alternatively, use Fast-Basic which will also compile into a COM/XEX file.

Thanks for clearing all that up. Since I've had no real experience with compilers, this is all I really wanted from a Basic compiler; to turn a Basic program into an executable file. And I am hoping for some speed improvement over running in Basic. I'm guessing and hoping, that as long as I stick to only the original Atari Basic commands, that even if I use Basic XE to code, that I should be able to use either of these compilers for the program. I see no reason why the Basic editor I use should matter as long as I stick to Atari Basic commands.

 

Does having machine language sub-routines make any difference when using these compilers?



#17 jefffulton OFFLINE  

jefffulton

    Chopper Commander

  • 150 posts

Posted Fri Apr 12, 2019 10:35 AM

I started going through the Dr. C Wacko Basic Game development book using the TBXL. It works, this version of TBXL doesn't a linker, so I have to make an ATR with the runtime to have a standalone. It looks like there are like 15 versions of Turbo Basic XL/XE/ENHANCED/EXTENDED so there must be one with the linker up there on the Wiki. I also found the English Language docs. 



#18 MrFish OFFLINE  

MrFish

  • 5,474 posts

Posted Fri Apr 12, 2019 10:43 AM

The disks here have the linker: TBXL v1.5



#19 ricortes OFFLINE  

ricortes

    Dragonstomper

  • 689 posts

Posted Fri Apr 12, 2019 12:35 PM

The MMG compiler is cute in that it takes what should have been an obviously simple and straight forward to something that I completely missed. A DOH momment.

 

IIRC the runt time as pointed out is just a bunch of canned code that your compiled code jumps to while passing parameters. That is you have ~4k block of routines that follow the OS design philosophy where the heavy lifting of something like a GRAPHICS(0) statement is mostly done in the OS. What I found interesting in the MMG compiler was they used a BASIC to assembly language converter where just about everything was an assembly language label. Something like 

10 GOTO 20

would be translated to something like

10

   JMP 20

20

   more code i.e. LDA #0 JSR GRAPHICS <in the runtime.>

 

Of course with all the jumping around, it wouldn't run as fast as in line code, but then it was pretty tight with respect to length.



#20 toddtmw OFFLINE  

toddtmw

    Dragonstomper

  • 636 posts
  • Location:Cincinnati, Ohio

Posted Fri Apr 12, 2019 7:12 PM

I used MMG compiler BITD and it was pretty awesome. There some (pretty well documented) things you couldnt do in your basic program Id you wanted to compile it.

#21 TGB1718 OFFLINE  

TGB1718

    Chopper Commander

  • 103 posts

Posted Sat Apr 13, 2019 5:24 AM

I have an original DataSoft Basic Compiler produced in 1983 (actually called The Atari Basic Compiler).

 

My only criticism with it is the amount of disk swaps (5 I believe) to compile a program if you only have a single drive.

 

It was produced before the 130XE so didn't take advantage of the extra RAM to speed things up.

 

Appart from an executable, it also produce .asm files if you wanted to modify the code and assemble with

a normal Assembler



#22 Allan OFFLINE  

Allan

    Quadrunner

  • 6,382 posts
  • Location:Wallingford, CT

Posted Sat Apr 13, 2019 5:38 AM

I have an original DataSoft Basic Compiler produced in 1983 (actually called The Atari Basic Compiler).

 

My only criticism with it is the amount of disk swaps (5 I believe) to compile a program if you only have a single drive.

 

It was produced before the 130XE so didn't take advantage of the extra RAM to speed things up.

 

Appart from an executable, it also produce .asm files if you wanted to modify the code and assemble with

a normal Assembler

Is this just an ATR you found on the Web, or is this an original copy with manual, box etc.?

 

Allan



#23 TGB1718 OFFLINE  

TGB1718

    Chopper Commander

  • 103 posts

Posted Sat Apr 13, 2019 6:27 AM

Original Book with disk, cover looks a bit "off", it was in my garage for years which was quite damp, I was 

surprised that the disk still ran.

Attached Thumbnails

  • Basic Compiler1.jpg
  • Basic Compiler.jpg


#24 Nezgar ONLINE  

Nezgar

    Stargunner

  • 1,980 posts
  • Location:Saskatchewan Canada

Posted Sat Apr 13, 2019 9:23 AM

Does that disk have a version other than 1.02, 1.03, or 1.05? Good to get archived if it's something else.

I don't see that manual up on Internet Archive yet, does anyone know if this is online anywhere else? If not, it would be great to get it scanned. I'd be happy to help clean up and PDF the document if you can make the raw scans.

#25 jefffulton OFFLINE  

jefffulton

    Chopper Commander

  • 150 posts

Posted Sat Apr 13, 2019 10:39 AM

Yeah, MMG looks great for standard basic programs (I mean those written in standard Atari basic). The manual gives some good optimizing tips. This could be a winner for playing with making some simple games and learning the ins and outs of the machine. 






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users