File PRINT.AL

Directory of image this file is from
This file as a plain text file


'PROCEDURE' PRINT(DEV,B,A,X); 'VALUE' DEV,B,A,X;
'REAL' X; 'INTEGER' DEV,B,A;
'IF' B=0 'THEN' RWRITE(DEV,X) 'ELSE'
'BEGIN''INTEGER' I,D,DIGB; 'REAL' SN; 'BOOLEAN' F;
SN:=X; X:=ABS(X);
DIGB:='IF' X=0 'THEN' B 'ELSE' LN(X)/LN(10)+1;
'IF' DIGB>A+B 'THEN'
	'BEGIN' B:=DIGB; A:=0; 'END'
'ELSE''IF' DIGB>B 'THEN'
	'BEGIN' A:=A-(DIGB-B); B:=DIGB;
	'END';
X:=(X+5*10^(-1-A))/10^B; D:=0; F:='FALSE';
'IF' X>=1 'THEN''BEGIN' X:=X/10; B:=B+1;
	'IF' A#0 'THEN' A:=A-1 'END';
'FOR' I:=B 'STEP' -1 'UNTIL' -A+1 'DO'
	'BEGIN' X:=10*(X-D); D:=X;
	'IF''NOT' F 'AND' (I=1 'OR' D#0) 'THEN'
		'BEGIN' F:='TRUE';
		CHOUT(DEV,'IF' SN<0 'THEN' 173 'ELSE' 160);
		'END';
	'IF' F 'THEN' WRITE(DEV,D) 'ELSE' TEXT(DEV," ");
	'IF' I=1 'AND' A>0 'THEN' TEXT(DEV,".");
	'END'
'END' PRINT;


?*U* '



Feel free to contact me, David Gesswein djg@pdp8online.com with any questions, comments on the web site, or if you have related equipment, documentation, software etc. you are willing to part with.  I am interested in anything PDP-8 related, computers, peripherals used with them, DEC or third party, or documentation. 

PDP-8 Home Page   PDP-8 Site Map   PDP-8 Site Search