- z80 program UN-SQUISHIER
- 22 Jul 2019 10:31:04 am
- Last edited by AchakTheFurry on 22 Jul 2019 11:00:31 am; edited 2 times in total
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:
Code:
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.
Code:
:"Asm Program Unsquisher
If det([[1:Then
Disp "Celtic 3 Is","Not Installed!","
Return
End
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
det(20,"FD361251
Input ">",Str9
End
det(0,7,Str9
If Ans=".P:NT:FN
Disp "Does Not Exist","
If Ans=".P:NT:FN
Goto 0
sub(det(5,Str9,1),1,1
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
det(20,"FD361251
Input ">",Str8
End
det(0,7,Str8
If Ans!=".P:NT:FN
Disp "Program Exists","
If Ans!=".P:NT:FN
Goto Z0
real(7,0
2expr(sub(det(0,7,Str9),4,5
If 1000>det(4)-Ans
Disp "RAM Memory","Too Low","
If 1000>det(4)-Ans
Goto 0
det(0,5,Str8
det(5,Str9->R
Disp "Unsquishing","Prgm "+Str9+"...","Lines: "+det(1,R
Output(7,1,"Complete: 0%
For(I,1,R
det(18,det(5,Str9,I
det(6,Str8,Ans,I
int(100I/R
Output(7,11,det(1,Ans)+"%
End
DelVar EDisp "Checking","Contents...","
For(I,1,R
det(17,det(5,Str8,I
If Ans!=det(5,Str9,I
1->E
If not(E:End
If E:Then
det(0,4,Str8
Disp "Prgm "+Str9,"Could Not Be","Decompiled
Return:End
det(5,Str8,1
det(8,Str8,"AsmPrgm"+sub(Ans,5,length(Ans)-4),1
det(6,Str8,"C9",I
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.