.TITLE MTH_QUAD_ADD Quadword integer addition routine .IDENT /V03.02/ ;++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 ; V03.02 02-Jul-83 FJN Allow for result into input argument; replace ; LOW/HIGH references by autoincrement addressing ; ; 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 ; add1 = 4 ;Offset to address of addend1 quadword add2 = 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 MOVQ @add2(AP),R1 ;addend2 into temporaries MOVQ @add1(AP),(R0) ;sum is addend1 ADDL R1,(R0)+ ;plus low longword of addend2 ADWC R2,(R0) ;plus high longword of addend2 RET .END