An Introduction to Bits, Bytes, Halfwords, and Words for Wii coding
by Welohabi
Understanding these basics are important to understanding the codes themselves. I have left out some details due to them not being important to Wii coding.
Let's start with some definitions first.
When dealing with Wii codes you are normally reading them in hexadecimal form.
For example:
Notice that {A,B,C,D,E,F} are not letters, they are numbers! Hexadecimal "C" means decimal "12" just like binary "1100". Computers are designed to use hexadecimal because binary-hexadecimal handling is far more efficient than binary-decimal.
The hexadecimal number 1 is made up of 4-bits (0001) also known as 1 nybble.
The hexadecimal number 11 is made up of 8-bits (00010001) also known as 1 byte.
The hexadecimal number 1111 is made up of 16-bits (0001000100010001) also known as a halfword.
The hexadecimal number 11111111 is made up of 32-bits (00010001000100010001000100010001) also known as a word.
I'm sure you can see why it is easier to read the numbers in hexadecimal form versus reading them in binary. This should also help you to understand basic codetypes a little better.
Example 8-bit Code [Welohabi]
0012346B 00000011
Example 16-bit Code [Welohabi]
0212346A 00001111
Example 32-bit Code [Welohabi]
04123468 11111111
by Welohabi
Understanding these basics are important to understanding the codes themselves. I have left out some details due to them not being important to Wii coding.
Let's start with some definitions first.
- bit - A single binary digit, that can only have a value of 0 or 1.
- nybble - 4 bits
- byte - 8 bits
- halfword - 16 bits
- word - 32 bits
When dealing with Wii codes you are normally reading them in hexadecimal form.
For example:
Binary | Decimal | Hexadecimal |
0000 | 0 | 0 |
0001 | 1 | 1 |
0010 | 2 | 2 |
0011 | 3 | 3 |
0100 | 4 | 4 |
0101 | 5 | 5 |
0110 | 6 | 6 |
0111 | 7 | 7 |
1000 | 8 | 8 |
1001 | 9 | 9 |
1010 | 10 | A |
1011 | 11 | B |
1100 | 12 | C |
1101 | 13 | D |
1110 | 14 | E |
1111 | 15 | F |
The hexadecimal number 1 is made up of 4-bits (0001) also known as 1 nybble.
The hexadecimal number 11 is made up of 8-bits (00010001) also known as 1 byte.
The hexadecimal number 1111 is made up of 16-bits (0001000100010001) also known as a halfword.
The hexadecimal number 11111111 is made up of 32-bits (00010001000100010001000100010001) also known as a word.
I'm sure you can see why it is easier to read the numbers in hexadecimal form versus reading them in binary. This should also help you to understand basic codetypes a little better.
Example 8-bit Code [Welohabi]
0012346B 00000011
Example 16-bit Code [Welohabi]
0212346A 00001111
Example 32-bit Code [Welohabi]
04123468 11111111