[Coco] 6809 Push/Pull

Arthur Flexser flexser at fiu.edu
Fri Jun 5 23:43:48 EDT 2020


On Fri, Jun 5, 2020 at 9:44 PM Salvador Garcia via Coco <
coco at maltedmedia.com> wrote:

>  Adding to this thread...
>
> Is the developer allowed to do some thing like:
>
> PSHS    X
>
> PULS    Y
>
>
> What if I try something like this:
>
> PSHS    X,Y
>
> PULS    X
>
>
> Like others, just curious. :-) Thanks, Salvador
>
>
Sure, that's legal.  PULS Y just pulls 2 bytes off the stack, not knowing
or caring how they were initially placed there, and sticks those 2 bytes
into the Y register.  Same with the PULS X in the second example, in this
case pulling 2 stacked bytes into the X register.  I THINK the second
example puts what was initially in X, rather than Y, back into the X
register, but that depends on whether my memory is right about what the
6809's stacking order prescribes, which I believe results in  (lowest
address, = S register contents) X MSB, X LSB, Y MSB, Y LSB (highest
address) prior to the PULS X being executed..

Art


More information about the Coco mailing list