Signed division in assembly language

Status
Not open for further replies.

Gupsh

Junior Member level 2
Joined
Nov 19, 2011
Messages
24
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,429
Which instruction performs signed division in an assembly language.
SRL, ROR, SRA, rotate right arithmetic
please exlain !
 

hi...
SRA performs the signed division .
it can be explained as follows.
As we know shifting a bit to left by 1-position is equivalent to multiplication by 2.
similarly, shifting right by 1-bit performs division operation.....

Now about retaining the sign....
In shift right arithmetic operation the lsb will get a new bit from 1st bit and continues... but the msb will be retained...
so SAR performs the signed arithmetic operation...
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…