| ??? 05/07/03 23:07 Read: times |
#45052 - RE: multivariables comparison Responding to: ???'s previous message |
How about this - I think it implements the function you described in your previous post.
COMPARE: ; VAR1 through VAR6 are in iRAM MOV SAME,#0 ; clear SAME flag MOV A,VAR6 SUBB A,VAR5 JNC COMP45 ORL SAME,#00000001b ; set bit 0 if VAR5 > VAR6 COMP45: MOV A,VAR5 SUBB A,VAR4 JNC COMP34 ORL SAME,#00000010b ; set bit 1 if VAR4 > VAR5 COMP34: MOV A,VAR4 SUBB A,VAR3 JNC COMP23 ORL SAME,#00000100b ; set bit 2 if VAR3 > VAR4 COMP23: MOV A,VAR3 SUBB A,VAR2 JNC COMP12 ORL SAME,#00001000b ; set bit 3 if VAR2 > VAR3 COMP12: MOV A,VAR2 SUBB A,VAR1 JNC COMPEND ORL SAME,#00010000b ; set bit 4 if VAR1 > VAR2 COMPEND: RET |



