Advertising (This ad goes away for registered users. You can Login or Register)

Registers: Signed?

Forum rules
Forum rule Nº 15 is strictly enforced in this subforum.
Locked
hgoel0974
Retired Mod
Posts: 2155
Joined: Mon Jul 23, 2012 11:42 pm
Location: New York

Registers: Signed?

Post by hgoel0974 »

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?
Advertising
"If the truth is a cruel mistress, then a lie must be a nice girl"
wth
HBL Developer
Posts: 834
Joined: Wed Aug 31, 2011 4:44 pm
Contact:

Re: Registers: Signed?

Post by wth »

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)
Advertising
hgoel0974
Retired Mod
Posts: 2155
Joined: Mon Jul 23, 2012 11:42 pm
Location: New York

Re: Registers: Signed?

Post by hgoel0974 »

wth 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)
thought so, thanks :)
"If the truth is a cruel mistress, then a lie must be a nice girl"
FrEdDy
HBL Collaborator
Posts: 243
Joined: Mon Sep 27, 2010 7:08 pm
Contact:

Re: Registers: Signed?

Post by FrEdDy »

wth 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)
addiu and addu are both unsigned :lol:
https://github.com/freddy-156
<@n00b81> FREDDY CUTTIES
Felix-Dev
Developer
Posts: 13
Joined: Tue Mar 19, 2013 7:53 pm

Re: Registers: Signed?

Post by Felix-Dev »

FrEdDy wrote:addiu and addu are both unsigned :lol:
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.
wth
HBL Developer
Posts: 834
Joined: Wed Aug 31, 2011 4:44 pm
Contact:

Re: Registers: Signed?

Post by wth »

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.
m0skit0
Guru
Posts: 3817
Joined: Mon Sep 27, 2010 6:01 pm

Re: Registers: Signed?

Post by m0skit0 »

A CPU cannot work with RAM or registers signed unless it's a very special custom CPU.
I wanna lots of mov al,0xb
Image
"just not into this RA stuffz"
Acid_Snake
Retired Mod
Posts: 3100
Joined: Tue May 01, 2012 11:32 am
Location: Behind you!

Re: Registers: Signed?

Post by Acid_Snake »

m0skit0 wrote:A CPU cannot work with RAM or registers signed unless it's a very special custom CPU.
true, two's complement makes the use of sign irrelevant and unnecessary at low level
m0skit0
Guru
Posts: 3817
Joined: Mon Sep 27, 2010 6:01 pm

Re: Registers: Signed?

Post by m0skit0 »

Errr... sorry forgot what I just said, I've mistaken what "signed" you were talking about here :lol:

wth comment stands true.
I wanna lots of mov al,0xb
Image
"just not into this RA stuffz"
hgoel0974
Retired Mod
Posts: 2155
Joined: Mon Jul 23, 2012 11:42 pm
Location: New York

Re: Registers: Signed?

Post by hgoel0974 »

m0skit0 wrote:Errr... sorry forgot what I just said, I've mistaken what "signed" you were talking about here :lol:

wth comment stands true.
lol, okay :)
"If the truth is a cruel mistress, then a lie must be a nice girl"
Locked

Return to “Programming and Security”