Exetools  

Go Back   Exetools > General > General Discussion

Notices

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 02-15-2014, 07:56
kcire_eae kcire_eae is offline
Friend
 
Join Date: Jan 2014
Posts: 14
Rept. Given: 5
Rept. Rcvd 1 Time in 1 Post
Thanks Given: 0
Thanks Rcvd at 1 Time in 1 Post
kcire_eae Reputation: 1
As represent negatives hexadecimals numbers

help, somebody can me tell as represent negatives hexadecimals numbers.
I am learning assembly language but i need know this for continue.
  #2  
Old 02-15-2014, 11:09
h8er h8er is offline
Friend
 
Join Date: Jan 2002
Posts: 43
Rept. Given: 45
Rept. Rcvd 7 Times in 6 Posts
Thanks Given: 140
Thanks Rcvd at 13 Times in 6 Posts
h8er Reputation: 7
The x86 architecture uses the two's complement for negative numbers, to calculate the two's complement of a number you calculate the one's complement and then you add 1.
So for a signed 32 bit dword value you calculate the bitwise NOT of it and then you add 1.

For example the number 34d is 0x00000022h so

-34d = (NOT 0x00000022h) + 0x00000001h = 0xFFFFFFDDh + 0x00000001h = 0xFFFFFFDEh

I advise you to read The Art of Assembly Language, it's a good start for learning assembly
The Following User Gave Reputation+1 to h8er For This Useful Post:
chessgod101 (02-16-2014)
  #3  
Old 02-16-2014, 02:24
kcire_eae kcire_eae is offline
Friend
 
Join Date: Jan 2014
Posts: 14
Rept. Given: 5
Rept. Rcvd 1 Time in 1 Post
Thanks Given: 0
Thanks Rcvd at 1 Time in 1 Post
kcire_eae Reputation: 1
ok thank you very much, this book is very interesting. i'll try read all to understand best somethings that still i do not understand
Closed Thread


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT +8. The time now is 18:15.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( 1998 - 2024 )