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?

  • 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 '20 at 0:24
  • 3
    visual 6800 should be the authoritative answer for what every instruction does. Jun 23 '20 at 0:47
  • @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 '20 at 6:43
  • @KelvinSherlock Ah, perfect! I thought I'd need an FPGA or something, but this is great. Thank you.
    – tobiasvl
    Jun 23 '20 at 6:45
  • 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 '20 at 11:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.