[Coco] 6809 Push/Pull

Phill Harvey-Smith afra at ramoth.org.uk
Fri Jun 5 16:12:56 EDT 2020


On 05/06/2020 21:05, Jim OKeefe wrote:
> For all you ML gurus out there.
> PSHS     X,Y
> 
> To return registers to their original values is the correct pull
> 
> PULS      Y,X
> 
> PULS      X,Y

Either will work on the 6809 the registers to be pushed and pulled are 
encoded in the byte following the push or pull instruction, so either 
will assemble to the same instruction.

The processor has a pre-determined order for all pushes and pulls, so 
you don't have to worry about this if you are always pushing and pulling 
the same set of registers, as you are in the example above.

This : https://silicon-heaven.com/howel/parts/6809_instruction_set.htm
will explain it possibly better than I have :)

If you want the registers on the stack in a non default order you will 
have to push them individually, in which case the order you pop them 
will be significant.

Cheers.

Phill.

-- 
Phill Harvey-Smith, Programmer, Hardware hacker, and general eccentric !

"You can twist perceptions, but reality won't budge" -- Rush.

-- 
This email has been checked for viruses by AVG.
https://www.avg.com



More information about the Coco mailing list