0 Users Online Chatting

  • No one

 

March 2010
S M T W T F S
« Feb   Apr »
 123456
78910111213
14151617181920
21222324252627
28293031  

Newest Files

Downloads Page

Archives


03/09/10: “RESET” opcode. Does it exist? by hhos, | Tags: , , | Category: General, Programming | 10 comments

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.

FavoriteLoadingAdd to Favorites

10 comments to “RESET” opcode. Does it exist?

  • sixxie

    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…

  • DarrenA

    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.

  • DarrenA

    @sixxie

    That page you referenced says the following regarding the TFR instruction:

    When transferring from register M to register N, as many bits are filled from bit 0 in N as can be obtained from M, and the rest (if any) are filled with 1s. So, transferring A to B transfers the 8 bits of A into the lower bits of B, and that’s it … nothing left to fill with 1s.

    BUT, transferring B into Y, for example, would take the 8 bits of B and shove them into the lower 8 bits of Y, and since it has run out of B, would fill the upper 8 bits of Y with 1s.

    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.

  • hhos

    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.

    • DarrenA

      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.

      • hhos

        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. :)

  • sixxie

    DarrenA: Coo, I guess I didn’t experiment with those at the time.

  • DarrenA

    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

  • sixxie

    Very interesting indeed, thanks!

You must be logged in to post a comment.