Google
 

Trailing-Edge - PDP-10 Archives - FORTRAN-10_V7wLink_Feb83 - numio1.bli
There are 12 other files named numio1.bli in the archive. Click here to see a list.
!THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
!  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.

!COPYRIGHT (C) DIGITAL EQUIPMENT CORPORATION 1976, 1983
! Author: *

MODULE NUMIO(HISEG)=
BEGIN

GLOBAL BIND NUMIOV = 6^24 + 0^18 + 0;		! Version Date: 11-Jun-81

%(

***** Begin Revision History *****

***** End Revision History *****

)%

FORWARD NUMOUT;
EXTERNAL WRITE;
GLOBAL ROUTINE DECOUT(CHNL,WIDTH,VAL)=NUMOUT(.CHNL,.WIDTH,.VAL,10);

GLOBAL ROUTINE OCTOUT(CHNL,WIDTH,VAL)=NUMOUT(.CHNL,.WIDTH,.VAL,8);

GLOBAL ROUTINE BINOUT(CHNL,WIDTH,VAL)=NUMOUT(.CHNL,.WIDTH,.VAL,2);

GLOBAL ROUTINE NUMOUT(CHNL,WIDTH,DATA,BASE)=
%(
       THIS ROUTINE PERFORMS A  NUMERIC-TO-ASCII  CONVERSION  OF  THE
    GIVEN DATA ITEM, WRITING THE VALUE ON THE SPECIFIED CHANNEL. THIS
    IS A SUBSET OF NUMIO0, AND ACCEPTS ONLY ZERO WIDTH SPECIFICATION.
    ANY OTHER WILL BE TREATED AS IF IT WERE ZERO
)%
BEGIN
	LOCAL S;
	IF .DATA LSS 0 THEN (WRITE (.CHNL,"-"); DATA_-.DATA);
	IF .DATA EQL 0 THEN RETURN (WRITE (.CHNL,"0"));
	S_ .DATA MOD .BASE;
	IF (DATA_.DATA/.BASE) NEQ 0 THEN NUMOUT(.CHNL,0,.DATA,.BASE);
	WRITE (.CHNL,.S+"0");
    END;
END ELUDOM