Google
 

Trailing-Edge - PDP-10 Archives - BB-P363B-SM_1985 - mcb/cex/b16abs.b16
There are no other files named b16abs.b16 in the archive.
MODULE B16ABS (IDENT = '2-4' %TITLE'B16ABS Absolute and Sign Routines') =
BEGIN

!
!                    COPYRIGHT (c) 1980, 1981, 1982
!                    DIGITAL EQUIPMENT CORPORATION
!                        Maynard, Massachusetts
!
!     This software is furnished under a license and may  be  used
!     and copied only in accordance with the terms of such license
!     and 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.  No  title  to
!     and ownership of the software is hereby transferred.
!
!     The information  in  this  software  is  subject  to  change
!     without  notice  and should not be construed as a commitment
!     by DIGITAL EQUIPMENT CORPORATION.
!
!     DIGITAL assumes no responsibility for the use or reliability
!     of  its  software  on  equipment  which  is  not supplied by
!     DIGITAL.
!

!++
! FACILITY:
!   BLISS-16 Object Time System (OTS)
!
! ABSTRACT:
!   OTS Routines for calculating sign and absolute value.
!
! ENVIRONMENT:
!   PDP-11 or Compatibility Mode of the VAX, EIS and NOEIS
!
! AUTHOR: Don Frank, CREATION DATE: 10-Mar-80
!
! MODIFIED BY:
!
! 0.	19-Apr-77   Paul Dickson	Original creation in Macro
!
! 1.	3-May-79    John Hrones		Create double entry points.
!
! 2.	31-May-79   John Hrones		Correct BLS16C names.
!
! 3.	18-Feb-80	DGF	Move BLISS-11 entry points to B16B11
!
! 4.	10-Mar-80	DGF	Translated to BLISS-16.
!--
!
! TABLE OF CONTENTS:
!

FORWARD ROUTINE
	BL$SGN,			! Sign of a value
	BL$ABS;			! Takes absolute value
GLOBAL ROUTINE BL$SGN(V) =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Determines the sign of a value.
!
! FORMAL PARAMETERS:
!
!	V -- A bliss value.
!
! IMPLICIT INPUTS:
!
!	- None -
!
! IMPLICIT OUTPUTS:
!
!	- None -
!
! ROUTINE VALUE and
! COMPLETION CODES:
!
!	-1 -- If .V lss 0
!	 0 -- If .V eql 0
!	+1 -- If .V gtr 0
!
! SIDE EFFECTS:
!
!	- None -
!
!--

    BEGIN

    SWITCHES NOOPTIMIZE;    ! Prevents CSE creation for V
    REGISTER R = 0;
    
    R = -1;
    
    IF .V LSS 0
    THEN
	RETURN .R;
    
    IF .V NEQ 0
    THEN
	R = .R + 1;
	
    RETURN .R + 1
    
    END;
GLOBAL ROUTINE BL$ABS(V) =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Determines absolute value of the argument.
!
! FORMAL PARAMETERS:
!
!	V -- A BLISS value.
!
! IMPLICIT INPUTS:
!
!	- None -
!
! IMPLICIT OUTPUTS:
!
!	- None -
!
! ROUTINE VALUE and
! COMPLETION CODES:
!
!	 .V -- If .V geq 0
!	-.V -- If .V lss 0
!
! SIDE EFFECTS:
!
!	- None -
!
!--

    BEGIN
    
    RETURN (IF .V LSS 0 THEN -.V ELSE .V)
    
    END;
END				! End of module
ELUDOM