as3 push negative?
-migrated-
as3 push negative? Posted on: 02/28/2011 5:37am
Quote Post
I have forgotten how to push a negative number i know that

24 64 == push 100

but, how would you for instance push -100?
Re: as3 push negative? Posted on: 02/28/2011 8:38am
Quote Post
24 pushes a signed integer, so any value above 7F (127) becomes negative. 80 is -127 whilst FF is -1. 9B is -100
Re: as3 push negative? Posted on: 02/28/2011 12:51pm
Quote Post
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.
Re: as3 push negative? Posted on: 03/05/2011 4:00pm
Quote Post
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
Re: as3 push negative? Posted on: 03/12/2011 8:27pm
Quote Post
awesome thanks for the info  (broken image removed)