Megalextoria
Retro computing and gaming, sci-fi books, tv and movies and other geeky stuff.

Home » Archive » net.micro.apple » Undocumented 6502 Opcodes
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Undocumented 6502 Opcodes [message #113800] Tue, 17 September 2013 14:47 Go to next message
joeloda is currently offline  joeloda
Messages: 13
Registered: September 2013
Karma: 0
Junior Member
Message-ID: <376@aicchi.UUCP>
Date: Wed, 20-Feb-85 22:50:52 EST
Article-I.D.: aicchi.376
Posted: Wed Feb 20 22:50:52 1985
Date-Received: Fri, 22-Feb-85 09:51:42 EST
Distribution: net
Organization: Analysts International Corp; Chicago Branch
Lines: 17

Does anyone out there have a listing of undocumented 6502 opcodes?  From 
talking to several people, I have discovered:  

  - That these opcodes function differently depending upon the chip
    manufacturer.

  - That some issue of "Compute" magazine had a listing of these at some
    point in time.

Many thanks in advance;  I'll sleep better with one more curiousity 
satisfied :-).

-- 
Joe Loda
Analysts International (Chicago Branch)
(312) 882-4673
..!ihnp4!aicchi!joeloda
Re: Undocumented 6502 Opcodes [message #113819 is a reply to message #113800] Tue, 17 September 2013 14:47 Go to previous messageGo to next message
liang is currently offline  liang
Messages: 15
Registered: September 2013
Karma: 0
Junior Member
Message-ID: <74@cvl.UUCP>
Date: Thu, 21-Feb-85 20:30:39 EST
Article-I.D.: cvl.74
Posted: Thu Feb 21 20:30:39 1985
Date-Received: Tue, 26-Feb-85 07:25:46 EST
References: <376@aicchi.UUCP>
Distribution: net
Organization: Computer Vision Lab, U. of Maryland, College Park
Lines: 45

 >  Does anyone out there have a listing of undocumented 6502 opcodes?  From 
 >  talking to several people, I have discovered:  
 >  
 >    - That these opcodes function differently depending upon the chip
 >      manufacturer.
 >  
 >    - That some issue of "Compute" magazine had a listing of these at some
 >      point in time.
 >  
 >  Many thanks in advance;  I'll sleep better with one more curiousity 
 >  satisfied :-).
 >  
 >  -- 
 >  Joe Loda
 >  Analysts International (Chicago Branch)
 >  (312) 882-4673
 >  ..!ihnp4!aicchi!joeloda

There is a back issue of Byte which also mentioned the undocumented opcodes.

The wierdest opcode yet though is one a friend told me about.  It may be
apochryphal so I think I will disclaim it right off.  Supposedly, the
original 6502 had an undocumented test instruction (one of the x2H opcodes,
I think it was 12H) which would tie up the cpu and run internal checks on the
processor such as run through the address/data lines lightning fast, until it
was reset or a NMI occurred.  Well, this testing had a nasty side effect....
The chips would get so hot doing this that after it was let run for a few
hours, the chip would either just fail, or every long once in a while
something catastrophic would happen and the chip would start smoking or
actually catch on fire!  It was thus descriptively named the HCF (Hold and
Catch Fire) instruction.  Supposedly, the Source or Compuserve had a 3 part
article a few years ago describing this fascinating instruction.  Perhaps
there is someone on the net who worked on the design of the 6502 and could
affirm or deny, once and for all whether the HCF instruction has ever existed
or exists.

-eli

-- 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Eli Liang  ---
        University of Maryland Computer Vision Lab, (301) 454-4526
        ARPA: liang@cvl, eli@mit-mc, eli@mit-prep  CSNET: liang@cvl
        UUCP: {seismo,rlgvax,allegra,brl-bmd,nrl-css}!umcp-cs!cvl!liang
Re: Undocumented 6502 Opcodes [message #113821 is a reply to message #113800] Tue, 17 September 2013 14:47 Go to previous messageGo to next message
cdshaw is currently offline  cdshaw
Messages: 20
Registered: May 1985
Karma: 0
Junior Member
Message-ID: <7307@watrose.UUCP>
Date: Sun, 24-Feb-85 06:15:30 EST
Article-I.D.: watrose.7307
Posted: Sun Feb 24 06:15:30 1985
Date-Received: Wed, 27-Feb-85 03:06:04 EST
References: <376@aicchi.UUCP> <74@cvl.UUCP>
Reply-To: cdshaw@watrose.UUCP (Chris Shaw)
Distribution: net
Organization: U of Waterloo, Ontario
Lines: 11


The HCF instruction actually did exist in the early version of the Motorola
6800. This "instruction" was undocumented, as well, but I read an article
in an ancient BYTE (1978 or so) that documented the undocumented goodies
of 6800, and this was one of the instructions.

It doesn't strike me as too likely that HCF could have occurred on 2 
processors, and given reputations of all the CPU makers around I would vote
Motorola as being most likely to screw up like this.

Chris Shaw
Re: Undocumented 6502 Opcodes [message #115183 is a reply to message #113800] Wed, 18 September 2013 17:18 Go to previous messageGo to next message
devoz is currently offline  devoz
Messages: 2
Registered: September 2013
Karma: 0
Junior Member
Message-ID: <9@zurton.UUCP>
Date: Wed, 27-Feb-85 03:38:46 EST
Article-I.D.: zurton.9
Posted: Wed Feb 27 03:38:46 1985
Date-Received: Sun, 3-Mar-85 05:33:03 EST
Lines: 31
Nf-ID: #R:aicchi:-37600:zurton:5800001:000:1021
Nf-From: zurton!devoz    Feb 24 13:05:00 1985




	I wouldn't put much stock in a HCF instruction, considering
	the VAST number of 6502 based machines.

	Think about it.  With the amount of "hacking" done on these,
	surely large numbers would have accidently executed HCF instructions
	and burst into flames.  (hee hee hee).

	I do support the theory that there may be an instruction, or
	types of instructions, 	that, when executed, causes a Degradation
	of the Instruction Set, killing off many instructions, and maiming
	others.

	If you program in 6502 you know exactly what I mean.

	A sample of Destructive Op Codes:

	DHXI		-  Destroy Half of the X Index register
	DHYI		-  Destroy Half of the Y Index register
	AWID		-  Always Wander Into Decimal mode

	There are more.  Supposedly during chip testing of the first
	few million devices, the original manufacturer wrongly executed
	these instructions, limiting the power of the 6502 forever,
	or until the 65816 arrives.  (Ahhhh, the price of compatibility).



				ddddddddeeeeeeeevvvvvvvvvoooooooozzzzzzzzzz
Re: Undocumented 6502 Opcodes [message #115192 is a reply to message #113800] Wed, 18 September 2013 17:18 Go to previous messageGo to next message
dudek is currently offline  dudek
Messages: 19
Registered: May 2013
Karma: 0
Junior Member
Message-ID: <381@utai.UUCP>
Date: Mon, 4-Mar-85 13:30:12 EST
Article-I.D.: utai.381
Posted: Mon Mar  4 13:30:12 1985
Date-Received: Mon, 4-Mar-85 14:43:13 EST
References: <9@zurton.UUCP>
Reply-To: dudek@utai.UUCP (Gregory Dudek)
Organization: CSRI, University of Toronto
Lines: 9
Summary: 

I tried to execute some of the unused 6502 opcodes and found one that
seems to conform to the described HCF specs.  That is, the processor 
seems to hang up and doesn't go anywhere until it gets a reset.
   Of course, I didn't let it sit there long enough to find out
if the processor would self-destruct.  If anybody is willing to
satisfy our curiosities, the op-code was $12.  As noted, the presence
of the HCF instruction may depend on the chip manufacturer.  Unfortunately,
I forgot to check who made mine.
   Greg Dudek
Re: Re: Undocumented 6502 Opcodes [message #115202 is a reply to message #113819] Wed, 18 September 2013 17:18 Go to previous messageGo to next message
liang is currently offline  liang
Messages: 15
Registered: September 2013
Karma: 0
Junior Member
Message-ID: <139@cvl.UUCP>
Date: Wed, 6-Mar-85 18:40:22 EST
Article-I.D.: cvl.139
Posted: Wed Mar  6 18:40:22 1985
Date-Received: Sat, 9-Mar-85 19:58:55 EST
References: <9@zurton.UUCP> <381@utai.UUCP>
Organization: Computer Vision Lab, U. of Maryland, College Park
Lines: 23

 >  I tried to execute some of the unused 6502 opcodes and found one that
 >  seems to conform to the described HCF specs.  That is, the processor 
 >  seems to hang up and doesn't go anywhere until it gets a reset.
 >     Of course, I didn't let it sit there long enough to find out
 >  if the processor would self-destruct.  If anybody is willing to
 >  satisfy our curiosities, the op-code was $12.  As noted, the presence
 >  of the HCF instruction may depend on the chip manufacturer.  Unfortunately,
 >  I forgot to check who made mine.
 >     Greg Dudek

This is the exact instruction which I mentioned in my previous article.
$12.  I think that there must be some truth in the HCF instruction for the
6502.

-eli

-- 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Eli Liang  ---
        University of Maryland Computer Vision Lab, (301) 454-4526
        ARPA: liang@cvl, liang@lemuria, eli@mit-mc, eli@mit-prep
        CSNET: liang@cvl  UUCP: {seismo,allegra,brl-bmd}!umcp-cs!cvl!liang
Re: Undocumented 6502 Opcodes [message #115206 is a reply to message #113800] Wed, 18 September 2013 17:18 Go to previous messageGo to next message
pc is currently offline  pc
Messages: 19
Registered: June 2013
Karma: 0
Junior Member
Message-ID: <418@unisoft.UUCP>
Date: Fri, 8-Mar-85 11:46:32 EST
Article-I.D.: unisoft.418
Posted: Fri Mar  8 11:46:32 1985
Date-Received: Mon, 11-Mar-85 06:53:52 EST
References: <9@zurton.UUCP>, <381@utai.UUCP>
Organization: UniSoft Corp., Berkeley
Lines: 5



	Actually the HCF opcode implements the smiley face operator ( :-) :-)

			Paul Campbell		ucbvax!unisoft!paul
Re: Re: Undocumented 6502 Opcodes [message #115207 is a reply to message #113819] Wed, 18 September 2013 17:18 Go to previous messageGo to next message
john is currently offline  john
Messages: 294
Registered: February 2013
Karma: 0
Senior Member
Message-ID: <421@x.UUCP>
Date: Fri, 8-Mar-85 15:25:50 EST
Article-I.D.: x.421
Posted: Fri Mar  8 15:25:50 1985
Date-Received: Mon, 11-Mar-85 06:57:39 EST
References: <9@zurton.UUCP> <381@utai.UUCP> <139@cvl.UUCP>
Organization: Charles River Data Systems, Framingham MA
Lines: 14

 >  $12.  I think that there must be some truth in the HCF instruction for the

As I have heard it, the "HCF" instruction which is often found in 6800s and
6502s is intended for QA at the factory:  the intent is that you feed the chip
the magic instruction, and watch what happens:  it is supposed to count on the
address lines, from 0 to 65535, forever.  This [roughly] validates the address
drivers as well as much of the internal logic.  Those who have been looking
for the HCF instruction on their favorite micros might watch the address
lines to see if this is true.
-- 
John Woods, Charles River Data Systems, Framingham MA, (617) 626-1101
...!decvax!frog!john, ...!mit-eddie!jfw, jfw%mit-ccc@MIT-XX.ARPA

Sorry, I don't feel deep right now.
Re: Re: Undocumented 6502 Opcodes [message #115213 is a reply to message #113819] Wed, 18 September 2013 17:27 Go to previous message
Anonymous
Karma:
Originally posted by: paul@unisoft.UUCP (Paul Campbell)
Message-ID: <419@unisoft.UUCP>
Date: Sun, 10-Mar-85 15:19:51 EST
Article-I.D.: unisoft.419
Posted: Sun Mar 10 15:19:51 1985
Date-Received: Tue, 12-Mar-85 20:53:25 EST
References: <9@zurton.UUCP> <381@utai.UUCP>, <139@cvl.UUCP>
Organization: UniSoft Corp., Berkeley
Lines: 9



	Seriously this time .... the 6800 has a similar opcode which is
in there for chip testing ... when you execute it the chip goes into a strange
mode where its microcode loops cycling its address lines thru the whole
address space reading all of memory. The only way of getting out of this is
to reset the chip, maybe the HCF instruction is similar?

		Paul Campbell		ucbvax!unisoft!paul
Re: Undocumented 6502 Opcodes [message #117044 is a reply to message #113800] Wed, 13 March 1985 16:37 Go to previous message
john is currently offline  john
Messages: 294
Registered: February 2013
Karma: 0
Senior Member
Article-I.D.: hp-pcd.20000004
Posted: Wed Mar 13 16:37:00 1985
Date-Received: Fri, 15-Mar-85 05:33:22 EST
References: <376@aicchi.UUCP>
Organization: Hewlett-Packard - Corvallis, OR
Lines: 16
Nf-ID: #R:aicchi:-37600:hp-pcd:20000004:000:790
Nf-From: hp-pcd!john    Mar 11 13:37:00 1985

<<<<
  I once found a bunch of undocumented opcodes in the 6502 in my KIM-1 by
looking for patterns in the opcodes. None of the original  6502 opcodes ended
in 11 (as in XXXXXX11). It turns out that executing these instructions would
perform both a XXXXXX01 and a XXXXXX10 instruction. For example a A7 would
load X from Page Zero (A6) AND load A from Page Zero(A5) at the same time.
There were also some store instructions that could OR two registers and
store them in memory in one instruction although I hate to think what  was 
going on inside the chip for that one.

  I am sure that if a HCF was a opcode 12 that it must have been a special
case instruction. Its class and grouping is what you would have suppected a
ASL (ind),Y to be if it existed. 

John Eaton
!hplabs!hp-pcd!john
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How standard is Apple CP/M?----->>>>>additional info
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Mar 28 16:29:26 EDT 2024

Total time taken to generate the page: 0.07800 seconds