Path: utzoo!attcan!uunet!lll-winken!decwrl!apple!portal!cup.portal.com!Ordania-DM From: Ordania-DM@cup.portal.com (Charles K Hughes) Newsgroups: comp.sys.atari.8bit Subject: Re: 6502 error conditions Message-ID: <34056@cup.portal.com> Date: 19 Sep 90 06:20:06 GMT References: Organization: The Portal System (TM) Lines: 19 Craig Lennox asks: >What does the 6502 do when it encounters an illegal >opcode? Does it just halt, as in a BRK, or can you have >it branch to a trap address? The 6502 does several things. Sometimes it executes the illegal instruction, sometimes it hangs (and I think a powerdown is required to reset it), and sometimes it executes a NOP. The 65C02 chip executes NOPs when it encounters an illegal instruction, as does the 65802 and 65816. To my knowledge, none of the chips simply HALTs or branches to a trap address. For the 6502, however, you can actually build a circuit that can detect most of the illegal opcodes, and cause an interrupt if one is about to be executed. If you want more information on this, send me email. A more attractive way of avoiding illegal opcodes is to use the 65C02 however. :) >-- >| flame me at: lennox@minilove.diag.stratus.com, (Craig Scott Lennox) | Charles_K_Hughes@cup.portal.com