Date : Mon, 15 Aug 1994 19:36:35 +0100 (BST)
From : clr1@...
Subject: Re: Flags and BIT
On Mon, 15 Aug 1994, Stephen Quan wrote:
> Just wanted to clarify. If you are implementing SBC using SBB and
> the IBM's processor flags, you can do
>
> XOR AH,01
> LAHF
> SBB ...
> SAHF
> XOR AH,01
>
> I am not sure the order of LAHF and SAHF, but you get the general
> idea!
Just in case someone's thinking of implementing this, lahf and sahf *are*
in the wrong order. Also, do you have to restore C to what it was before?
According to the AUG (as far as I can see) it is set to 0 if there was a
SBC and 1 if there wasn't, meaning that the altered carry is okay to
keep. Correct me if I'm wrong, though.
+-------------------+-------------------------------------------------+
| /-- |_| /-- | (~ | "And the driving is like the driving of Jehu, |
| \-- | | | | _) | the son of Nimshi, for he drives furiously." |
+-------------------+-------------------- Second Book of Kings 9 v20 -+