Additional Info
|
I have forgotten how to push a negative number i know that
24 64 == push 100 but, how would you for instance push -100? |
Additional Info
|
24 pushes a signed integer, so any value above 7F (127) becomes negative. 80 is -127 whilst FF is -1. 9B is -100
|
Additional Info
|
If you want a dirty way to find negative hex values, go to windows Calculator, scientific mode, type in the number you want (let's say -42), press enter, and then choose the Hex option (on the left side.)
You'll get like FFFFFFFFFFFFFFD6. The value you want is the last byte: d6. As a side note, you can achieve this effect if you select the Byte option that appears below the input/output screen when on Hex. |
Additional Info
|
http://en.wikipedia.org/wiki/Two's_complement
f(V, N) = (2^N + V) mod 2^N where V is the normal value, and N is the bit-width of the data type. f(3, (broken image removed) = (2^8 + 3) mod 2^8 = (256 + 3) mod 256 = 3 f(-42, (broken image removed) = (256 - 42) mod 256 = 214 mod 256 = 214 |
Additional Info
|
awesome thanks for the info (broken image removed)
|