Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Assembly (http://www.programmingforums.org/forum20.html)
-   -   Wrong answer (http://www.programmingforums.org/showthread.php?t=10698)

Edgar Jul 12th, 2006 7:28 PM

Wrong answer
 
Hi, guy's I took a test today and I got wrong answer. can you gyus tell me why? I chose true.

[HTML]True or False. Given that CL and DL contain SIGNED numbers the code fragment below correctly implements the following pseudocode.

Pseudocode: If (CL < DL) then
Call less

Code Fragment: CMP CL, DL
JAE @@COMMON
CALL LESS
@@COMMON
{RAP}

a.) True
b.) False
[/HTML]

Thank you.

Wizard1988 Jul 12th, 2006 7:54 PM

JAE is used to deal with signed numbers. I think what you need is JGE

Narue Jul 12th, 2006 7:59 PM

>JAE is used to deal with signed numbers
Other way around. JAE is for unsigned values, JGE is for signed values.

Wizard1988 Jul 12th, 2006 8:00 PM

Good catch Narue

Edgar Jul 12th, 2006 8:04 PM

Quote:

Originally Posted by Wizard1988
JAE is used to deal with signed numbers. I think what you need is JGE

nop, JAE is just a conditional branching only jump of is above or equal. You can use JAE with signed or unsigned numbers.

Wizard1988 Jul 12th, 2006 8:06 PM

You might be able to "use" it but it might not work the way you intend it to

Edgar Jul 12th, 2006 8:17 PM

Yep you can use it with Byte Word or DWord, with 16-bit real mode or 32-bit protected mode, Thanks for traying.


All times are GMT -5. The time now is 12:22 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC