Jump to content
IGNORED

How many of the 105 illegal opcodes are actually useful, or were ever used?


applekevin

Recommended Posts

As I understand it, the majority just produce erratic behavior. Which of these were worthwhile? Also, does this set differ in the 6502C SALLY from other 6502 variations?

Most of the stuff is completely useless and a waste - despite that these instructions are undocumented and a programmer should be slapped in his face for using such stuff. But anyhow: There are *some* partially useful intructions there to load X and A register simultaneously, and to AND X with A. The rest are either combinations of other opcodes that, in their combination, are too "specific" to be of any value. Some of them use addressing modes depending on the data and stuff like that. Then there is a second class of opcodes that depend on the type of "noise" that is on the bus, and that are thus not even stable (depends on the circumstances what the result of such an opcode is), and a third class of opcodes that simply lock up the CPU where neither a IRQ nor an NMI can trigger any reaction. You need to reset the CPU to restart it.

Link to comment
Share on other sites

despite that these instructions are undocumented and a programmer should be slapped in his face for using such stuff

 

all stable "illegal" codes works on atari so what is the problem?

 

code using specific 6502c ability do not work on 65816? so what?

code using specific 65816 ability do not work on atari... also :-)

 

if program could runs faster (or be shorter) with undocumented codes why not use undocumented codes? I think just to fool the user that he needs a 16bit cpu :D

 

so, write bloated code and upgrade atari to 16bit ;-)

  • Like 3
Link to comment
Share on other sites

all stable "illegal" codes works on atari so what is the problem?

Because a) you don't know what is "stable" because you have nothing from the manufacturer to warrant this. IOW, what may work on your machine may not work on another. I've seen here some "believed to be stable" opcodes that do not work on my XL. It's a standard plane "sally CPU" in it. b) even if, you do not know whether the machine was extended or equipped with a 65C02 or some successor processor. That said, due to timing or production differences, you cannot be sure that they function identically from machine to machine.

 

if program could runs faster (or be shorter) with undocumented codes why not use undocumented codes? I think just to fool the user that he needs a 16bit cpu :D

Be serious. If I want a fast program, I'll get a PC. The advantage offered by the opcodes, if any, is probably one to two cycles, as in most cases, the overall number of cycles also increase. And no, using the documented instructions does not lead to "bloated code", just to "good engineering practise".

Link to comment
Share on other sites

Most of them are completely stable because they rely on the mechanisms of other opcodes. In other words, a change to the 6502 core would be needed to break them. A few of them aren't stable because they rely on things like the state of floating busses within the CPU and may not always read the same way under all conditions. Anyway, I think they make sense if you can't accomplish what you want any other way, such as when you need maximum speed from demo code or if you're trying to make the smallest possible routine.

 

If you do use them, you should probably test the CPU type and display a warning if possible.

Link to comment
Share on other sites

I've seen here some "believed to be stable" opcodes that do not work on my XL.

 

 

wchich one? Could you take a picture of your motherboard and processor?

 

 

That said, due to timing or production differences, you cannot be sure that they function identically from machine to machine.

 

These commands are in the "unstable" group :-)

 

b) even if, you do not know whether the machine was extended or equipped with a 65C02 or some successor processor.

 

cmos version (65c02 & 65c816) even in documented codes are not 100% compatible with 6502c (Sally)...

Edited by xxl
Link to comment
Share on other sites

What??

 

Which 6502C instruction is not 100% compatible on a 65816?

 

65816s are available on the 8-bit, with more to come. Writing code that will certainly break on a 65816 is no different than jumping into the OS routines on a 400/800, deleting the PBI code in an XL/XE system, or using bit 6 of $D301 as some kind of flag. All of these things will cause conditional crashes on new hardware.

 

Do me (and the rest of the Atari community) a favor. If you are writing such code, mark your software with a warning label so we won't waste our time trying to figure out what is breaking your software.

 

Bob

  • Like 2
Link to comment
Share on other sites

furthermore 6502c (Sally) is NMOS so in read-modify-write codes do "false" write, 65816 in this case do "false" read - eg. in some cases use inc irqen do not work on 65816 but on atari work just fine. on 65816 in this case you need use about 4 commands.

 

 

 

 

If you are writing such code, mark your software with a warning label

 

"WARNING! this software works on Atari" - is this enought for you? :D

 

so if you replace part of atari with almost compatybile chips you got machine almost compatybile with atari ;-)

Link to comment
Share on other sites

wchich one? Could you take a picture of your motherboard and processor?

Has already been discussed in the acid test thread. You'll find a picture there, too. There's nothing special about the model. It is an early 800XL PAL version with a Sally CPU.

 

These commands are in the "unstable" group :-)

How do you know that something is in the unstable group? It's not that there is any official documentation about them. IOW, you're depending on your luck that the production masks haven't changed, but nothing else. That's "bad engineering practise".

Link to comment
Share on other sites

"WARNING! this software works on Atari" - is this enought for you? :D

No, because the term is loosely defined. Is an Atari with a 65C02 an Atari? Certainly so, and well-written software will continue to work. Which includes most if not all software I'm aware of, and certainly the type of software I have written. Atari made changes to the ROMs (various versions) to the wiring (PIA port B), to the chips (GTIA vs. CTIA) and so on. So there is nothing wrong with a 65C02 per se as it satisfies the same interface MOS/Synertek defined. There is a document that describes what the CPU can do, and if you depend on anything else, I just hope that I don't have to use your software anytime soon

Link to comment
Share on other sites

Has already been discussed in the acid test thread. You'll find a picture there, too. There's nothing special about the model. It is an early 800XL PAL version with a Sally CPU.

 

you mean this: "Unfortunately, I've currently no access to my 8-bit" ( http://atariage.com/...75#entry2702415 )

which opcode? pictures of mainboard and cpu may help find the same config and perform more tests :-)

 

 

> my 130XE, after few hours of continuous running, stops passing the "CPU: Illegal instructions" test

 

I think it's "SHA". I reported to remove it from Acid test because on some atari change modus operandi - depends of ??? temperature ???

SHA is "unstable" - works only on some atari.

 

 

 

Is an Atari with a 65C02 an Atari? Certainly so.

 

Certainly Atari with 65C02 :-) cmos 65c02 is enough compatible to fool some users that it's the same :-)

 

 

Atari made changes to the ... to the chips (GTIA vs. CTIA) and so on.

 

therefore you suggest not to use GTIA modes (16c) because it will not work at CTIA? hehe

I suggest to use full power of documented & undocumented features of Atari computer. it's ok until program works on standard atari.

Link to comment
Share on other sites

you mean this: "Unfortunately, I've currently no access to my 8-bit" ( http://atariage.com/...75#entry2702415 )

which opcode? pictures of mainboard and cpu may help find the same config and perform more tests :-)

Scroll further. You'll find an image. I uploaded one.

 

therefore you suggest not to use GTIA modes (16c) because it will not work at CTIA? hehe

I suggest to use full power of documented & undocumented features of Atari computer. it's ok until program works on standard atari.

Except that Atari documented what the register does, did not before and what the extra bits do. That's not the case here. What the instructions do was left undocumented, and for good reason. What happens there is rather a side-effect of the internal CPU design and not part of a documented interface. You do understand the difference between "documented change" and "undocumented side effect", do you?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...