.NLIST TOC,SYM .TITLE $SAVAL .SBTTL ULBLIB 001 - Save and restore all registers .IDENT \V01.01\ .PSECT .LIBC. .ENABL LC ; Copyright (c) 1998 by Mentec, Inc., Nashua, NH. ; All rights reserved ; ; This software is furnished under a license for use only on a ; single computer system and may be copied only with the ; inclusion of the above copyright notice. This software, or ; any other copies thereof, may not be provided or otherwise ; made available to any other person except for use on such ; system and to one who agrees to these license terms. Title ; to and ownership of the software shall at all times remain ; in Mentec, Inc. ; ; The information in this document is subject to change without ; notice and should not be construed as a commitment by Digital ; Equipment Corporation, or Mentec, Inc. ; ; Digital and Mentec assume no responsibility for the use or ; reliability of its software on equipment which is not supplied ; by Digital or Mentec, and listed in the Software Product ; Description. ;+ ; $SAVAL ; Famous register save/restore coroutine ; ; JSR PC,$SAVAL ; ; All registers saved/restored ;- $SAVAL:: MOV R4,-(SP) ;Save R4 MOV R3,-(SP) ;Save R3 MOV R2,-(SP) ;Save R2 MOV R1,-(SP) ;Save R1 MOV R0,-(SP) ;Save R0 MOV 12(SP),-(SP) ;Get the return address MOV R5,14(SP) ;Save R5 JSR PC,@(SP)+ ;Call the caller MOV (SP)+,R0 ;Restore R0 MOV (SP)+,R1 ; and R1 MOV (SP)+,R2 ; and R2 MOV (SP)+,R3 ; and R3 MOV (SP)+,R4 ; and R4 MOV (SP)+,R5 ; and R5 RETURN .END