Re: 6502 emulator

From: Marko Mäkelä (msmakela_at_cc.hut.fi)
Date: 1999-10-21 21:47:54

On Thu, 21 Oct 1999 g.j.p.a.baltissen@kader.hobby.nl wrote:

> Question 1: why do 1-byte-opcodes need two cycles?

Because it's simpler so.  The processor won't dispatch the opcode until
the second clock cycle.  For all instructions it will fetch the opcode
byte and the following byte.  JSR is one of the most interesting
instructions, since it'll read the 3rd byte on the last cycle, after
pushing the return address on the stack.

> Question 2: Why do the ADC- and SBC-opcodes need an extra cycle when in decimal 
> mode?

They don't.  Only in the CMOS 6502, where the decimal mode "bug" of
setting the flags "unpredictably" was fixed, they will require an extra
cycle.  (I've analyzed how the flags are set, and most emulators should
have implemented that correctly.)

	Marko

-
This message was sent through the cbm-hackers mailing list.
To unsubscribe: echo unsubscribe | mail cbm-hackers-request@dot.tcm.hut.fi.

Archive generated by hypermail 2.1.1.