Hakkera 0 Report post Posted September 27, 2006 This my sound like a bit of a noob question, but it has always occured to me. On screen, we get hexadecimal code, but the processor doesnt understand that right? So, if I make a program in Hex, would I have to compile it, I understnad that Hex is shorthand binary, but would I? Share this post Link to post Share on other sites
osknockout 0 Report post Posted September 27, 2006 Lol, we're all noobs sometime. You wouldn't have to compile it.You'd just have to find a way to save it in that format, like through a hexadecimal editor,because normally data is saved in bytes (1 byte= 2 hexes = 256 binary bits) Share this post Link to post Share on other sites
ghostrider 0 Report post Posted September 27, 2006 This my sound like a bit of a noob question, but it has always occured to me. On screen, we get hexadecimal code, but the processor doesnt understand that right? So, if I make a program in Hex, would I have to compile it, I understnad that Hex is shorthand binary, but would I?I don't quite understand what you mean by 'Hexadecimal Code'. Can you elaborate? I should be able to answer your question, I've been writing in assembly for 3 years. If your talking about data, such as:Somedata db 0FFh Then that will be turned into binary when it compiles. Or if you mean you are writing a program totally in Hex, that will work too. The compiler will convert that into code that the computer can understand.Also, (1 byte= 2 hexes = 256 binary bits)The above is wrong. 1 byte consists of 8 bits, thus making 256 possible characters. Share this post Link to post Share on other sites
osknockout 0 Report post Posted September 28, 2006 The above is wrong. 1 byte consists of 8 bits, thus making 256 possible characters.Ah! Sorry about that. Heh, you'd think after programming in Z80 assembly for 4 yearsyou'd get that down. Anyway, ghostrider's right. Share this post Link to post Share on other sites
Diffusr 0 Report post Posted March 17, 2010 This my sound like a bit of a noob question, but it has always occured to me. On screen, we get hexadecimal code, but the processor doesnt understand that right? So, if I make a program in Hex, would I have to compile it, I understnad that Hex is shorthand binary, but would I?If you are writing whole programs in nothing but hex then you are hardly a noob. One of my programming ambitions is to be able to directly code in binary. The way that I envisage being able to do this is to learn a processor instruction set very thoroughly (e.g. x86asm or better yet risc os asm), then memorize the hex equivalent of each instruction, then become a virtuoso at converting hex to binary on sight and by memory. Eventually one could bash out any program in pure binary from mental calculations alone.Come to think of it, I can already convert hex to bin on sight e.g F is 1111 so now all I have to do is memorize the hex form of assembly instructions. The fun is just about to start. Yippee. Share this post Link to post Share on other sites