Advertising
Registers: Signed?
Forum rules
Forum rule Nº 15 is strictly enforced in this subforum.
Forum rule Nº 15 is strictly enforced in this subforum.
Registers: Signed?
Are the PSP's CPU registers signed or unsigned? I noticed that 0xDEADBEEF = 3735928559 which is too long for a signed integer, so I would assume that they are unsigned? Am I right to assume this?
"If the truth is a cruel mistress, then a lie must be a nice girl"
Re: Registers: Signed?
Neither, doesn't make any sense.
Registers are mere memory containers, some cpu instructions just use them as signed (addiu, etc) and others as unsigned (addu, etc)
Registers are mere memory containers, some cpu instructions just use them as signed (addiu, etc) and others as unsigned (addu, etc)
Advertising
Re: Registers: Signed?
thought so, thankswth wrote:Neither, doesn't make any sense.
Registers are mere memory containers, some cpu instructions just use them as signed (addiu, etc) and others as unsigned (addu, etc)
"If the truth is a cruel mistress, then a lie must be a nice girl"
Re: Registers: Signed?
addiu and addu are both unsignedwth wrote:Neither, doesn't make any sense.
Registers are mere memory containers, some cpu instructions just use them as signed (addiu, etc) and others as unsigned (addu, etc)
https://github.com/freddy-156
<@n00b81> FREDDY CUTTIES
<@n00b81> FREDDY CUTTIES
Re: Registers: Signed?
Actually, both ADDIU and ADDU treat their operands as signed integers. The term "unsigned" is a misnomer, here it means that these two instructions won't trap on overflow (that is, they ignore oveflow). The ADDI instruction, however, won't modify the destination's register content and will throw an Integer Overflow exception if overflow occurs.FrEdDy wrote:addiu and addu are both unsigned
Re: Registers: Signed?
right addiu / addu are no good as example lol but anyway it just depends on instructions if the registers are assumed signed or unsigned
Last edited by wth on Tue Jun 11, 2013 8:05 pm, edited 1 time in total.
Re: Registers: Signed?
A CPU cannot work with RAM or registers signed unless it's a very special custom CPU.
I wanna lots of mov al,0xb
"just not into this RA stuffz"
"just not into this RA stuffz"
-
- Retired Mod
- Posts: 3100
- Joined: Tue May 01, 2012 11:32 am
- Location: Behind you!
Re: Registers: Signed?
true, two's complement makes the use of sign irrelevant and unnecessary at low levelm0skit0 wrote:A CPU cannot work with RAM or registers signed unless it's a very special custom CPU.
Re: Registers: Signed?
Errr... sorry forgot what I just said, I've mistaken what "signed" you were talking about here
wth comment stands true.
wth comment stands true.
I wanna lots of mov al,0xb
"just not into this RA stuffz"
"just not into this RA stuffz"
Re: Registers: Signed?
lol, okaym0skit0 wrote:Errr... sorry forgot what I just said, I've mistaken what "signed" you were talking about here
wth comment stands true.
"If the truth is a cruel mistress, then a lie must be a nice girl"