.TITLE MTH_QUAD_SUB Quadword integer subtraction routine .IDENT /V03.01/ ;++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 ; ; 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: ; LOW = 0 ;Offset to low-order longword HIGH = 4 ;Offset to high-ordr longword ; ; Argument offsets ; MINUEND = 4 ;Offset to address of minuend quadword SUBTRAHEND = 8 ;offset to address of subtrahend quadword DIFFERENCE = 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 DIFFERENCE(AP),R0 ;address of difference quadword MOVL SUBTRAHEND(AP),R1 ;address of subtrahend quadword MOVQ @MINUEND(AP),(R0) ;difference is now minuend SUBL LOW(R1),LOW(R0) ;minus low part of subtrahend SBWC HIGH(R1),HIGH(R0) ;minus high part of subtrahend RET ;return to caller .END