Numeric comparisons
Gary M. Samuelson
garys at bunker.UUCP
Wed Sep 11 00:58:19 AEST 1985
> Most chips that I know of handle compare by doing a subtraction, setting the
> bits, and throwing away the results. Since most chips also allow a single
> instruction to test any number of flags no extra code need be generated to
> differentiate between the two.
What chips *are* you talking about?
> Anyway, in Z80, 6502, 8080, 6809, PDP-11, and so on the scenario I just
> described takes place. the BLT <xxx> instruction tests for N bit xor V bit
The Z80 and 8080 have no such instruction -- there are four testable flags
(carry, zero, parity/overflow, and sign); each conditional branch tests
the state of exactly one of these flags.
Gary Samuelson
ittatc!bunker!garys
More information about the Comp.lang.c
mailing list