Check Out Our Shop
Results 1 to 3 of 3

Thread: Nerd Alert!

  1. #1
    Join Date
    Jan 2006
    Location
    Denver
    Posts
    1,070

    Nerd Alert!

    I'm taking a computer systems course and am coming to a small stumbling block as to how negative numbers are expressed in hex in assembly language. We have a basic machine simulator they wrote in java that reads in our text assembly files and the they have created their own ISA for this machine. Our machine is big-endian is that makes any difference.

    $0xFFFFFFFF should be -1 right? So would $0xEFFFFFFF be -2 and so on or am I missing something?

  2. #2
    Join Date
    May 2002
    Location
    Beautiful BC
    Posts
    2,986
    It's called 2's complement and -2 is 0xFFFFFFFE using big-endian (the big end is first). To negate a number, in binary compement the number (1s become 0s and 0s become 1s) and then add 1.
    If you have a problem & think that someone else is going to solve it for you then you have two problems.

  3. #3
    Join Date
    Jan 2006
    Location
    Denver
    Posts
    1,070
    Thanks, I almost had it.

Similar Threads

  1. pubic jong warning, alert alert alert Doremite
    By nova2 in forum Gear Swap (List View)
    Replies: 25
    Last Post: 04-05-2007, 09:55 AM
  2. UTAH NERD ALERT!!!! UTAH NERD ALERT!!!!
    By irul&ublo in forum General Ski / Snowboard Discussion
    Replies: 7
    Last Post: 02-23-2007, 12:06 PM
  3. Virus Alert
    By KQ in forum TGR Forum Archives
    Replies: 2
    Last Post: 03-08-2004, 11:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •