Undocumented opcodes

Undocumented opcodes

Post by P » Mon, 18 Oct 2004 05:24:44


I've found a web page on 6502 coding which shows some irregular opcodes for
6502 machine coding like

DCP (DCP) [DCM]
~~~~~~~~~~~~~~~
Subtract 1 from memory (without borrow).
Status flags: C

Addressing |Mnemonics |Opc|Sz | n
------------|-----------|---|---|---
Zero Page |DCP arg |$C7| 2 | 5
Zero Page,X |DCP arg,X |$D7| 2 | 6
Absolute |DCP arg |$CF| 3 | 6
Absolute,X |DCP arg,X |$DF| 3 | 7
Absolute,Y |DCP arg,Y |$DB| 3 | 7
(Indirect,X)|DCP (arg,X)|$C3| 2 | 8
(Indirect),Y|DCP (arg),Y|$D3| 2 | 8

Is it something true for Oric? This information was for Atari computer, and
probably not applied to Oric ( or is it?)

Adress is :

http://www.yqcomputer.com/
 
 
 

Undocumented opcodes

Post by Andre Majo » Mon, 18 Oct 2004 21:51:08


At the time, I remember trying undocumented opcodes mentioned in
a book written by a C64 guy. I found that they didn't work. I
suppose that what works depends heavily on the maker of the
6502.

--
Andr?Majorel <URL: http://www.yqcomputer.com/ ~amajorel/>
There are far more C programmers than there are copies of the
standard. -- Keith Thompson

 
 
 

Undocumented opcodes

Post by mjb » Tue, 19 Oct 2004 06:34:50

In article < XXXX@XXXXX.COM >,




The *documented* behaviour of the 6502 is the only thing guaranteed between
different makers, sadly.

Undocumented opcodes are just side effects of the slightly incomplete
"decode" logic in the 6502, so you can get combinations of instructions
firing off at the same time, usually not a useful thing. And what exactly
happens may vary from design to design. Including ... "nothing happens"

Geoff Phillips documented some of this stuff in the "Machine Code And
Graphics On the Oric And Atmos" book, I think that's where I first
came across it. There's an online version of this book, if you can't
find a printed copy.

There's also some other stuff in there about any instruction ending
in 2 (0h02, 0h12 ... 0hF2) will halt the processor, except 0hA2 which was
LDX (or LDY) ...
--
--------------------------------------+------------------------------------
Mike Brown: mjb[at]pootle.demon.co.uk | http://www.yqcomputer.com/
 
 
 

Undocumented opcodes

Post by Anders Car » Tue, 19 Oct 2004 16:43:01

Andre Majorel < XXXX@XXXXX.COM > writes:


I think it depends on if you use a CMOS or NMOS (HMOS?) 65xx. From
what I understand, some of the illegal opcodes are stable, some may
work in certain cases and some will never work. Personally I've not
bothered to learn which shortcuts there are to take.

--
Anders Carlsson
 
 
 

Undocumented opcodes

Post by Jani Tiain » Tue, 19 Oct 2004 18:03:55


Well to be exact, undocumented opcodes, or not stardard ones depends
greatly who's chip it is. Eg. if you use new 6502 chips eg. from WDC
they have some documented, non-standard extensions in their chip...

So if really want to make code "compatible" it's best to stick with
known ones.

--

Jani Tiainen