Does anyone know anything about this? I am modifying a disassembler for my own purposes. The disasm I’m modifying places a “RESET” opcode at $3E. I checked both 6809 and 6309 refs that I have. None of them show anything at this location. I’m thinking I will just remove it, but if anyone can tell me what this is, if it is indeed anything at all, I will leave it in. Thanks.
This post was submitted by hhos.




Pretty sure a real 6809 resets when you call that instruction. Certainly a very young me thinks so: http://www.6809.org.uk/dragon/illegal-opcodes.shtml – and while that guy can’t write for toffee, I trusted him enough that I made XRoar behave like that…
Yes. Executing a $3E opcode on a 6809 is similar to SWI. It stacks the entire machine state, sets the I and F bits in CC (but not the E bit) and then loads the address from the RESET vector into PC. It may also set DP to 0, but I haven’t verified that.
If you execute $3E on a 6309, you get an Illegal Instruction exception.
@sixxie
That page you referenced says the following regarding the TFR instruction:
That is correct so long as A or B are specified as the source register. However, if either CC or DP are transferred to a 16-bit register, they are copied to both the upper and lower halves.
Okay, thanks. I’ll leave it in for the 6809 and take it out of the 6309 disassembly. Or maybe I should leave it in and make it a special case? I’ll have to think about that. Thanks again.
If your disassembler has distinct modes for 6309 vs 6809 then I would suggest that it either produce an Illegal Instruction notification or consider it as possible data in 6309 mode.
It not only has distinct modes for 6809 and 6309, but I think I’m almost done with a 6800 mode now. I think I will have it stop if runs into something like this. In fact it might be a good idea to stop it anytime it runs into an illegal opcode. I’m not quite ready to let the disassembler switch to data mode on its own, though I may work toward that end eventuallly. By the way an opcode of $10 $20 is a working LBRA on the 6809, but not on the 6309. It’s not very practical, but like the $3E, it’s there.
DarrenA: Coo, I guess I didn’t experiment with those at the time.
You may be interested in my Instruction Set documentation. In particular, the very last page contains information on the undefined opcodes:
http://www.coco3.com/community/wp-content/uploads/2010/03/6x09_Instruction_Sets.pdf
That looks like it will be very useful. Thank you, Darren.
Very interesting indeed, thanks!