Just yesterday I came up with a idea about making a sort of reverse-assembler for ICE. I don't know how to use ASM (z80/ez80 ASM) language so.... yeah. but I do want to bring this idea to the surface.
Tell me your ideas and thoughts down below
Code?
Code:
Disp "welcome to ICE","DeCompiler"
prgmDECOMP
Return
|
|
\/
Yes I need to make a DeCompiler program called prgmDECOMP
Would this program decompile ICE into eZ80 ASM? That might already be possible with PT_'s Disassembler program, but I can't test it right now (my CE is broken)
This would allow people to convert it back to ICE source code
Uhmmm if you don't know how to do it maybe ask ai to absolutely misunderstand you or something
It's not really possible to make a perfect ICE decompiler in the sense you're probably thinking of. PT_'s disassembler completely disassembles Assembly programs, which doesn't necessarily give you the source code but rather the exact instructions that are executed, meaning it completely tears apart system routines into direct assembly. When ICE is compiled it's really just compiling into an Assembly program. After an ICE instruction is compiled, it's no longer "decompilable" because it's just a bunch of assembly instructions that could have come from a million different sources. Like, if I showed you my calculator's screen with "Hello world" on it and asked you to tell me what program was making that happen, you couldn't know; it could be
Code: Disp "Hello world"
or Code: Output(1,1,"Hello world")
or Code: "dlrow olleH"→Str1
For(I,length(Str1),1,-1)
Output(1,12-I,sub(Str1,I,1))
End
In that same sense, since ICE is pretty high-level and user-friendly with a bunch of premade functions, there's no way for the calculator to tell what function a bunch of instructions originally were unless ICE stored a label or something next to every command for telling what it originally was, which would be super inefficient and defeat the point of Assembly. To misuse an astrophysics term, a compiled ICE program has no hair : )
TL;DR: PT_'s disassembler is probably the best you're going to get because ICE is secretly just a bunch of Assembly in a trench coat.
ThatOneGuy wrote:
It's not really possible to make a perfect ICE decompiler in the sense you're probably thinking of. PT_'s disassembler completely disassembles Assembly programs, which doesn't necessarily give you the source code but rather the exact instructions that are executed, meaning it completely tears apart system routines into direct assembly. When ICE is compiled it's really just compiling into an Assembly program. After an ICE instruction is compiled, it's no longer "decompilable" because it's just a bunch of assembly instructions that could have come from a million different sources. Like, if I showed you my calculator's screen with "Hello world" on it and asked you to tell me what program was making that happen, you couldn't know; it could be
Code: Disp "Hello world"
or Code: Output(1,1,"Hello world")
or Code: "dlrow olleH"→Str1
For(I,length(Str1),1,-1)
Output(1,12-I,sub(Str1,I,1))
End
In that same sense, since ICE is pretty high-level and user-friendly with a bunch of premade functions, there's no way for the calculator to tell what function a bunch of instructions originally were unless ICE stored a label or something next to every command for telling what it originally was, which would be super inefficient and defeat the point of Assembly. To misuse an astrophysics term, a compiled ICE program has no hair : )
TL;DR: PT_'s disassembler is probably the best you're going to get because ICE is secretly just a bunch of Assembly in a trench coat.
What if I made a interpreter instead?
What use would an ICE interpreter be? You can already program ICE on-calc with the program. Something that could be more useful would be a ICE to TI-Basic converter.
claculator wrote:
What use would an ICE interpreter be? You can already program ICE on-calc with the program. Something that could be more useful would be a ICE to TI-Basic converter.
No, no I want to make a program that interprets ez80 ASM back to ice
I'm pretty sure that would not work. eZ80 ASM has much more stuff than ICE, like specific instructions and very low level memory. Also, if you do not understand eZ80 ASM, this is not a great idea for a project.
Oh, yeah. I do want to learn C/C++
How is "interpreting eZ80 ASM back to ICE" any different than decompiling a compiled ICE program? As I said, a compiled ICE program is nothing but eZ80 Assembly.
claculator wrote:
I'm pretty sure that would not work. eZ80 ASM has much more stuff than ICE, like specific instructions and very low level memory. Also, if you do not understand eZ80 ASM, this is not a great idea for a project.
I agree wholeheartedly. Before coming up with projects to make in a programming language you don't know, I would at least try to start learning the language. I myself have learned only the teensiest bit of the tip of the iceberg of Assembly, and I can already tell this is not a very feasible project.
I'm not trying to deter you from programming or learning eZ80 Assembly. I'm just pointing out my suggestions for how to go about learning any programming language. If you want tips for learning eZ80 Assembly, look at basically every other thread on Cemetech
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
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