[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emulated 6502 Must Match Real 6502



I congratulate you Bryan for what you are doing. I think you are doing it in the true spirit of the early days. I think programmers wrote better programs in the Apple days when memory and hardware were limited. It forced you to understand the machine so you could get the most out of it. Now days, things are so fast it gives way to sloppy slow code and all kinds of security issues (did I say M$). Keep up the good work. We can all learn something from you.



Bryan Parkoff wrote:
    I have been researching while I have gathered data from many emulators
of 6502.  I have discovered that the programmers do make mistakes when they
do not study 6502 hardware seriously.  Let me give you an example below.

    Real 6502 must initialize 0x00 to Low Byte of Stack Pointer and 0x01 to
High Byte of Stack Pointer (Address at 0x0100), but programmers initialize
0xFF to Low Byte of Stack Pointer and 0x01 to High Byte of Stack Pointer
(Address at 0x01FF).  IT IS NOT THEIR ERROR.  Real 6502 powers up at RESET
initialization.  First, it reads 0x0100 (Not 0x01FF) before it pushes NO
DATA into stack three times.  First byte is High Byte, second byte is Low
Byte, and third byte is Processor Flag Status.  Three bytes CONTAIN NO DATA
(It is always correct).  The stack pointer at address: 0x0100 has decreased
to 0x01FD.
    It is where original Monitor Routine and AutoStart Routine start to push
and pop data at address: 0x01FD.  I am surprised that the programmers did
not write to push NO DATA -- 3 BYTES before they started to initialize the
RESET at 0x01FF.
    It is my goal to write 6502 emulator that is 100% identical to real 6502
machine unlike most emulators are about 95% identical.  It is very
strange...
    I do not care what you say -- stop saying that it is not important.  I
would laugh because I expect too much to make 6502 emulator to go into the
perfection.