Quote:
The problem with machine code is that you lose what little semantic structure there was left. On many platforms it is very hard to differentiate between data and code unless the binary executable format explicitly separates them, and all of the label names are lost. Disassemblers do their best, but it is unlikely to be as organized as it was to begin with.
Yes is this true. The overall readability of code goes way down because a) all documentation is lost. b) No comments c) No labels. and d) A person (or a dis-assembler) cannot clearly determine data vs code. This is very important to do especially when your code is going to have implementation other than it the one it originally had.
Asm makes your code more portable,more "self-documenting", and ultimately clearer.
Quote:
Asm makes your code more portable,more "self-documenting", and ultimately clearer.
Just to be clear to any new programmers reading this topic - this sentence could only possibly make sense as a comparison between assembly and straight machine code. Assembly is about as unportable as it gets, unless you're writing assembly language for a virtual machine.
So it is possible, but not exactly worth it, to dissassemble hex to asm?
Are there any of those kinds of dissassemblers for the Ti-84+?
It can be worth it from time to time. Depends on what you need to do. There are disassemblers on ticalc.org.
Quote:
After using AsmComp( a program is no longer editable.
Not technically true, but I wouldn't try it in your own
Roguebantha wrote:
Quote:
After using AsmComp( a program is no longer editable.
Not technically true, but I wouldn't try it in your own
(BTW, Roguebantha: on top of every post, there is a button with quotation marks on it that automatically creates a reply with that post quoted properly. You can also use [quote] tags to quote stuff and have it formatted properly.
That statement is incredibly misleading. When using AsmComp(), the executable program (assuming you gave it a different name) is locked solely for the purpose of protecting you from messing up the program / bricking your calc. The original source (the one with the AsmPrgm line and the Hex code) is unaffected, and you can edit it just fine.
I understand what you mean but you can still unlock them and mess with them although I definitely wouldnt. For example, here's a program that locks and unlocks programs:
AsmPrgm
EFD74A
D604C0
EB
4E23
4623
B0C0
79D609
D0
117884
3E05
1213
EDB0
AF12
EFF142
D8
EE03
77
C9
Compile it to prgmLOCK, and the program no longer appears on the edit screen. But this is easily fixed. Just unlock the program using the above code. It knows which program to unlock based on a string in Ans so remember to set that first. The compiled machine code now appears as this:
Um actually, on second thought, I can't type that out
But try AsmPrgmC9:
?sinh-1(
Will appear
what does locking and unlocking a program do?
Oh, well you know those programs that you can execute but can't edit? Those are locked programs. You can easily unlock using that ASM routine I posted (courtesy of Xeda by the way) by storing the name of the program, minus the prgm token, to Ans and running Asm(prgmLOCK. Asm programs are locked by default but can be unlocked with the above program once again
elfprince13 wrote:
Quote:
Asm makes your code more portable,more "self-documenting", and ultimately clearer.
Just to be clear to any new programmers reading this topic - this sentence could only possibly make sense as a comparison between assembly and straight machine code. Assembly is about as unportable as it gets, unless you're writing assembly language for a virtual machine.
Writing using mnemonics does make your code slightly more portable in the sense of transferring it to another CPU that is instruction compatible but not pin compatible, like from the TI-84+ ASIC to the GameBoy ASIC. All of the ROM calls will be totally different though and those make up the meat of any program. Transferring algorithms that don't use ROM calls works fine though.
There are plenty of disassemblers out there, and in fact, most software cracking and other illegal activities are done using disassemblers. There are even some projects that attempt to decompile C and C++ executables, but unless the programmer chose to leave symbols in, any names and structures that you can pull out will be fairly nonsensical. many simple things can also be way overcomplicated by the decompiler. C++ templates are a prime example of this. Any C preprocessor defines are lost, library files are all mixed up, data and code can get confused, inlines aren't extracted... It's all a huge mess really. For most intents and purposes, compiling is a one way street.
but in theory, the simpler the instruction set, the simpler it is to disassemble the excutable?
Like, isn't there a lower limit to how small and simple any asm program can be?
There are disassemblers that are pretty good (I think) like WabbitEmu's disassembly view. If you are a bit crazy like some of us, or you've worked with assembly long enough, though, you start to learn all of the addresses for the device and the hex, so your brain works as an excellent disassembler. (Of course, that is because it is a neural network which is at least on the same level as a Super Turing computer making it ideal for analysing and understanding code from a Turing complete language, like all classical computers and their respective languages). I should try not to stray too far off topic >.>
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