

;-----------------= "RESUME" SUBROUTINE =---------------------
; put SP back to the user's stack and do an rts!
; but save the monitor's stack!
; ------------------------------------------------------------
***
;resume_sub: "m_res.asm"
;	Used to resume program flow from a software interupt or breakpoint.
;	Reg Input:
;		None
;	Reg Output:
;		None
***

resume_sub:
	
	ins					; because RES was called as a JSR,
	ins					; we need to increment the mon stack ptr
						; so that it doesn't keep creeping down	

	sts		SP_save_mon		; save the monitor's stack
	lds		SP_save			; SP = [SP_save] (SP gets the user's stack ptr)

	rti					; rti will resume the user's code
						; this is under the assumption that you will be resuming
						; from a software interupt/breakpoint

