Hi there! Thanks for visiting PokéCommunity. We’re a group of Pokémon fans dedicated to providing the best place on the Internet for discussing ideas and sharing fan-made content. Welcome! We’re glad you’re here.

In order to join our community we need you to create an account with us. Doing so will allow you to make posts, submit and view fan art and fan fiction, download fan-made games, and much more. It’s quick and easy; just click here and follow the instructions.

Research & DevelopmentGot a well-founded knack with ROM hacking? Love reverse-engineering the Pokémon games? Or perhaps you love your assembly language. This is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!

Research & Development programs in this forum are subject to moderator approval before they are displayed.

Now, for conversions
Normally when you use a hex tools, you'd find all the hex values to be shown in pairs.
Before any conversions, let a hex value be "xy"

Dec--->Hex
All you have to do is to multiply the x value by 16, then add y.
For example, for AA, the x value is A (which is 10) and the y value is A (which is also 10)
The dec. value=10(16)+10=170

(p.s, can anyone use a hex-dec calculator or something to check whether it's correct?)

Hex--->Dec
It's pretty much straight forward. All you have to do is the divide the dec. value by 16. The quotient(sp?) is the x value and the remainder is the y value.

you could just you the calculator on your computer...change to scientific view then type your number, then click on the Hex box and it converts your number and vice-versa

khaosknight1, that's a stupid post. It says manually. Not via computer ways. At least that's what I think this thread is for.
I already know how to do this, but it's good that it'll appear here.
Do you know how to go from Binary->Decimal? I can go from Decimal to binary, but I'm wondering how to do the reverse.

khaosknight1, that's a stupid post. It says manually. Not via computer ways. At least that's what I think this thread is for.
I already know how to do this, but it's good that it'll appear here.
Do you know how to go from Binary->Decimal? I can go from Decimal to binary, but I'm wondering how to do the reverse.

I'm not sure how useful this thread is going to be for most people. Unless you can do it immediately in your head I can't really think of a reason why you wouldn't simply use a converter. However this thread might be quite good for the newer hackers who don't even know what hex is.

khaosknight1, that's a stupid post. It says manually. Not via computer ways. At least that's what I think this thread is for.
I already know how to do this, but it's good that it'll appear here.
Do you know how to go from Binary->Decimal? I can go from Decimal to binary, but I'm wondering how to do the reverse.

Eg. 1001001
1. Take first DIGIT from the sequence (now we have 001001 and 1)
2. If there are any DIGITs left in the first NUMBER, double the second NUMBER (now we have 001001 and 2), otherwise stop.
3. Take the new first DIGIT in the first NUMBER, and add it to the second NUMBER (now we have 01001 and still 2).
4. Repeat 2 and 3 until you run out of DIGITs in the first NUMBER.

To convert back from Dec to Bin...
e.g. 45
1. If the first NUMBER is odd, take 1 from it and add the digit "1" to the 2nd NUMBER, else add the DIGIT "0" to the 2nd NUMBER. (now we have 44 and 1)
2. If the first NUMBER is not 0, half the first NUMBER. (now we have 22 and 1)
3. If the first NUMBER is odd, take 1 from it and add the DIGIT "1" to the start of the 2nd NUMBER, else add the DIGIT "0" to the start of the 2nd NUMBER. (now we have 22 and 01)
4. Repeat 2 and 3 until you run out of DIGITs in the first NUMBER.

45
1. 44 & 1
2. 22 & 1
3. 22 & 01
2. 11 & 01 As you can see, I take 1 off this 11 in the next one...
3. 10 & 101 ... and add it to the start of the binary.
2. 5 & 101 Same with this one
3. 4 & 1101
2. 2 & 1101 ...But not this one, as it's even.
3. 2 & 01101
2. 1 & 01101
3. 0 & 101101

If this is hard to follow, I'm sorry!

Spoiler:

Also, quick byte-to-hex conversion in x86 asm (because it's slightly related):
assume AL = byte to convert, and [ebp-4] contains the pointer to the string

Code:

.intel_syntax noprefix
mov bl,al
and al,0Fh
cmp al,0Ah
sbb al,69h
das
xchg al,bl
shr al,4
cmp al,0Ah
sbb al,69h
das
mov bh,al
xchg bl,bh
mov eax,[ebp-4]
mov [eax],bx
mov byte[eax+2],0

khaosknight1, that's a stupid post. It says manually. Not via computer ways. At least that's what I think this thread is for.
I already know how to do this, but it's good that it'll appear here.
Do you know how to go from Binary->Decimal? I can go from Decimal to binary, but I'm wondering how to do the reverse.