[Coco] Pop PC with empty stack?

Lothan lothan at newsguy.com
Tue Apr 6 00:08:03 EDT 2010


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?



More information about the Coco mailing list