[Coco] Pop PC with empty stack?

Bob Devries devries.bob at gmail.com
Tue Apr 6 00:20:59 EDT 2010


Hi Lothan,

If your code sample is at the end of a subroutine, the PULS PC will 
effectively be an RTS.

Regards, Bob Devries

--
Besides a mathematical inclination, an exceptionally good mastery of one's 
native tongue is the most vital asset of a competent programmer.

Edsger W.Dijkstra, 18 June 1975

----- Original Message ----- 
From: "Lothan" <lothan at newsguy.com>
To: "CoCo List" <coco at maltedmedia.com>
Sent: Tuesday, April 06, 2010 2:08 PM
Subject: [Coco] Pop PC with empty stack?


> I'm hoping someone can help refresh my memory on the internals of OS-9. 
> Specifically, I'm seeing this code:
>
> PSHS Y
> ...
> PSHS X
> ...
> LDA ,-X
> CMPA #$30
> BCS L016C
> CMPA #$39
> BHI L016C
> ...
> L016C LDD 2,U
> PULS X
> PULS Y,PC
>
> That it's popping X and Y from the stack makes perfect sense because those 
> two registers were pushed onto the stack previously. At this point the 
> stack should be empty, so what happens when it attempts to pop PC from the 
> stack? Is this effectively the same as OS9 F$Exit?
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco 




More information about the Coco mailing list