Kroah Posted July 30, 2012 Share Posted July 30, 2012 Hello all, I'm actually decompiling a basic program compiled with ABC "A Basic Compiler" from Monarch Data Systems. It becomes a little boring because the program uses a runtime interpreter executing p-code, so i'm decompiling the interpreter first. I could then decompile the p-code. Having read the manual of the MMG Compiler (it contains interesting info about the compiler), i think the manual of ABC could speed up the process. - Does anyone have the manual of this compiler? Someone in 1999 said he got a turbo basic decompiler UNKOMP.TRB for the p-code generated by this compiler (p-code -> basic): http://groups.google.../month/1999-07? - Does anyone have this decompiler? I really can't find any info about ABC beside the disk images and the fact it uses its own p-code. Any help appreciated! Quote Link to comment Share on other sites More sharing options...
www.atarimania.com Posted July 30, 2012 Share Posted July 30, 2012 Not sure I understand your post correctly. You read the instructions but need them? Anyway, the program is a re-release of Datasoft's BASIC Compiler for which we have the manual so maybe that could help you. -- Atari Frog http://www.atarimania.com Quote Link to comment Share on other sites More sharing options...
russg Posted July 30, 2012 Share Posted July 30, 2012 (edited) Hello all, I'm actually decompiling a basic program compiled with ABC "A Basic Compiler" from Monarch Data Systems. It becomes a little boring because the program uses a runtime interpreter executing p-code, so i'm decompiling the interpreter first. I could then decompile the p-code. Having read the manual of the MMG Compiler (it contains interesting info about the compiler), i think the manual of ABC could speed up the process. - Does anyone have the manual of this compiler? Someone in 1999 said he got a turbo basic decompiler UNKOMP.TRB for the p-code generated by this compiler (p-code -> basic): http://groups.google.../month/1999-07? - Does anyone have this decompiler? I really can't find any info about ABC beside the disk images and the fact it uses its own p-code. Any help appreciated! Well, Here goes. ABC Compiler manual in pdf.zip (8 megs) and Dis6502.zip (500K), a decompiler for the PC for Atari .COM files, if I remember. ..... Nope, the manual is too big for AA. Uhm... I'll see if you have an e-mail address in your profile. I see your e-mail on your website, trying to send 8 meg file to there. Also, I don't think this manual has much technical info to help you much. dis6502.zip Edited July 30, 2012 by russg Quote Link to comment Share on other sites More sharing options...
russg Posted July 30, 2012 Share Posted July 30, 2012 (edited) Not sure I understand your post correctly. You read the instructions but need them? Anyway, the program is a re-release of Datasoft's BASIC Compiler for which we have the manual so maybe that could help you. -- Atari Frog http://www.atarimania.com I just scanned the ABC Compiler manual, version 1.0. Tell me how to send it to Atarimania? Maybe I'll just send it to you and you can post it on AM. Nope, only atarimania in your profile. I don't know how upload to AM. Edited July 30, 2012 by russg Quote Link to comment Share on other sites More sharing options...
Kroah Posted July 30, 2012 Author Share Posted July 30, 2012 (edited) Not sure I understand your post correctly. You read the instructions but need them? Anyway, the program is a re-release of Datasoft's BASIC Compiler for which we have the manual so maybe that could help you. -- Atari Frog http://www.atarimania.com Hello Atari Frog, I have the manual of the MMG compiler (which is a re-release of datasoft compiler). This manual contains some interesting info about the format of the compiled executable. So i think that if i can get the ABC compiler manual, it may contain some good info too. Well, Here goes. ABC Compiler manual in pdf.zip (8 megs) and Dis6502.zip (500K), a decompiler for the PC for Atari .COM files, if I remember...... Nope, the manual is too big for AA. Uhm... I'll see if you have an e-mail address in your profile. I see your e-mail on your website, trying to send 8 meg file to there. Also, I don't think this manual has much technical info to help you much. Thank you very much Russ for the ABC compiler manual, this is what i was looking for! Concerning the decompiler, i'm talking about a turbo basic program which decodes the p-code of a ABC compiled program. The decompiled code is a basic program (without variable names and REM). FYI, ABC compiles a basic program to intermediate "p-code" instructions. Those are interpreted by a runtime interpreter which is linked with the p-code instructions, so we get a self executable program. Funny, ABC itself is written in basic and compiled with ABC compiler. So if anyone owns the UNKOMP.TRB ABC decompiler... I have emailed Thomas Richter (Atari++) who owned a copy of this program 13 years ago. I will let you know. Edited July 30, 2012 by Kroah Quote Link to comment Share on other sites More sharing options...
Kroah Posted July 31, 2012 Author Share Posted July 31, 2012 Thanks to Thomas Richter, he has sent me a copy of his Turbo Basic program. It works great and i have been able to get the Basic code back from the p-code. If you are interested, you can PM me. 1 Quote Link to comment Share on other sites More sharing options...
Roydea6 Posted July 31, 2012 Share Posted July 31, 2012 datasoftbasic_compiler.pdf You probably aready have this or something similair. Quote Link to comment Share on other sites More sharing options...
Roydea6 Posted July 31, 2012 Share Posted July 31, 2012 MMG_Basic_Compiler.pdf I found this on my DATA flash usb drive. Quote Link to comment Share on other sites More sharing options...
russg Posted July 31, 2012 Share Posted July 31, 2012 MMG_Basic_Compiler.pdf I found this on my DATA flash usb drive. I prefer the ABC. I've tried MMG, but didn't have such a good experience, perhaps because it was a crack. MMG did floating point, I believe, whereas ABC only does integer, and a few other limitations, no dynamic DIM for one. Quote Link to comment Share on other sites More sharing options...
+MrFish Posted July 31, 2012 Share Posted July 31, 2012 I just scanned the ABC Compiler manual, version 1.0. Tell me how to send it to Atarimania? Maybe I'll just send it to you and you can post it on AM. Nope, only atarimania in your profile. I don't know how upload to AM. Why don't you just post it to one of the file download houses, like Rapidshare? Some members here also have sites that they're willing to host documents on. I'd like to have a copy of the manual. Quote Link to comment Share on other sites More sharing options...
russg Posted July 31, 2012 Share Posted July 31, 2012 I just scanned the ABC Compiler manual, version 1.0. Tell me how to send it to Atarimania? Maybe I'll just send it to you and you can post it on AM. Nope, only atarimania in your profile. I don't know how upload to AM. Why don't you just post it to one of the file download houses, like Rapidshare? Some members here also have sites that they're willing to host documents on. I'd like to have a copy of the manual. You can try http://www.russgilb.net and maybe it will work. 2 Quote Link to comment Share on other sites More sharing options...
+MrFish Posted July 31, 2012 Share Posted July 31, 2012 I just scanned the ABC Compiler manual, version 1.0. Tell me how to send it to Atarimania? Maybe I'll just send it to you and you can post it on AM. Nope, only atarimania in your profile. I don't know how upload to AM. Why don't you just post it to one of the file download houses, like Rapidshare? Some members here also have sites that they're willing to host documents on. I'd like to have a copy of the manual. You can try http://www.russgilb.net and maybe it will work. Great. Thanks for taking the time to scan and post it. Quote Link to comment Share on other sites More sharing options...
russg Posted August 1, 2012 Share Posted August 1, 2012 (edited) I just scanned the ABC Compiler manual, version 1.0. Tell me how to send it to Atarimania? Maybe I'll just send it to you and you can post it on AM. Nope, only atarimania in your profile. I don't know how upload to AM. Why don't you just post it to one of the file download houses, like Rapidshare? Some members here also have sites that they're willing to host documents on. I'd like to have a copy of the manual. You can try http://www.russgilb.net and maybe it will work. Great. Thanks for taking the time to scan and post it. You're welcome. Great to see people still interested in this. I can't find my original ABC disk. I guess it failed. It was one of the few I cracked myself. I don't know if what's available today is my crack, I doubt it. I do have a 'working' copy still, (one of my cracks). I guess it failed and that makes it OK for me to crack and still be able to use it. My website is new, very basic, I started it because I wrote a 'Financial Calculator' for Windows, must have .NET framework 4 to use it. It is a loan and installment payment program. Nobody much needs to figure out their loan. I originally wrote it for the A8, and used it right up until I wrote this one. Uhm... I got off topic. You can download my FC2.ZIP calculator from the site. Edited August 1, 2012 by russg Quote Link to comment Share on other sites More sharing options...
+MrFish Posted August 1, 2012 Share Posted August 1, 2012 You can try http://www.russgilb.net and maybe it will work. Great. Thanks for taking the time to scan and post it. You're welcome. Great to see people still interested in this. Yea, I mean people are still writing programs in BASIC and it's always nice to have the option to compile. As for the manual I think any manual of any significance is worth scanning for preservation purposes. Quote Link to comment Share on other sites More sharing options...
Kroah Posted August 2, 2012 Author Share Posted August 2, 2012 I have ported the decompiler to C#. It has the same features has the Turbo Basic XL version and add the following : - more lisible output (but can't be loaded back on Atari, useful to understand an unknown basic program). - a dictionary can be defined to replace generic variable names by user defined ones. - labels can be defined to name some lines. I will post it here after some tests if anyone is interested. Credit goes to Thomas Richter for his initial work on Atari. Quote Link to comment Share on other sites More sharing options...
russg Posted August 2, 2012 Share Posted August 2, 2012 I have ported the decompiler to C#. It has the same features has the Turbo Basic XL version and add the following : - more lisible output (but can't be loaded back on Atari, useful to understand an unknown basic program). - a dictionary can be defined to replace generic variable names by user defined ones. - labels can be defined to name some lines. I will post it here after some tests if anyone is interested. Credit goes to Thomas Richter for his initial work on Atari. Anybody else finds it a little funny to have a decompiler for a compiler for Atari BASIC? Can we compile the decompiled code? Quote Link to comment Share on other sites More sharing options...
Kroah Posted August 2, 2012 Author Share Posted August 2, 2012 (edited) Anybody else finds it a little funny to have a decompiler for a compiler for Atari BASIC? Yes, it's funny. I find that it's even more funny to compile the compiler with the compiler. When i saw that the game i disassemble was an interpreted p-code, i said "oh my bad, going to be difficult". Then i thought "hey, but if i disassemble the compiler, i could understand the p-code format, cool. but... then i couldn't believe it... i stumbled again upon interpreted p-code. VERY funny. Can we compile the decompiled code? The decompiled code is Atari Basic code. It can be listed, executed and whatever you want to do with. So it can be compiled again. Some decompiled programs have too many variables, so it can't be loaded in Atari Basic. For those, you should execute them with Turbo Basic for example. Edited August 2, 2012 by Kroah Quote Link to comment Share on other sites More sharing options...
AtariGeezer Posted August 2, 2012 Share Posted August 2, 2012 I have ported the decompiler to C#. It has the same features has the Turbo Basic XL version and add the following : - more lisible output (but can't be loaded back on Atari, useful to understand an unknown basic program). - a dictionary can be defined to replace generic variable names by user defined ones. - labels can be defined to name some lines. I will post it here after some tests if anyone is interested. Credit goes to Thomas Richter for his initial work on Atari. I would be interested in peeking at your C code Wasn't there a couple of *commercial* games/programs released using the Basic Compiler? It would be cool to examine the decompiled code of those Jay Quote Link to comment Share on other sites More sharing options...
Kroah Posted August 2, 2012 Author Share Posted August 2, 2012 (edited) I would be interested in peeking at your C code I will post it here after some bugfixes. Wasn't there a couple of *commercial* games/programs released using the Basic Compiler?It would be cool to examine the decompiled code of those You are right. The one i'm actually decompiling and commenting is Imperium Galactum. The main part is coded in compiled Basic with ABC, and some asm gfx & I/O routines are called with the USR instruction. Here's a sample of the decompiled pseudo code after some automatic cleanup (well... the code tag breaks the indentation...): 340 PrintNonPlayerLive: POS. 2, 15 PRINT "7) NON-PLAYER LIFE" POS. 29, 15 ON (V40_nonPlayerLiveValue_1Yes_2No + 1) GOTO 365, 366, 367 360 PrintRandomSetup: POS. 2, 16 PRINT " RANDOM SETUP" POS. 29, 16 ON (V42_randomSetupValue_1Yes_2No + 1) GOTO 365, 366, 367 365 PRINT "YES NO" RETURN -------------------------------------------------------------------------------- 366 PRINT "_Y_E_S NO" RETURN -------------------------------------------------------------------------------- 367 PRINT "YES _N_O" RETURN -------------------------------------------------------------------------------- 380 InitPlayerNameEtc: GOSUB 2_ClearScreenAndSetCursorToBottomWindow PRINT "WHAT IS THE NAME OF " PRINT "PLAYER ";V28_j + 1; INPUT V1_string1$ IF ((V1_string1$ == "") OR (LEN (V1_string1$) > 17)) THEN GOTO 380_InitPlayerNameEtc 390 V1_string1$(LEN (V1_string1$) + 1) = " " 395 V1_string1$ = V1_string1$(1, 17) FOR V53_ = 1 TO 17 POKE (14104_Game_playersNameMin1_S17 + (V28_j * 17)) + V53_, ASC (V1_string1$(V53_, V53_)) NEXT V53_ The same without cleanup but pure Atari basic: 340POS.2,15:?"7) NON-PLAYER LIFE":POS.29,15:ONV40+1 GOTO 365,366,367 360POS.2,16:?" RANDOM SETUP":POS.29,16:ONV42+1 GOTO 365,366,367 365?"YES NO":RET. 366?"ÙÅÓ NO":RET. 367?"YES ÎÏ":RET. 380GOS.2:?"WHAT IS THE NAME OF ""PLAYER ";V28+1;:I.V1$:IF(V1$="") OR (LEN(V1$)>17) THEN 380 390V1$(LEN(V1$)+1)=" " 395V1$=V1$(1,17):F.V53=1 TO 17:POKE(14104+(V28*17))+V53,ASC(V1$(V53,V53)):N.V53 Edited August 2, 2012 by Kroah 1 Quote Link to comment Share on other sites More sharing options...
+bf2k+ Posted August 3, 2012 Share Posted August 3, 2012 I would be interested in peeking at your C code Me too... I do what little programming I do in A8 using Atari Basic and compile the results (usually with MMG - I used to use ABC a lot also). I'd like to see your finished product. Can it work with MMG compiled programs or just ABC? Quote Link to comment Share on other sites More sharing options...
Kroah Posted August 3, 2012 Author Share Posted August 3, 2012 (edited) Can it work with MMG compiled programs or just ABC? Only with ABC. MMG compiles to ASM language, not p-code. So it can't be decompiled, only disassembled. Some games (or parts of them) compiled with ABC: - Cavelord - F15-Strike-Eagle - Soloflight 1 & 2 - Imperium Galactum - NATO Commander And many games use copy protection p-code compiled with ABC to obfuscate the protection. It's way harder to trace/disassemble an interpreted language than asm code. Edited August 3, 2012 by Kroah Quote Link to comment Share on other sites More sharing options...
devwebcl Posted November 4, 2012 Share Posted November 4, 2012 Thanks to Thomas Richter, he has sent me a copy of his Turbo Basic program. It works great and i have been able to get the Basic code back from the p-code. If you are interested, you can PM me. Hi Kroah, I PM you, but still I don't receive any response. Maybe you can post the TBXL decompiler here Thanks Devwebcl Quote Link to comment Share on other sites More sharing options...
russg Posted November 11, 2012 Share Posted November 11, 2012 Hello all, I'm actually decompiling a basic program compiled with ABC "A Basic Compiler" from Monarch Data Systems. It becomes a little boring because the program uses a runtime interpreter executing p-code, so i'm decompiling the interpreter first. I could then decompile the p-code. Having read the manual of the MMG Compiler (it contains interesting info about the compiler), i think the manual of ABC could speed up the process. - Does anyone have the manual of this compiler? Someone in 1999 said he got a turbo basic decompiler UNKOMP.TRB for the p-code generated by this compiler (p-code -> basic): http://groups.google.../month/1999-07? - Does anyone have this decompiler? I really can't find any info about ABC beside the disk images and the fact it uses its own p-code. Any help appreciated! I find three versions of ABC by Monarch. There's ABC 1.02, 1.03 and 1.05. I'm not sure if one of them is my patch of 1.03. There's a .PRO image of 1.03, but it is enhanced/dual density/1040 sngl dens sector, not what the original 1.03 disk has. The original disk only has 378 sectors, the rest of the sectors aren't there. Anybody familiar with 1.05 and 1.03, what differences? I could try make a .PRO image. Quote Link to comment Share on other sites More sharing options...
russg Posted November 11, 2012 Share Posted November 11, 2012 (edited) I find three versions of ABC by Monarch. There's ABC 1.02, 1.03 and 1.05. I'm not sure if one of them is my patch of 1.03. There's a .PRO image of 1.03, but it is enhanced/dual density/1040 sngl dens sector, not what the original 1.03 disk has. The original disk only has 378 sectors, the rest of the sectors aren't there. Anybody familiar with 1.05 and 1.03, what differences? I could try make a .PRO image. I did a fresh .PRO image of ABC103. It is 100,816 bytes, bigger than a sngl .ATR, but smaller than the 1.03 I've seen online. I think you have to have APE, maybe registered, to run a .PRO image. ABC103.zip Edited November 11, 2012 by russg Quote Link to comment Share on other sites More sharing options...
russg Posted November 12, 2012 Share Posted November 12, 2012 (edited) I did a fresh .PRO image of ABC103. It is 100,816 bytes, bigger than a sngl .ATR, but smaller than the 1.03 I've seen online. I think you have to have APE, maybe registered, to run a .PRO image. For new to ABC, the manual is at: http://www.russgilb.net No dynamic DIM, no real numbers (integer only), no variable GOTO or GOSUB. Probably other stuff you can't do. Oh, yes. You have to put the source .BAS file in D1: when prompted for source. It has to be on a DOS 2/2.5 maybe MyDOS sngl dens disk. You don't give the drive number or D:, just the 8.3 file name. I think the destination file also has to go on D1: same as source file, again, no drive spec. just the filename. The source .BAS file has to be a SAVED tokenized file. Edited November 12, 2012 by russg Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.