Problem Learning
Thanks alot for relaying the message Why!
What'd HD get banned for?
Anyways i've been analyzing the code for it, and i'm still kinda confused such as
but i'm confident enough to move on without worrying about getting lost. Right now i'm working through all the different variable types and headers, such as long, unsigned long, signed long etc, etc. And it makes me feel as though maybe i'll want to learn a few simple side things such as getting a good understanding of hexidecimal.
Because ANY type of number can apparently be stored in a number of different variable types. It compared it like this.
While they have different values, it's still technically allowed.
I also got my first taste of #define. It went through the <climits> file and defined ZERO as 0.
So I'm digging this whole thing, like it's technical, but there's always a reason behind why it failed or why it worked.
What'd HD get banned for?Anyways i've been analyzing the code for it, and i'm still kinda confused such as
Code:
return retbuf
Because ANY type of number can apparently be stored in a number of different variable types. It compared it like this.
Code:
int soda=42 int pepsi=0x042
I also got my first taste of #define. It went through the <climits> file and defined ZERO as 0.
So I'm digging this whole thing, like it's technical, but there's always a reason behind why it failed or why it worked.
I got banned for insulting the feeling of some rather ch00bish VBFags 
Originally Posted by ilovecookies
Decimal numbers have a base of 10:
0,1,2,3,4,5,6,7,8,9
which means there are 10 numbers(0 to 9) that fit into 1 'slot'
Hex(adecimal) has a base of 16(Decimal means 10, hex means 6, 6+10=16
)
0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xA,0xB,0x C,0xD,0xE,0xF
which means that there are 16 'numbers'(0x0 to 0xF) that fit into 1 'slot'.
if you go over the maximum number for a 'slot' a new 'slot' is used and placed infront of it, example:
0xF, if i want to go 1 higher it will be 0x10
0x1F +1 will be 0x20, and so on untill you reach
0xFF, +1 on that will be 0x100.
0xFFF:
15*16^2=3840
15*16^1= 240
15*16^0= 15+
============
4095
0xB92 - start at the right side
for the 2 we have moved 0 characters to the left.
so the value of that 2 in decimal is:
2*16^0=2, since 16^0 is 1.
for the 9 we have moved 1 character to the left.
so the value of that 9 in decimal is:
9*16^1=144, since 16^1 is 16
for the B we have moved 2 characters to the left.
so the value of that b in decimal is:
11*16^2=2816, since 16^2 is 256.
Then there is also octal(octo means 8, so it has a base of 8
)
0,1,2,3,4,5,6,7
for octal to decimal
2471(octal) = 1337 in decimal.
1*8^0=1
7*8^1=56
4*8^2=256
2*8^3=1024
1024+256+56+1=1337
and binary has a base of 2
0 and 1
for binary to decimal:
11001(bin) = 25 in decimal.
1*2^0 = 1
0*2^1 = 0
0*2^2 = 0
1*2^3 = 8
1*2^4 = 16
16+8+0+0+1 = 25
I hope that explained it for you.

0,1,2,3,4,5,6,7,8,9
which means there are 10 numbers(0 to 9) that fit into 1 'slot'
Hex(adecimal) has a base of 16(Decimal means 10, hex means 6, 6+10=16
)0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xA,0xB,0x C,0xD,0xE,0xF
which means that there are 16 'numbers'(0x0 to 0xF) that fit into 1 'slot'.
if you go over the maximum number for a 'slot' a new 'slot' is used and placed infront of it, example:
0xF, if i want to go 1 higher it will be 0x10
0x1F +1 will be 0x20, and so on untill you reach
0xFF, +1 on that will be 0x100.
0xFFF:
15*16^2=3840
15*16^1= 240
15*16^0= 15+
============
4095
0xB92 - start at the right side
for the 2 we have moved 0 characters to the left.
so the value of that 2 in decimal is:
2*16^0=2, since 16^0 is 1.
for the 9 we have moved 1 character to the left.
so the value of that 9 in decimal is:
9*16^1=144, since 16^1 is 16
for the B we have moved 2 characters to the left.
so the value of that b in decimal is:
11*16^2=2816, since 16^2 is 256.
Then there is also octal(octo means 8, so it has a base of 8
)0,1,2,3,4,5,6,7
for octal to decimal
2471(octal) = 1337 in decimal.
1*8^0=1
7*8^1=56
4*8^2=256
2*8^3=1024
1024+256+56+1=1337
and binary has a base of 2
0 and 1
for binary to decimal:
11001(bin) = 25 in decimal.
1*2^0 = 1
0*2^1 = 0
0*2^2 = 0
1*2^3 = 8
1*2^4 = 16
16+8+0+0+1 = 25
I hope that explained it for you.
Soooo lets say I had 0xf64, I comprehend converting it, via your excellent explanation, It would break down as such 4 * 16^0 + 6 * 16^1 + 16*16^2 = 4+96 +4096 = 100 + 4096 = 4196
But does it continue in that same pattern? Such as if I had 9x00FC5
Does the x hold a place value? Let me make it a little clearer
5 = 5*16^0
C = 12*16^1
F=16*16^2
0=0*16^3
0=0*16^4
x=?
And thus my main question. Should x hold a place value, would the 9 that begins it be like this
9 = 9*16^6 or
9 = 9*16^5
EDIT! Another question. Why are ram addy's stored via hex? If I converted the addy to decimal would it have the same effect?
But does it continue in that same pattern? Such as if I had 9x00FC5
Does the x hold a place value? Let me make it a little clearer
5 = 5*16^0
C = 12*16^1
F=16*16^2
0=0*16^3
0=0*16^4
x=?
And thus my main question. Should x hold a place value, would the 9 that begins it be like this
9 = 9*16^6 or
9 = 9*16^5
EDIT! Another question. Why are ram addy's stored via hex? If I converted the addy to decimal would it have the same effect?
so the part in bold should be 15*16^2 which is 3840
4+96+3840=3940
Alright, I get what you're saying but this brings up a whole new question.
Hexidecimal = Hex + Decimal = 6 + 10 = 16.
1-2-3-4-5-6-7-8-9-A-B-C-D-E-F = 15
Which brings this question....why? Why not call it Pentadecimal? Is it Hexadecimal because for some reason the 16th is null? Or is this one of those Absolute Facts?
Hexidecimal = Hex + Decimal = 6 + 10 = 16.
1-2-3-4-5-6-7-8-9-A-B-C-D-E-F = 15
Which brings this question....why? Why not call it Pentadecimal? Is it Hexadecimal because for some reason the 16th is null? Or is this one of those Absolute Facts?
lol.. wtf ? i dont get that at all .. but somehow i can still code :P
This thread is closed for replies.


![=]](/forum/images/emotions/=].gif)