Apr 21, 2010 at 2:44 PM
Join Date: Jul 15, 2007
Location: Australia
Posts: 6213
Age: 38
*facepalm*Celtic Minstrel said:This would apply if Cave Story were written in assembly.
*facepalm*Celtic Minstrel said:This would apply if Cave Story were written in assembly.
andwhyisit said:*facepalm*
Assembly is a representation of the instructions specific to the macine in question assigned to different 8-bit values (bytes) within the binary data. By nature all programs are written in assembly, whether intended or not. Hence why Celtic Minstrel's declaration that cave story was written in C++ and not assembly inspired me to facepalm.S. P. Gardebiter said:Andwhyisit that you facepalm?
The compiler writes machine code no?Vercci said:Wouldn't you say it's written in c++ and compiled into assembly?
andwhyisit said:The compiler writes machine code no?
Not really. Assembly is a human-readable representation of the machine code, yes (plus comments, labels, and I think named variables), but not all programs are written in assembly. To say a program is written in assembly is to say that the programmer explicitly used assembly when writing the program. A program written in C++ is not written in assembly. I suspect most compilers even skip outputting assembly (unless specifically asked to) and just compile directly to machine code.andwhyisit said:Assembly is a representation of the instructions specific to the macine in question assigned to different 8-bit values (bytes) within the binary data. By nature all programs are written in assembly, whether intended or not. Hence why Celtic Minstrel's declaration that cave story was written in C++ and not assembly inspired me to facepalm.
The second statement is technically correct, yes. As previously mentioned, though, assembly supports some stuff that machine code does not in order to make it even more human-readable (labels, variables, comments...).GIRakaCHEEZER said:And machine code is assembly no? (or rather, assembly is the representation of machine code)
Those hexadecimal pairs that you edit in a hex editor are by that same definition a human-readable representation of the machine code as well.Celtic Minstrel said:Not really. Assembly is a human-readable representation of the machine code,
Exactly. Generally, a compiler would output machine code. However, most compilers do have an option to output assembly instead, I think. I know GCC does.carrotlord said:Why would a compiler ever output read-able assembly code? They would only output machine code. Assembly is simply an abstraction of machine code (so humans can read it), like C++ is an abstraction of assembly (so humans don't have to work in assembly).
Nigh impossible, perhaps, but not completely impossible. There exist reasonable decompilers. I suspect they probably work best on code that was originally compiled from the target language, though, since then they could hunt for idioms used by that compiler.Lace said:The main difference between the two is that any machine code can be turned into assembly, no hassle, whereas turning assembly into c is neigh impossible.
Uh, no. First of all, hexadecimal is merely a way to represent numbers, not code. (The fact that the numbers represent code is an entirely separate matter.) Second, which is more human-readable: 'mov eax, eap' or 32 45 76 ? (Made-up example; probably not even valid.)andwhyisit said:Those hexadecimal pairs that you edit in a hex editor are by that same definition a human-readable representation of the machine code as well.
Oh sure, it can be done. That doesn't make it human-readable.andwhyisit said:And just to give you something to think about, I have written assembly directly into a hex editor on several occasions.![]()
Celtic Minstrel said:Uh, no. First of all, hexadecimal is merely a way to represent numbers, not code. (The fact that the numbers represent code is an entirely separate matter.) Second, which is more human-readable: 'mov eax, eap' or 32 45 76 ? (Made-up example; probably not even valid.)
Oh sure, it can be done. That doesn't make it human-readable.
Celtic Minstrel said:Oh sure, it can be done. That doesn't make it human-readable.
Celtic Minstrel said:Oh sure, it can be done. That doesn't make it human-readable.
Fire1052 said:But has anyone really been far even as decided to use even go want to do look more like?
Lace said:Nops, adding, subracting, pushing, popping, int3-ing, and returning I can all do in hex. So human readable.