[Coco] 6309/6809 opcodes with mixed 8/16 bit registers
jdaggett at gate.net
jdaggett at gate.net
Tue Nov 20 15:41:36 EST 2012
On 20 Nov 2012 at 9:49, Harry Hurst wrote:
> Let's say the X register contains $EC00, the PC is at $EB00, and memory
> word at $EC00 is $8000. The instruction at $EB00 is $33 $90 which would
> mean LEAU [,X+] to the 6809. After executing this instruction:
>
> PC: $EB02
> X: $EC01
> U: $8000
>
> This is not useful. LEAU [,X++], on the other hand, which is a valid
> index/indirect form, can be quite useful. I just want to make my 6x09
> simulator as accurate as I possibly can, so I'm investigating as many
> non-valid, unlikely byte sequences as I can imagine. These are just a few
> that I have tested so far.
>
> HH
Harry
This is actually usefull if you wish to parse through a table one byte at a time even though you
are loading a word at a time into the X pointer register. To examine the actual byte that you
want you could mask the other byte then do a compare. Granted it may not be a practical or
efficient method but it is legal to do so. LEAU[,X++] is far more practical usage than
LEAU[,X+]. You can do a compare word instead of making a byte and then do a compare
byte.
Not all sequences of opcodes and routines are created equally efficient. There may come a
time when you actrually have to do things a bit slower in order to wait for an event to happen
and have plenty of time. It is prettier than having a sequences of NOPs in the code to waste
time or the next event or waste memory space for useless NOP stalls.
james
More information about the Coco
mailing list