.TITLE MTH_QUAD_SUB Quadword integer subtraction routine .IDENT /V03.02/ ;++MTHQSUB.MAR ; ; FACILITY: ; Quadword Integer Mathematics subroutines. ; ; ABSTRACT: ; This module contains the quadword integer subtraction routine. ; ; ENVIRONMENT: ; Called from high-level language (FORTRAN or PASCAL) programs. ; User mode. ; ;-- ; ; MODIFICATION HISTORY: ; ; Gotten from Fall 1980 DECUS VAX/VMS SIG tape. ; ; V01.02 21-Aug-81 FJN Commented and names changed. Added QUAD_EMUL. ; V02.00 08-Jun-82 FJN Names changed yet again. ; V03.00 03-Oct-82 FJN Split package into separate modules. ; V03.01 15-Apr-83 FJN Standardize help comments ; V03.02 05-Jul-83 FJN Replace LOW/HIGH by autoincrement addressing; ; allow for sub and diff arguments being same ; ; Copyright (C) 1979 ; Management Science Associates, Inc. ; 5100 Centre Avenue ; Pittsburgh, Pennsylvania 15232 ; ; This software is distributed without cost, and may be ; reproduced only with the inclusion of this copyright ; statement. Management Science Associates assumes no ; responsibility for the performance of this software. ; ; ; EQUATED SYMBOLS: ; ; ; Argument offsets ; min = 4 ;Offset to address of minuend quadword sub = 8 ;offset to address of subtrahend quadword dif = 12 ;Offset to address of difference quadword ; ; Program section for code ; .PSECT _MTH_CODE,PIC,USR,CON,REL,LCL,SHR,EXE,NOWRT,RD .SHOW BINARY .PAGE .SBTTL MTH_QUAD_SUB Subtract two quadword integers ;+ MTH_QUAD_SUB ; Subtract two quadword integers. ; ; CALL MTH_QUAD_SUB( min.rq.r, sub.rq.r, dif.wq.r ) ; ; min quadword with the minuend (from which the subtrahend ; is subtracted). Passed by reference. ; ; sub quadword with the subtrahend. Passed by reference. ; ; dif quadword in which the difference is returned. Passed ; by reference. ; ;- ;+0MTH_QUAD_SUB ; ; FUNCTIONAL DESCRIPTION: ; Subtract two quadword integers and return their difference. ; ; CALLING SEQUENCE: ; CALL MTH_QUAD_SUB(minuend,subtrahend,difference) ; ; INPUT PARAMETERS: ; minuend(AP) address of the minuend quadword ; subtrahend(AP) address of the subtrahend quadword ; ; OUTPUT PARAMETERS: ; difference(AP) address of quadword in which the difference of ; minuend minus subtrahend is returned. ; ;- .ENTRY MTH_QUAD_SUB ^M MOVL dif(AP),R0 ;address of difference quadword MOVQ @sub(AP),R1 ;subtrahend quadword into temps. MOVQ @min(AP),(R0) ;difference is now minuend SUBL2 R1,(R0)+ ;minus low part of subtrahend SBWC R2,(R0) ;minus high part of subtrahend RET .END