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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/30/00 18:49
Read: times


 
#4048 - RE: "Smaller then" "Greater then&am
Some remarks to all experts.

1) To Sascha Pypke: you had to write SUBB A,#009H instead of SUBB A,09H

2) To Erik Malund: you had to write NOT_EQUAL: JNC A_IS_GREATER instead of NOT_EQUAL: JC A_IS_GREATER

3) To Jay C.Box: your ways are unjustifiedly complicated. It plaited up my bends:-). Your second example doesnt work. Check it with R7=99.

Please be more carefully in examples. The young developers look at you:-).

Now to the question. I suppose the CJNE is the second importance instruction especially constructed to compare two unsigned values.

The easier way to do GT/EQ/LT determination is following (by Erik).

CJNE A,#100,NE
JMP EQ
NE: JC LT
GT: JMP A_GT_100 ;Acc>100
EQ: JMP A_EQ_100 ;Acc=100
LT: JMP A_LT_100 ;Acc<100

To do GT vs LE=LT+EQ:
CJNE A,#100,NE
JMP LE
NE: JC LE
GT: JMP A_GT_100 ;Acc>100
LE: JMP A_LE_100 ;Acc<=100

To do LT vs GE=GT+EQ:
CJNE A,#100,NE
JMP GE
NE: JC LT
GE: JMP A_GE_100 ;Acc>=100
LT: JMP A_LT_100 ;Acc<100

Regards,

George, program monster:-)


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