Assembly Tutorial
#6
(06-18-2019, 12:52 PM)Cameron_MKW Wrote: Quick question, with signed values why does negative 1 display as 0xFFFFFFFF on Dolphin?

If a value is 0xFFFFFFFF, it CAN be -1 or 4294967295.

If the value is signed (not logical, which most values are signed btw), this will represent -1 in decimal form.

If the value is not signed (logical), it is 4294967295 in decimal form.

Another example:
Let's say a register has the value of 0xFFFFFFFE. If it's signed the value (in decimal) is -2

If you're working with an instruction that is using a 16 bit signed value (such as Load Immediate), then 0xFFFF8000 is the largest negative number that can be written. When 16 bit signed values are used, they are 'sign extended' basically meaning the upper 16 bits (left hand side) of said register will automatically be set 0xFFFF

li r5, -2
li r5, -0x0002
li r5, 0xFFFFFFFE


All the above instructions are the same thing.

--

If this is still confusing, the knowledge of signed vs logical isn't really needed til you start working with complicated comparison-type instructions. (like blt/bgt on a logical value)
Reply


Messages In This Thread
Assembly Tutorial - by Vega - 11-14-2018, 02:19 PM
RE: Assembly Tutorial - by xXCrazySniperXx - 11-14-2018, 10:30 PM
RE: Assembly Tutorial - by xXCrazySniperXx - 11-27-2018, 02:28 AM
RE: Assembly Tutorial - by Vega - 11-27-2018, 03:11 PM
RE: Assembly Tutorial - by KartPlayer - 06-18-2019, 12:52 PM
RE: Assembly Tutorial - by Vega - 06-18-2019, 06:18 PM
RE: Assembly Tutorial - by KartPlayer - 06-19-2019, 08:34 AM
RE: Assembly Tutorial - by Vega - 06-19-2019, 10:14 PM
RE: Assembly Tutorial - by seanmcnally - 03-15-2024, 05:54 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)