A83: Re: < or > commands?


[Prev][Next][Index][Thread]

A83: Re: < or > commands?




Ah, welcome to the world of the carry flag. :)
Let's say you want to compare a to b, and if b is greater, then jump to somewhere:
cp b \ jr c,BisGreaterThanA

The cp instruction acts like a subtraction, so if a was 5 and b was 10, 5-10 == -5, which would result in the carry flag
being set.

Similarly, if a was 6 and b was 3, 6-3 == 3, and the carry flag would be reset.
cp b \ jr nc,AisGreaterThanOrEqualToB

So by testing for the carry flag, you should be able to figure out all that greater than/less than stuff.

----- Original Message -----
From: "Chris DC" <dreamcast_84@yahoo.com>
To: <assembly-83@lists.ticalc.org>
Sent: Friday, January 21, 2000 18:30
Subject: A83: < or > commands?



is there any greater than or less than commands?
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com




Follow-Ups: References: