A Beginners Guide To Hexadecimal Numbers
View Single Post
December 4th, 2012 (01:20 AM). Edited December 4th, 2012 by Darthatron.
Join Date: Jan 2006
Location: Melbourne, Australia
A Beginners Guide To
An Introduction To Hexadecimal
Let's begin by saying
is a number system, not a computer language as it's referred to by some people on this forum. Hexadecimal, or hex, is a
base-16 number system
mainly used by humans to understand, in a logical way, how computers use and store data.
The number system you're most likely used to,
, is a
system, meaning that we have
10 unique symbols
) to represent each individual value. From this you can probably guess that this simply means that a base-16 number system, like hexadecimal, has
16 unique symbols
) to represent each individual value. You can even convert between hexadecimal and decimal with some mathematics, but you don't need to understand the conversion process for hacking Pokémon ROMs.
Counting In Hexadecimal
As previously stated, hexadecimal is effectively an extension of the decimal number system we're used to, increasing the number of symbols from 10 to 16, so counting in hexadecimal is really quite simple. Let's count to 16 in hexadecimal and decimal together, just to see the difference.
As you can see, counting in hexadecimal is very similar to counting in decimal, except when you get to 9, you go to A instead of 10, and then once you get to F you go to 10.
Don't worry if this is a tad confusing for you as it will be explained a little more further in to the tutorial.
Telling The Difference
"But, Darthatron, how can I tell if I'm meant to use hex or decimal?"
you may be asking. And the answer should be pretty clear...
If the number is prefixed with
then you are definitely dealing with hexadecimal. However, there is also some other, less clear, ways of showing hexadecimal notation, such as: Leading zeros (
, for example, is
in hexadecimal, which is
in decimal); or a suffixed
, for example, would be
in hex, which is
In the real world, however, you're more likely to see it expressed as Number
. For example: 10
would be 16 in decimal.
Converting Hex To Decimal And Back Again (The Easy Way)
It's really easy! And rarely actually ever required in the Pokémon ROM Hacking scene.
First of all, open up Windows Calculator. This can be done easily by pressing the Windows Key (
) + R, typing "calc" into the box and pressing "OK".
Looks like this.
Once you're in the Calculator go to the View menu and select "Programmer". In this mode, you can
toggle between hex and decimal
Looks like this.
Selecting the "Dec" option and entering a decimal number and then selecting the "Hex" option will show you the hexadecimal value of the value you entered. The same applies for the reverse.
Editing A ROM In A Hex-Editor
あなた は しきしゃ です
わたし は ばか です
View Public Profile
Send a private message to Darthatron
Visit Darthatron's homepage!
Find all posts by Darthatron
Find threads started by Darthatron
Ignore Posts by Darthatron