Jump to content

Photo

TURBO-BASIC XL-Source Code now in PD and online! :-)))

TURBO-BASIC TURBO-BASIC XL Source Code

86 replies to this topic

#26 luckybuck OFFLINE  

luckybuck

    Dragonstomper

  • Topic Starter
  • 957 posts

Posted Wed May 24, 2017 11:32 AM

@ijor:

You did read:

http://atariage.com/...d/#entry3760293

?

Frank has left us in 2011, there will be no original source code. The one published is as far as we can get. It is from someone with contact to Frank in the golden age. I didn't wrote 'original' source code. And objection: this is not a pure disassembly! There are many comments in the code, of course in German, but they are inside! A pure disassembly can't do that. All major points have comments, so the user can get into the code. Look at vitoco's work above and please wait for an assembly done with the Bibo Assembler. Stepe by step, one after another. Compare the Star Raiders code with the one from Lorenz. Sure, original ones have more value, but I inted to put the focus on more usability. Therefore, Altirra is a really good option, Basic++ is another, and Hypra-Soft-Basic. As posted before, interbreeding will give us the best verson available.

ijor, please don't mind, but I really don't want to go further here, there is too much on my list. When the digitizing project is finished and all source codes are in the can, we can continue here. But I will take your point, of course.



#27 peteym5 OFFLINE  

peteym5

    River Patroller

  • 2,378 posts
  • Location:Buffalo NY USA

Posted Wed May 24, 2017 12:07 PM

This is what I translated so far.

 

I would assume .OR is the same as ORG.   I am just questioning if .da should be translated to .byte or .dta, it is a long piece of programming. I am not sure if TurboBasicXL uses any self modifying code. If not, it can probably be assembled to run from a AtariMax or Williams cartridge. Would need to add bank switching code.

Attached Files



#28 Larry OFFLINE  

Larry

    River Patroller

  • 4,083 posts
  • Location:U.S. -- Midwest

Posted Wed May 24, 2017 12:08 PM

I'm certainly impressed with the work which is going on for this TBXL Source!  The Ultra Disassembler refers to this type of re-creation as "Pseudo-Source."  Maybe that would be a good description for this. Wow, getting some of our really good assembler guys on this project and an "Ultimate Basic" is very possible, although we already have several truly good ones. 

 

I've always thought of Basic XE as just a small notch above TBXL because it has (optional) string arrays which are very useful in some circumstances.  BXE is a bit slower, but still no slouch as far as Basic goes.  But I'm sure there are a lot of folks who have other opinions!

 

Congrats on your fine work, Luckybuck, and all those who help in this endeavor.

 

-Larry 



#29 luckybuck OFFLINE  

luckybuck

    Dragonstomper

  • Topic Starter
  • 957 posts

Posted Wed May 24, 2017 12:39 PM

Thanks Larry, yes it is still a long way to go, but worth to go it.

 

Besides other Basic, please take into account the Integer BASIC from OSS. Else, an Ultimate Basic on a 64 KB cartridge?

 

Thanks peteym5 for the file. On AtariWiki you already will find a cartridge file created from Turbo-Basic XL.



#30 vitoco OFFLINE  

vitoco

    Moonsweeper

  • 321 posts

Posted Wed May 24, 2017 1:32 PM

Just, IMHO, you have to make perfectly clear to anybody reading this page or your web site, what exactly comes from original sources and what from a reverse engineered work. e.g. the very same title of this thread is inaccurate.

 

I have to agree in this point. This thread announced the release of the source code of Turbo BASIC XL, which is not completely true, because we have found that it is not the same code than what we know as Turbo BASIC XL 1.5. This source code probably matches about 95% of it, but there is another 5% that is not from Frank. It seems to be a derivative work labeled as 2.0 and we don't know what are all the changes it includes for (we've already found at least two differences so far). 

 

Frank has left us in 2011, there will be no original source code. The one published is as far as we can get. It is from someone with contact to Frank in the golden age. I didn't wrote 'original' source code. And objection: this is not a pure disassembly! There are many comments in the code, of course in German, but they are inside! A pure disassembly can't do that. All major points have comments, so the user can get into the code.

 

Of course, the labels and comments inside the 2.0 source will help the decompilation and reconstruction of the officially published version 1.5, but it will never be the "original" source code of this. Also, we don't know if the comments and labels were put in the source by Frank or by your contact.

 

Anyway, the point is that it should be adviced that the source code published in AtariWiki is for a different (probably unreleased) version of Turbo BASIC XL, and the title of this thread should be changed to show that, as well as a note in Turbo BASIC XL's AtariWiki page. The fact that the title does not say "original" does not mean that it is "not original".  ;)



#31 luckybuck OFFLINE  

luckybuck

    Dragonstomper

  • Topic Starter
  • 957 posts

Posted Wed May 24, 2017 1:40 PM

How to change titles on AA?



#32 peteym5 OFFLINE  

peteym5

    River Patroller

  • 2,378 posts
  • Location:Buffalo NY USA

Posted Wed May 24, 2017 3:18 PM

Well what ever version this is, this is what I had translated so far to have it compile with Mads Assembler. I am very sure some of us will love to add a ton of commands and functions to this thing, but first thing is it figure out everything this Biblo assember did and its equivalents on other assemblers.  We might need an utility to remove the line numbers.

 

Have a question about this:

 

03000 L0989    WORD #Y1277-1
03010 L0991    WORD /Y1277-1  ;Is this high and low?
 

I am not sure if preceding a label with # and / is for low and high address.

Attached Files


Edited by peteym5, Wed May 24, 2017 3:58 PM.


#33 dmsc OFFLINE  

dmsc

    Moonsweeper

  • 478 posts
  • Location:Viņa del Mar, Chile

Posted Wed May 24, 2017 5:36 PM

Hi,
 

Well what ever version this is, this is what I had translated so far to have it compile with Mads Assembler. I am very sure some of us will love to add a ton of commands and functions to this thing, but first thing is it figure out everything this Biblo assember did and its equivalents on other assemblers.  We might need an utility to remove the line numbers.
 
Have a question about this:
 
03000 L0989    WORD #Y1277-1
03010 L0991    WORD /Y1277-1  ;Is this high and low?
 
I am not sure if preceding a label with # and / is for low and high address.


Yes, those are equivalent to "#<" and "#>" respectively.

Vitoco already posted the translated sources in post#16: http://atariage.com/...line/?p=3768221

Problem is that, as we don't have the resulting binaries, you can't be sure even if the produced file works as intended.

#34 peteym5 OFFLINE  

peteym5

    River Patroller

  • 2,378 posts
  • Location:Buffalo NY USA

Posted Wed May 24, 2017 6:11 PM

I just tried assembling it. The text on the splash screen is not correct. I will try something other than .byte like dta or .sb. It goes through the CIO in the OS to print the text on the screen, it is not copied directly.

The data tables also maybe off also.

I am also translating some of the German into English, and expanding out some of the labels so we have a better ideal what is going on.


Edited by peteym5, Wed May 24, 2017 6:13 PM.


#35 vitoco OFFLINE  

vitoco

    Moonsweeper

  • 321 posts

Posted Wed May 24, 2017 7:19 PM

I just tried assembling it. The text on the splash screen is not correct.

 

I'm sorry, I attached a wrong version, which I noticed and changed some minutes later, but I failed again and uploaded the same bad file... It was too late and I was tired.

 

Just do a global replace of all double quotes (") to turn them into single quotes ('). Then, it will compile OK in MADS. But as dmsc said, we need a binary compiled by BIBO assembler to be sure that it is really OK. I tried some hours ago unsuccessfully, and I'll try again in a couple of hours.

 

About the translation of the labels and comments into English, what do others think?



#36 Larry OFFLINE  

Larry

    River Patroller

  • 4,083 posts
  • Location:U.S. -- Midwest

Posted Thu May 25, 2017 6:00 AM

 

...

About the translation of the labels and comments into English, what do others think?

 

Definitely.  It will help others "pick up the baton" and work with the code.

 

-Larry



#37 luckybuck OFFLINE  

luckybuck

    Dragonstomper

  • Topic Starter
  • 957 posts

Posted Thu May 25, 2017 6:11 AM

@dmsc: Well, we have the binary from the original program, please see attached. So, we have from the compiler and runtime.

 

@all:

 

Will try to get a compiled Bibo Assembler version out of it. If we can agree each other on one final format, I even would translate all German stuff into English.

 

With a good editor, UltraEdit, Sublime Text and even Word(!), one can cut columns out of the code... ;-)

 

Personally, I would prefer to have it in MAC/65 format, my all time favorite. MADS can cope with that format... ;-)

Attached Files


Edited by luckybuck, Thu May 25, 2017 6:25 AM.


#38 peteym5 OFFLINE  

peteym5

    River Patroller

  • 2,378 posts
  • Location:Buffalo NY USA

Posted Thu May 25, 2017 7:41 AM

I already started translating and renaming stuff as I discover what stuff does. I am trying to determine what that extra byte does inside the token table. It must be necessary, something not present in other Atari Basics token tables. I am wondering if 2.0 is the fixed version that allows the timer to work properly on NTSC machines.  Not sure if it checks the PAL register ($D014) to check the frame rate.

Attached Files


Edited by peteym5, Thu May 25, 2017 7:46 AM.


#39 vitoco OFFLINE  

vitoco

    Moonsweeper

  • 321 posts

Posted Thu May 25, 2017 8:18 AM

@dmsc: Well, we have the binary from the original program, please see attached. So, we have from the compiler and runtime.

 
The attached zip contains a corrupted AtariAmpelDecoder.exe file. It is neither a Win/DOS nor an Atari program. Actually, it has a Win header but it is full with zeroes. Anyway, I decoded the TurboAtariXL.txt file manually and compared it to the 1.5 version XEX and it is OK. That would be our starting version for a source recovery.

 

I tried to assemble 2.0 sources using BIBO unsuccessfully. First, I had to convert the ATASCII files into a BIBO-tokenized form using ENTER+SAVE commands in BIBO, and rewrite the TURBO.IN file which I also SAVEd. The ASM command gave me a duplicated label error, which was not true: I searched inside all the files for it and there was only one declaration and one use of it. I renamed it to see what would happen. It failed again, but with a branch too far error. So, BIBO assembler is processing in a bad way the zero page addressing (using 2 bytes instead of only 1 in operands), it is proccessing a portion of the code twice, or it is not the right assembler (SYNASSEMBLER shares some of the special syntax with BIBO).

 

If someone completes the compilation from within the Atari (or emulator), without the use of a cross-compiler, please share the resulting binary.

 



#40 luckybuck OFFLINE  

luckybuck

    Dragonstomper

  • Topic Starter
  • 957 posts

Posted Thu May 25, 2017 8:55 AM

@vitoco:

You are right, got it from here:

http://atariage.com/...d/#entry3762560

Same result here, the exe is empty, but the text files are fine.

Thank you! :-)



#41 peteym5 OFFLINE  

peteym5

    River Patroller

  • 2,378 posts
  • Location:Buffalo NY USA

Posted Thu May 25, 2017 9:04 AM

I am able to assemble the MADS version and it works. It must be copied into an ATR file first with DOS present. It won't load with Altirra Boot or Load Image probably because it loads under the O/S. I have a theory about what that extra byte in the command token table is doing. Looks like it is controlling the indent for IF, FOR, PROC, WHILE, REPEAT, etc. when you type list. Could also be checking if you have the right amount of terminating statements like ENDIF, NEXT, WEND, UNTIL, etc. I know Basic XE does that also, but does not appear to have that extra byte in the token table.

 

I would prefer we try to optimize this TurboBasicXL before adding any new commands. We want to leave room for the Basic program. I already spotted something that can be done when trying to figure out that token thing.

Y1063  PHA
       JSR Y1083
       PLA

There is only one JSR Y1083 in there, and not called anywhere. Can just copy and paste the code in place of that JSR.

 

Now Y1083 looks like this:

Y1063
Y1083
       PHA
       CMP #$08
       BEQ ?L2
       CMP #$3C
       BEQ ?L2
       CMP #$3E
       BEQ ?L2
       CMP #$45
       BEQ ?L2
       CMP #$4F
       BEQ ?L2
       CMP #$07
       BEQ ?L4
       JSR Y1055
       BNE ?L3
?L1    DEC ZP0B9
       DEC ZP0B9
       BPL ?L3
?L2    INC ZP0B9
       INC ZP0B9
       BMI ?L1
?L3    PLA
       RTS
?L4    LDA STATE_PTR
       PHA
       JSR L0423
       PLA
       STA STATE_PTR
       CPX #$1B
       BNE ?L2       
       PLA
       RTS

Edited by peteym5, Thu May 25, 2017 10:08 AM.


#42 luckybuck OFFLINE  

luckybuck

    Dragonstomper

  • Topic Starter
  • 957 posts

Posted Thu May 25, 2017 9:40 AM

@peteym5:

'I am able to assemble the MADS version and it works.'

with the file from post #38?



#43 vitoco OFFLINE  

vitoco

    Moonsweeper

  • 321 posts

Posted Thu May 25, 2017 11:49 AM

I've compiled with BIBO assembler. The binary is exactly the same than the one from my other post (with double quotes replaced) that I compiled using MADS.

But it has problems with FOR-NEXT loops.

#44 peteym5 OFFLINE  

peteym5

    River Patroller

  • 2,378 posts
  • Location:Buffalo NY USA

Posted Thu May 25, 2017 2:22 PM

@peteym5:

'I am able to assemble the MADS version and it works.'

with the file from post #38?

This was the one from #16. I had abandoned the other one since someone else already completed the work. I am working on translating and making the labels mean something to help everyone figure out what is going on.



#45 vitoco OFFLINE  

vitoco

    Moonsweeper

  • 321 posts

Posted Thu May 25, 2017 2:25 PM

As I previously said, I've compiled the sources of Turbo BASIC XL 2.0 and the result is in the attached ATR. This double density MyDos 4.5 disk also includes BIBO Assembler, all the source files in BIBO internal (SAVE) format and a BASIC program to test FOR-NEXT loops.

 

"BIBOASS.COM" is the BIBO assembler. "TURBO.BIB" is the main source file, which must be LOADed in BIBO and it includes the "TUR??.BIB" files during the assembly. "TURBO.COM" is the BASIC interpreter. "FORNEXT.BAS" is the test program.

 

These are some screenshots:

 

Splash screen for version 2.0:

TBXL20-splash.png

 

Cannot return to DOS:

TBXL20-dos.png

 

ERROR-13 running a simple FOR-NEXT loop:

TBXL20-for.png

 

Have fun with this buggy/unfinished version/update of Turbo Basic XL 2.0. :-D

 

Attached Files



#46 pirx OFFLINE  

pirx

    Moonsweeper

  • 448 posts
  • Location:Poland

Posted Thu May 25, 2017 2:57 PM

Possibly it would be better to decompile original 1.5 and use labels and comments from 2.0?  Anyway, looks like a solid piece of rewarding work!



#47 luckybuck OFFLINE  

luckybuck

    Dragonstomper

  • Topic Starter
  • 957 posts

Posted Thu May 25, 2017 3:26 PM

@vitoco:

 

ico_goteam.gif ico_goteam.gif ico_goteam.gif

ico_notworthy.gif ico_notworthy.gif ico_notworthy.gif

ico_occasion14.gif



#48 luckybuck OFFLINE  

luckybuck

    Dragonstomper

  • Topic Starter
  • 957 posts

Posted Thu May 25, 2017 3:30 PM

Well, where do we have that again? Publishing that kind of source code means, it was not published as original, therefore no problems with the law, but in a kind the community can fix it, so we have it within the law. Hard work als always, but I am sure, we are on good way.

 

So, who finds the errors in Einstein's equations to overcome the light barrier? ;-)



#49 luckybuck OFFLINE  

luckybuck

    Dragonstomper

  • Topic Starter
  • 957 posts

Posted Thu May 25, 2017 3:46 PM

https://atariwiki.or...=Bibo Assembler

https://atariwiki.or...e=BiboAssembler



#50 peteym5 OFFLINE  

peteym5

    River Patroller

  • 2,378 posts
  • Location:Buffalo NY USA

Posted Thu May 25, 2017 5:47 PM

Is it properly pushing and popping the for-next commands from the basic stack? I already started looking into it. The next_cmd section looks identical to 1.5 except the start of the location is back by 4 few bytes.

 

Looks like the problem is originating with for "FOR-CMD" routine. (FOR-BEF if you had not renamed it yet)







Also tagged with one or more of these keywords: TURBO-BASIC, TURBO-BASIC XL, Source Code

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users