Date : Mon, 15 Aug 1994 11:14:52 EST
From : Stephen Quan <quan@...>
Subject: Re: Flags and BIT
Excuse my obvious mistakes in English. Don't know what's wrong, I
proofread the whole thing once over but there always seems to be
some mistake!
> 4. SBC
> On a 6502 the C is cleared to indicate borrow
> On a 80x86 the CF is set if we want borrow (nasty!)
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!
One other thing to note, and this is a real negative. SAHF and LAHF
does not seem to save or include the OF flag. Please correct me on
this one if I am wrong.
I guess you can probably be save in assuming not many commands affect
the OF flag so you really needn't save it and restore it later.
--
Stephen Quan (quan@... ), SysAdmin, Analyst/Programmer.
Centre for Spatial Information Studies, University of Tasmania, Hobart.
GPO BOX 252C, Australia, 7001. Local Tel: (002) 202898 Fax: (002) 240282
International Callers use +6102 instead of (002).