[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ADC & SBC OpCodes Questions
- Subject: ADC & SBC OpCodes Questions
- From: "Bryan Parkoff" <BParkoff@satx.rr.com>
- Date: Thu, 23 May 2002 01:49:07 GMT
- Newsgroups: comp.sys.apple2
- Organization: Giganews.Com - Premium News Outsourcing
- Reply-to: "Bryan Parkoff" <BParkoff@satx.rr.com>
- Xref: archiver1.google.com comp.sys.apple2:19824
ADC & SBC OpCodes Questions
I remembered that we discussed the difference between 65816 and Intel
instructions. Again, we remembered discussing the two opcodes -- ADC and
SBC.
I understand why each emulator projects are required to write several
lines inside one function to emulate ADC and SBC opcodes properly through
C++. Please explain again one more time why it is necessary. The simple
function is to accumulate one byte before adds or subtracts second byte into
final one byte. For example, it should look like
unsigned char A = 0x40;
unsigned char B = 0x4C;
unsigned char C = A + B;
Final one byte -- C should always displays 0x8C. Why ADC and SBC
functions have to separate byte into two nibbles before they can do
operations. After opertaions, the return result shows two niblles as one
byte. It is wasting CPU's time to process.
Is it the reason that functions are needed in order to test C flag?
Please advise.
--
Yours Truly,
Bryan Parkoff
BParkoff@satx.rr.com