.TITLE MTH_QUAD_ADD Quadword integer addition routine .IDENT /V03.01/ ;++MTHQADD.MAR ; ; FACILITY: ; Quadword Mathematics subroutines. ; ; ABSTRACT: ; This module adds two quadword integers. ; ; 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 routines. ; V03.01 15-Apr-83 FJN Standardizing 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 ; ADDEND1 = 4 ;Offset to address of addend1 quadword ADDEND2 = 8 ;offset to address of addend2 quadword SUM = 12 ;Offset to address of sum quadword ; ; Program section for code ; .PSECT _MTH_CODE,PIC,USR,CON,REL,LCL,SHR,EXE,NOWRT,RD .SHOW BINARY .PAGE .SBTTL MTH_QUAD_ADD Add two quadword integers ;+ MTH_QUAD_ADD ; Add two quadword integers. ; ; CALL MTH_QUAD_ADD( addend1.rq.r, addend2.rq.r, sum.wq.r ) ; ; addend1 1st quadword to be added. Passed by reference. ; ; addend2 2nd quadword to be added. Passed by reference. ; ; sum quadword in which resultant sum is returned. ; Passed by reference. ;- ;+0MTH_QUAD_ADD ; ; FUNCTIONAL DESCRIPTION: ; Add two quadword integers and return the resulting sum. ; ; CALLING SEQUENCE: ; CALL MTH_QUAD_ADD(addend1,addend2,sum) ; ; INPUT PARAMETERS: ; addend1(AP) address of 1st quadword to be added ; addend2(AP) address of 2nd quadword to be added ; ; OUTPUT PARAMETERS: ; sum(AP) address of quadword in which the sum of addend1 and ; addend2 will be returned. ; ;- .ENTRY MTH_QUAD_ADD ^M<> MOVL SUM(AP),R0 ;address of sum MOVL ADDEND2(AP),R1 ;address of addend2 MOVQ @ADDEND1(AP),(R0) ;sum is addend1 ADDL LOW(R1),LOW(R0) ;plus low longword of addend2 ADWC HIGH(R1),HIGH(R0) ;plus high longword of addend2 RET ;return to caller .END