6502 Unsupported Opcodes

From VisualChips

Revision as of 16:50, 5 January 2011 by EdS (Talk | contribs)
Jump to: navigation, search

The 6502 is famous for doing interesting and sometimes useful things when the program includes invalid (or unspecified) opcodes.

The visual6502 simulator can help when investigating what these opcodes do, and why - see below!


none here yet

some background

Beware: different revisions of 6502 and versions from different manufacturers may have different behaviours.

For some of these opcodes, the chip does something logically predictable and our model has the same behaviour. But there may be opcodes which are not logically predictable, because they cause marginal voltages on the chip as different drivers fight one another, or a node which is undriven is sampled at a later time. In those cases, our visual6502 simulator, which is just a switch-level simulator with a couple of coarse heuristics for modelling contention and charge storage, won't do the same as a chip.

In fact, as some opcodes produce results which vary from one chip to another, no deterministic simulator could be 'accurate'. (A simulator could let you know that something is amiss)

But note that the underlying circuit data which we now have includes transistor strengths and an approximation of capacitative load: it could easily be extended for resistance and more accurate capacitance. So a more refined (lower level) simulation might shed more light on these undocumented opcodes. In fact, the FPGA model works differently - it moves charge from one node to another - and it might be more accurate for the difficult cases.


Personal tools