Hi All!!
i have to write an assembly prog ,to check a number positive or negatie.can any one help me???
4 replies to this topic
#1
Posted 08 May 2010 - 12:00 AM
|
|
|
#2
Posted 08 May 2010 - 06:49 AM
Negative numbers have their most significant bit set.So you only need to check that if the highest bit is 1,if it is then its negative else it's positive.
Warrior
mov al,-1 ;11111111 test al,0x80 jz positive ;if its zero positve jmp negative
Warrior
#3
Posted 08 May 2010 - 10:55 AM
thankss dear
#4
Posted 09 May 2010 - 10:56 PM
#5
Posted 10 May 2010 - 09:19 AM
hi zarazhi!!
have you completed that program?
have you completed that program?
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top









