[Coco] Quick 6809 Q for night owls in the US
lost at l-w.ca
Tue Apr 15 10:14:08 EDT 2014
Actually, LD and ST both set flags based on the value being loaded or
stored regardless of register involved. N and Z get set as expected and
V gets cleared. C is not affected.
LEAS and LEAU do not affect any flags, of course. LEAX and LEAY affect
All this still adds up to the original point that you can't use U or S
for the loop. (Well, you can, but you'd need a "CMPU #0" or "CMPS #0"
before the BNE instruction. Which might be fine if you need a longer
delay and are okay with using an extra code bytes.) You can, however,
use X or Y for the loop counter.
On 14-04-15 07:37 AM, Steve wrote:
> Can't use the U (or S) register for this loop since the Z-flag is not
> set when doing LEA or LD operations. These are stack registers and
> should not effect any flags since that would be bad for saving the state
> of the CPU.
> On 4/15/2014 6:24 AM, tim at franklinlabs.com wrote:
>> I'm not at home to test but wouldn't this work??/
>> LDU #1000
>> LOOP: LEAU -1,U
>> BNE LOOP
>> All inside the CPU.
> Coco mailing list
> Coco at maltedmedia.com
More information about the Coco