Hello everyone. I'm creating a new project called z80 program UN-SQUISHIER, hence the title. This tool is intended to do the exact opposite of the AsmComp( command. So for example, if you compiled AsmPrgmFDCB24DEC9, the result of that is ?xyLinecosh¯¹(fnInt(Disp sinh¯¹(. The program reverses that. Mainly so you can copy and paste it and show it to others so they can type it in. I'm sorry to say this program doesn't decompile the whole program at once, rather line-by-line. But either there are kinks in the program coding or in Celtic 3, not all assembly programs are un-squished correctly. The hex code is available, but I cannot guarantee it is 100% correct. Here is the source code below of what I have:


:"Asm Program Unsquisher
If det([[1:Then
   Disp "Celtic 3 Is","Not Installed!","
Disp "Asm Program","Unsquisher v1.2
Disp "Input An","Existing Program","
Lbl 0
Repeat 9>length(Str9) and not(inString("rowSwap(*row(",sub(Str9,1,1
   Input ">",Str9
If Ans=".P:NT:FN
Disp "Does Not Exist","
If Ans=".P:NT:FN
Goto 0
If Ans!=det(17,"BB6D
Disp "Not An Asm Prgm","
If Ans!=det(17,"BB6D
Goto 0
Disp "Type An Output","Program Name","
Lbl Z0
Repeat 9>length(Str8) and not(inString("rowSwap(*row(",sub(Str8,1,1
   Input ">",Str8
If Ans!=".P:NT:FN
Disp "Program Exists","
If Ans!=".P:NT:FN
Goto Z0
If 1000>det(4)-Ans
Disp "RAM Memory","Too Low","
If 1000>det(4)-Ans
Goto 0
Disp "Unsquishing","Prgm "+Str9+"...","Lines: "+det(1,R
Output(7,1,"Complete: 0%
DelVar EDisp "Checking","Contents...","
   If Ans!=det(5,Str9,I
If not(E:End
If E:Then
   Disp "Prgm "+Str9,"Could Not Be","Decompiled
Disp "Un-Squishing","Completed

Overall the un-squishing process is pretty quick, I tried to make this as simple and small as possible. Let me know what you guys think if there are any improvements that can be made with my program. I uploaded this to ticalc.org, upload pending.
Note: this process is usually referred to as "unsquishing."
I like to be more technical when I name my projects.
Well too bad because this has nothing to do with a "decompiler" :p
The actual name that even TI used is indeed squishing/unsquishing.
One step further would be disassembling (to get asm code from the bytes/hex), then further again would be decompiling, to (pseudo-)C if it applies.
Sounds silly tbh to not use decompile and compile. If TI prefers squish/unsquish, they should have used AsmComp( with AsmSqish(... or something like that.
AsmComp( probably stands for AssemblyCompress(, not AssemblyCompile(. Also, TI is just bad at naming things. "Compile" already has a meaning, which is to convert a higher-level language like C into assembly code or machine code. Likewise, "decompile" means to convert assembly code or machine code into the original higher-level language. This is much harder to do than desquishing, which is just converting bytes to hex, and disassembly, which is converting machine code into opcodes, because most compilers make optimizations to the code which are difficult to reverse. Naming your program a "decompiler" would imply that it performed the much more sophisticated task of converting programs into the original ICE or C source, which would be misleading.
Yup, I'm with the others: you're already doing the right thing by using the "unsquisher" name now.
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum