[Coco] 6309/6809 opcodes with mixed 8/16 bit registers

William Astle lost at l-w.ca
Tue Nov 20 16:16:31 EST 2012


On 12-11-20 01:49 PM, Luis Antoniosi wrote:
> It's is limited but I can think some ways where it would be useful.
> Like sub-string search where you can compare 2 first characters
> instead of one. If there is a mismatch, it will continue on the next
> byte on string, and not next word. Supose you want to find all CR/LF
> in a text file.

LDU ,X+ would be better than LEAU [,X+] in that case for two reasons. 
The first is that [,X+] is not officially valid (and won't work on a 
6309 anyway) and the second is that LDU ,X+ is faster anyway (guessing 
by the fact that the indirect indexing modes are all 3 cycles slower 
than direct indexing modes). One could also use CMPU ,X+ (or CMPX ,U+), too.

As for why the real 6809 might actually implement the [,r+] and [,-r] 
variants, it's simple. Actually making an exception in the decode would 
have required more complexity in the design. The 6809 is not microcoded 
so having exceptions like that is more difficult. Of course, that does 
raise the question of why they felt the need to officially ban those 
operations. Probably something to do with the specs being settled before 
the silicon was.


>
> On Tue, Nov 20, 2012 at 3:41 PM,  <jdaggett at gate.net> wrote:
>> 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
>>
>>
>> --
>> Coco mailing list
>> Coco at maltedmedia.com
>> http://five.pairlist.net/mailman/listinfo/coco
>
>
>




More information about the Coco mailing list