View previous topic :: View next topic |
Author |
Message |
raelharris Newbie cheater
Reputation: 0
Joined: 04 Feb 2014 Posts: 11
|
Posted: Fri Feb 07, 2014 2:20 am Post subject: Humble beginnings and Hex Code |
|
|
Hi All,
I hate to be a bother here, but I really want to learn more about all of this and try to do research before asking silly questions etc. in the forum. I think I need to have a better understanding of hexadecimal code. I tried looking for assembler tutorials as advised but only managed to find that Auto Assembler thingy.
I remember in the past, I always saw Hexadecimal Code written as a value between 00000000 and FFFFFFFF with 0 - F representing the numbers 0 - 15. I understand that 00000010 = 16, 00000100 = 256 etc. I have never seen it written as 0x0000 before.
I tried Googling it and searching the forum too. I didn't have much luck though. Do you know of any tutorials out there teaching how to read this number format?
Thanks for your help and patience.
|
|
Back to top |
|
 |
Gniarf Grandmaster Cheater Supreme
Reputation: 43
Joined: 12 Mar 2012 Posts: 1285
|
Posted: Fri Feb 07, 2014 2:33 am Post subject: |
|
|
If I say that a pointer has an offset of 10 does it mean 10 (decimal) or 16?
To avoid that kind of ambiguity we (often) prefix hex numbers with 0x but whatever follows is read exactly like you're used to.
Historically it comes from C/C++ where you use the 0x prefix to indicate that the number just after is in hexadecimal.
_________________
DO NOT PM me if you want help on making/fixing/using a hack. |
|
Back to top |
|
 |
raelharris Newbie cheater
Reputation: 0
Joined: 04 Feb 2014 Posts: 11
|
Posted: Fri Feb 07, 2014 2:40 am Post subject: |
|
|
Oh wow that's great! Now I fully understand what you meant by 0x800. Thanks again!
|
|
Back to top |
|
 |
justa_dude Grandmaster Cheater
Reputation: 23
Joined: 29 Jun 2010 Posts: 892
|
Posted: Tue Feb 11, 2014 10:57 pm Post subject: |
|
|
As an addendum, C/C++ also support the h suffix to denote base 16, eg "13h".
|
|
Back to top |
|
 |
Gniarf Grandmaster Cheater Supreme
Reputation: 43
Joined: 12 Mar 2012 Posts: 1285
|
Posted: Wed Feb 12, 2014 5:56 am Post subject: |
|
|
@justa_dude: My visual studio 2008 doesn't understand 13h in C/C++ code. What compiler / VS version are you using?
_________________
DO NOT PM me if you want help on making/fixing/using a hack. |
|
Back to top |
|
 |
justa_dude Grandmaster Cheater
Reputation: 23
Joined: 29 Jun 2010 Posts: 892
|
Posted: Sun Feb 16, 2014 3:56 am Post subject: |
|
|
Gniarf wrote: | @justa_dude: My visual studio 2008 doesn't understand 13h in C/C++ code. What compiler / VS version are you using? |
It seems that I was in error - the h suffix is not part of the language.
I remember using it all the time in Borland Turbo C 3, but I guess that was an anomaly. It is standard for Intel ASM, so I guess it either just snuck in as a convenience thing or I only used it with inline ASM for CGI/VGA mode switching or something.
My mistake, sorry guys.
|
|
Back to top |
|
 |
|