Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/26/00 22:13
Read: times


 
#4002 - Range Comparison on the 8051
The second example of three is obviously missing the following line:

. subb a,r7 ;subtracting >100 sets cy

I cleaned it up a little and removed an unnecessary label:

. ;{LT vs EQ+GT}:
. clr cy ;trick below eliminates this
. mov a,#100d-1 ;force EQ+GT to set CY
. subb a,r7
. jnc LT ;jump if less than 100
. cjne a,#FFh,GT ;(100d-1)-100d
EQ: ;else value equals 100d
...
GT: ;here if value greater than 100d
...
LT: ;here if value less than 100d
...
.end example

-Jay C. Box


List of 15 messages in thread
TopicAuthorDate
"Smaller then" "Greater then"            01/01/70 00:00      
RE: "Smaller then" "Greater then&qu            01/01/70 00:00      
RE: "Smaller then" "Greater then&qu            01/01/70 00:00      
RE: "Smaller then" "Greater then&qu            01/01/70 00:00      
RE: "Smaller then" "Greater then&am            01/01/70 00:00      
Range Comparison on the 8051            01/01/70 00:00      
Range Comparison on the 8051            01/01/70 00:00      
RE: Range Comparison on the 8051            01/01/70 00:00      
RE: Range Comparison on the 8051            01/01/70 00:00      
RE: "Smaller then" "Greater then&qu            01/01/70 00:00      
RE: "Smaller then" "Greater then&am            01/01/70 00:00      
RE: "Smaller then" "Greater then&am            01/01/70 00:00      
RE: "Smaller then" "Greater then&am            01/01/70 00:00      
RE: "Smaller then" "Greater then&am            01/01/70 00:00      
END OF THREAD            01/01/70 00:00      

Back to Subject List