Path: utzoo!attcan!uunet!samsung!xylogics!transfer!lectroid!lectroid.sw.stratus.com!lennox From: lennox@minilove.diag.stratus.com (Craig Scott Lennox) Newsgroups: comp.sys.atari.8bit Subject: Re: 6502 error conditions Message-ID: Date: 18 Sep 90 14:49:00 GMT References: <30828@nigel.ee.udel.edu> Sender: usenet@lectroid.sw.stratus.com Distribution: comp Organization: Stratus Computer, Inc., Marlboro, MA USA Lines: 30 In-reply-to: gdtltr@freezer.it.udel.edu's message of 18 Sep 90 14:27:41 GMT In article <30828@nigel.ee.udel.edu> gdtltr@freezer.it.udel.edu (Gary Duzan) writes: In article lennox@minilove.diag.stratus.com (Craig Scott Lennox) writes: =>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? I believe the result is undefined. In fact, some early 6502's had some desirable side-effects of using an undocumented opcode, so programmers would use them. Obviously a bad thing. Newer chips like the 65802 and the 65816 actually use all 256 bit patterns for opcodes. (Well, just about anyway.) Answer: Don't do that. (0.5 :-) Well that's depressing. I was hoping there would be an illegal opcode trap to implement new opcodes. Guess I won't even ask if there's an illegal memory ref trap address to use to implement virtual memory. (0.125 :-) ) The really depressing thing is: How tough could it have been? I realise that the 6502 microcode really packs 'em in, but it's pretty poor programming style not to handle error conditions. -- | flame me at: lennox@minilove.diag.stratus.com, (Craig Scott Lennox) | |"Oh boy, virtual memory! Now I'm gonna make myself a REALLY BIG ram disk!" | | Disclaimer: My opinions are covered by section 2b of the Gnu Public | | License and thus do not belong to Stratus Computer. |