Topic: Needs help with hex-arithmetic.. (1 of 3), Read 43 times
Conf: Other (Not related to VEDIT)
From: Peter Rejto
Date: Monday, August 23, 2004 01:06 PM

Hello,

I try to convert the decimal number 16,450,560 into hex. So, I det into Command Mode and type:

#50=16,450,560 $#50

Then Vedit answers with;

0XFB:0400 .

I take this is the segment:offset notation for this number. I tried to convert this notation to a "flat" hex notation.
, by hand. I got

FB
400
-----------
13B0


Oops, I do not know how webboard will display this type of formatting. So, back to definitions: In other words I have to multiply the "offset" by 16 and add the segment to it.

My problem is that if I re-convert 0x13B0 to decimal Vedit gives me 5040.

So, I am missing something simple. I also checked my hex arithmetic. The key fact was that,

0xF + 0x4 = 0x13 .

Here is how I justified it:
The left side is 15 + 4 = 16 + 3
and clearly,
16 + 3 = 0x13 .


Any hint would be most appreciated.

Thanks,

-peter.

 


Topic: Re: Needs help with hex-arithmetic.. (2 of 3), Read 43 times
Conf: Other (Not related to VEDIT)
From: Christian Ziemski
Date: Monday, August 23, 2004 03:19 PM

On Mon, 23 Aug 2004 13:06:00 -0400, Peter Rejto wrote:

>I try to convert the decimal number 16,450,560 into hex. So, I det
>into Command Mode and type:
>
>#50=16,450,560 $#50
>
>Then Vedit answers with;
>
>0XFB:0400 .
>
>I take this is the segment:offset notation for this number.

No, its simply hex!
Try another calculator (perhaps the one delivered with Windows) to
check!

>I tried to convert this notation to a "flat" hex notation.

So that is not necessary (or more exact: wrong).


Christian

 


Topic: Re: Needs help with hex-arithmetic.. (3 of 3), Read 46 times
Conf: Other (Not related to VEDIT)
From: Peter Rejto
Date: Monday, August 23, 2004 04:00 PM

On 8/23/2004 3:19:28 PM, Christian Ziemski wrote:
>On Mon, 23 Aug 2004 13:06:00 -0400,
>Peter Rejto wrote:
>
>>I try to convert the decimal number 16,450,560 into hex.
>>Then Vedit answers with;
>>
>>0XFB:0400 .
>>
>>I take this is the segment:offset notation for this number.
>
>No, its simply hex!

Thank you very much, Christian!

This is exactly the point which I missed.

Incidentally, I also tried to convert 0xFB0400 to decimal, using Vedit and I got back the original number.

It was nice that there was no need to go outside Vedit.

You really helped me out.

-peter.