A83: Re: Re: Boolean operators
[Prev][Next][Index][Thread]
A83: Re: Re: Boolean operators
Please do not send messages in HTML format!
The more traditional (and optimized) way of doing a comparision:
ld a,first
cp second
jr c,first_is_less_than_second
jr z,_first_is_equal_to_second
first_is_greater_than_second:
Note that you must use the sign flag if you are using signed numbers. Check
out this thread:
http://www.ticalc.org/archives/mail/assembly-86/1998_May/msg00187.html
----- Original Message -----
From: "ti-83" <ti-83@libertysurf.fr>
To: <assembly-83@lists.ticalc.org>
Sent: Tuesday, September 05, 2000 1:40 PM
Subject: A83: Re: Boolean operators
ld a,(firstnumber)
ld b,a
ld a,(secondnumber)
cp b
jp nc,label1
jp c,label2
label1:
instructions if firstnumber>secondnumber
label2:
instructions if firstnumber=<secondnumber
TI-83
Le monde de la TI-83
http://www.ti-83.fr.st
ti-83@fr.st
----- Original Message -----
From: Frank Schoep
To: assembly-83@lists.ticalc.org
Sent: Tuesday, September 05, 2000 6:02 PM
Subject: A83: Boolean operators
OK, I might be going for The Worst Question Ever Asked on ASM83 (tm), but
I need to know the following:
how can you check if a number is larger than another (I only need to know
how to do this with 8 bit numbers.)? Is there a way to load the 1st number
in the accumulator and cp/and/or/xor/rr/slr/sla/rl it with another number to
do this?
Please let me know...
Frank
References: