9

The M6800 had a few illegal opcodes, including the (in)famous HCF (Halt and Catch Fire). The following illegal opcodes were revealed in BYTE Magazine, December 1977:

  • $14: NBA
  • $87: STAA immediate
  • $C7: STAB immediate
  • $8F: STS immediate
  • $CF: STX immediate
  • $9D/$DD: HCF

In addition, this article reveals these additional illegal opcodes:

  • $15: NOP
  • $CD/$ED: HCF with slightly different behavior
  • $FD: HCF but slower

Okay, that's all well and good. I only listed them all because the first article I linked to, from BYTE Magazine in December 1977, says the following:

Some of those codes seem to be just NOPS: they do nothing. Others change the flags in the condition code register according to some pattern that is, as yet, undeciphered.

What are these additional illegal opcodes on the M6800, which are not listed above? And has someone deciphered their flag changing patterns in the intervening 42.5 years?

8
  • 3
    I guess it is like people collecting doorknobs. I don't understand it, or the fascination with undocumented opcodes. Sure you can investigate them and even use them, but to depend on them in real code is risky to the point of foolishness. Just because you have a physical CPU where undocumented opcodes does such and such, other people will have the "same" CPU where such and such is something different. Like doorknobs that don't have knobs. Still upvoting, though, because you did some research.
    – RichF
    Jun 23, 2020 at 0:24
  • 4
    visual 6800 should be the authoritative answer for what every instruction does. Jun 23, 2020 at 0:47
  • 1
    @RichF Hehe, yeah, I've been down an illegal opcode rabbit hole lately after I accidentally used an MC6803 assembler for my MC6800 code, and it "optimized" my JSR $0040 into an HCF (or a JSR $40 as it's known on the 6803). It's just curiousity, albeit perhaps a morbid curiosity.
    – tobiasvl
    Jun 23, 2020 at 6:43
  • 1
    @tobiasvl That would be this: tobiasvl.github.io/blog/choosing-the-wrong-m6800-assembler (yes, you are one of the only people to mention 'mc6800 hcf' enough for it to show up in a google search)
    – user253751
    Jun 24, 2020 at 11:06
  • 1
    @rbanffy: I wouldn't regard the ability to store (A and X), the ability to load A and X simultaneously, nor the ability to decrement a byte of memory and compare it with A, useless. In fact, I'd regard all three of those as being more broadly useful than some of the more complicated instructions that were added to the 65C02.
    – supercat
    Sep 28, 2022 at 20:22

0

You must log in to answer this question.

Browse other questions tagged .