Lab #6
(11/07/11) Judy Franklin 2011 Odds and Ends in Arithmetic
CSC231 Lab #6
getcopy sumiproc2.asm
gdb ./sumiproc2 break *past run print $eax negative value in decimal print/t $eax negative value in binaryDo you see a lot of ones? This is how a negative value is represented, in two's complement.
[jfrankli@beowulf 231]$ !./ ./sqrJudy eax in mul 4294967285 (Two's complement rep. in base 10. See below). eax then edx after mul 121 4294967274 i.e. edx contains -22, two's complement eax in imul 4294967285 eax then edx after imul 121 0
2^32 = 4294967296 2^32-1 = 4294967295 (all ones in 32 bits) = FFFFFFFFFFFFFFFFx0 2^32-1 -11 =4294967284, Then +1 for two's complement = 4294967285