assembly - 32-bit signed words in mips -
I am trying to write a simple amps program and I am stuck in announcing a 32-bit signed integer.
I have written the following simple code:
.data max: .word 11111111111111111111111111111111 The maximum I value is - 1 But my IDE tells me that the number is being defined as -954437177, I am using Mars 4.4 as my IDE.
What am I doing wrong? How can I really recognize -1 as the value?
. The keyword enters a number in decimal, and when you change it, after its 32-bit From, you will only get the last 32 bits. 11111111111111111111111111111111111111111111111111111101111111111111111111011101111101011111010101010101110101011101010101010101010101011100010101000111000111 (2)
The last 32-bit: Ll000lll000lll000lll000lll000lll (2) = -954 437 177 if you want to store as a 32-bit to 1, then try .word 0xFFFFFFFF the value - 1
Comments
Post a Comment