Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Hex Or Binary
Hakkera
post Sep 27 2006, 08:57 PM
Post #1


Member [Level 2]
*****

Group: Members
Posts: 85
Joined: 22-July 05
Member No.: 9,735



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?

Go to the top of the page
 
+Quote Post
osknockout
post Sep 27 2006, 09:49 PM
Post #2


Super Member
*********

Group: Members
Posts: 396
Joined: 14-November 04
From: Elysium
Member No.: 2,280



Lol, we're all noobs sometime. laugh.gif
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)
Go to the top of the page
 
+Quote Post
ghostrider
post Sep 27 2006, 10:50 PM
Post #3


Super Member
*********

Group: Members
Posts: 397
Joined: 9-June 06
From: Wisconsin
Member No.: 24,924



QUOTE
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:

CODE

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,
QUOTE
(1 byte= 2 hexes = 256 binary bits)


The above is wrong. 1 byte consists of 8 bits, thus making 256 possible characters.
Go to the top of the page
 
+Quote Post
osknockout
post Sep 28 2006, 09:47 PM
Post #4


Super Member
*********

Group: Members
Posts: 396
Joined: 14-November 04
From: Elysium
Member No.: 2,280



QUOTE
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 years
you'd get that down. laugh.gif Anyway, ghostrider's right.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Crack The Binary Code...(4)
  2. Binary Tree(1)
  3. Opening Files In Binary Format?(3)
  4. C++ Binary Search Tree Destructor/remove Methods(0)
  5. Can You Convert This Binary Message(6)
  6. Data Structures -- Binary Tree -- Mirror Image(0)
  7. Data Structures -- Binary Tree -- Structurally Same(4)
  8. Data Structure -- Trees -- Threaded Binary Tree(0)


 



- Lo-Fi Version Time is now: 24th July 2008 - 06:25 AM