Mail Archives: djgpp/1999/03/19/10:16:39
On 18 Mar 99 at 17:45, Martin Str|mberg wrote:
> Clark L. Coleman (clc5q AT cobra DOT cs DOT Virginia DOT EDU) wrote:
> : Your were given a bad mnemonic: "setc" is actually "stc".
> :
> : asm volatile("clc"); /* clears (sets to 0) the carry flag */
> : asm volatile("cmc"); /* complements (inverts) the carry flag */
> : asm volatile("stc"); /* sets (to 1) the carry flag */
>
> Ahh! Thanks!
>
> Perhaps somebody can inform me on the difference (if there is one)
> between "cmpl $1, %eax" and "testl $1, %eax". It sounds to me like
> they do the same thing, so I think I'm missing something...
`cmp' does a `sub' without storing the result. `test' does a
`and' without storing the result.
In effect, `cmp' compares the whole of the operands, while
`test' just checks whether any of the bits set in the first
operand are also set in the second.
--
George
- Raw text -