??? 03/26/04 15:23 Read: times |
#67454 - Back to basics Responding to: ???'s previous message |
Ben Weech said:
I need an easy to understand way of converting this hex value into decimal Before talking about conversions, Do you understand the fundamental principles of number bases (radix) and place-value? When we write the number "ABCD" in hexadecimal (base 16), that is a shorthand notation for: Ax163 + Bx162 + Cx161 + Dx160 Similarly, when we write the number "WXYZ" in decimal (base 10), that is a shorthand notation for: Wx103 + Xx102 + Yx101 + Zx100 Or: Wx1000 + Xx100 + Yx10 + Zx1 Now consider the number XYZ written in decimal. Dividing by ten gives you XY plus remainder Z; Dividing again by ten gives you X plus remainder Y. Thus you can see that successive division by ten has enabled us to isolate the individual decimal digits X, Y, and Z. By the same principle, you should be able to see how the successive subtracion method works, too. Ben Weech said:
I need an easy to understand way of converting this hex value into decimal No. The value in the register is just a number; it is neither hex nor decimal - just a number. BUT, by applying the methods you've seen, you can determine the values of the digits needed to represent that number in the decimal notation. Converting to ASCII is simply a matter of noting the pattern in the ASCII codes: Character '0' has ASCII Code 0x30; Character '1' has ASCII Code 0x31; Character '2' has ASCII Code 0x32; Character '3' has ASCII Code 0x33; etc - you get the idea? ("0x.." is just 'C' notation for a hex number). |
Topic | Author | Date |
hex to decimal assembly | 01/01/70 00:00 | |
RE: hex to decimal assembly | 01/01/70 00:00 | |
RE: hex to decimal assembly | 01/01/70 00:00 | |
RE: hex to decimal assembly | 01/01/70 00:00 | |
RE: hex to decimal assembly | 01/01/70 00:00 | |
RE: hex to decimal assembly | 01/01/70 00:00 | |
RE: hex to decimal assembly | 01/01/70 00:00 | |
RE: hex to decimal assembly | 01/01/70 00:00 | |
RE: hex to decimal assembly | 01/01/70 00:00 | |
RE: hex to decimal assembly | 01/01/70 00:00 | |
RE: hex to decimal assembly | 01/01/70 00:00 | |
Back to basics | 01/01/70 00:00 | |
RE: hex to decimal assembly | 01/01/70 00:00 | |
RE: hex to decimal assembly | 01/01/70 00:00 | |
RE: hex to decimal assembly | 01/01/70 00:00 | |
Forgot a few stuff, continuing on... | 01/01/70 00:00 | |
Number representations | 01/01/70 00:00 | |
Erm... Another correction to myself![]() | 01/01/70 00:00 |