File LOGPROG

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

*20
/
/
/ROUTINE TO CALCULATE COMMON LOG (BASE 10)
/USES POLYNOMIAL APPROXIMATION
/
	 
	LMODE
	SEGMNT 5
	 
	*20
	 
	LIF 4
	MESOUT
	MLOG		/PROGROM TO CONVERT TO LOG(10)
	 
BEG,	LIF 4
	INTRACT
	CJ0
	M0		/:
	 
CJ0,	T0
	J0
	 
T0,	0
	 
J0,	JMP BEG		/CR
	JMP .+1		/0
	 
	JMP LOG
	 
	JMP QUES	/ERROR
	SETWRD		/OK
	1245
	OUTPUT
	OUTNUM
	 
	LIF 4
	MESOUT
	MOUT
	JMP BEG
	 
LOG,	STORE
	TEM		/X
	SET 3
	0
/CHECK IF X=0
	FAZE
	SKP
	JMP 3		/ERROR RETURN
/
	ADD TEM		/EXPONENT
	ADA I
	-1		/DIV BY 2
	STC EXP
	STC TEM		/CLR EXPONENT
	LOAD
	TEM
	FMUL
	FP2		/1<X<10
/
/CALCULATE X DEPENDENT FACTOR IN 
/POLYNOMIAL APPROXIMATION
/
	STORE
	TEM
	FADD
	SQRT10
	STORE
	XFAC
	LOAD
	TEM
	FSUB
	SQRT10
	FDIV
	XFAC
	STORE
	XFAC
/
/DO POLYNOMIAL APPROXIMATION
/
	LOAD
	C5
	JMP MULT
	FADD
	C3
	JMP MULT
	FADD
	C1
	JMP MULT+2
	FADD
	FHALF
	STORE
	TEM
/
/ADD IN EXPONENT AS MULTIPLE OF LOG 2
	SFLOAT
	EXP
	FMUL
	LOG2		/LOG(10) 2
	FADD
	TEM
	XSK I 3
	JMP 3
/
MULT,	FMUL
	XFAC
	FMUL
	XFAC
	JMP 0
/
/
TEM,	0
	0
	0
XFAC,	0
	0
	0
LOGE,	7776		/.4342945
	3362
	6756
LOG2,	7776		/.3010
	2320
	7126
FP2,	2		/2
	2000
	0
FP10,	4		/10
	2400
	0
FHALF,	0
	2000
	0
C5,	7776		/.2543275
	2021
	5633
C3,	7776		/.2773839
	2160
	1242
C1,	0		/.8690286
	3363
	6125
SQRT10,	2		/SQUARE ROOT 10
	3123		/3.16227766
	0540
EXP,	0
	 
MLOG,	TEXT &PROGRAM TO CONVERT TO LOG(10) &
	4543
M0,	7200
MQUES,	TEXT &??&
	4543
MOUT,	TEXT &LOG = &
OUTNUM,	0
	0
	0
	0
	0
	4543
	 
QUES,	LIF 4
	MESOUT
	MQUES		/??
	JMP BEG
	 
/PBLOCK FOLLOWS
	 
	NOLIST
	 
//PBLOCK
/PARAMETER BLOCK ASSIGNMENTS
/
	P0=3400		/DATA TYPE
	P1=3401		/CURRENT CHAN.
	P17=3417	/NO.SAMP IN SEG
	P20=3420	/NO.SEG IN ENSM
	P102=3602	/MAX Y VALUE
	P103=3605	/MIN Y VALUE
/
/
/COMMAND DECODER ASSIGNMENTS
/
/
	STOP=JMP 20
	STORIT=JMP 23
	GETFIL=JMP 24
	ASSIGN=JMP 30
	DEASS=JMP 31
	INTRACT=JMP 42
	MESOUT=JMP 43
/
/COMMAND LOCATIONS.
/
	FILNAM=2320
	WORD1=2323
	WORD2=2324
	INBUF=2325
	 
/COMMAND NUMBERS.
	 
	NO=20
	GO=23
	NEXT=24
	CU=25
	B=32
	C=33
/
/EXEC3 ASSIGNMENTS
/
	OPR=500
	 
/FLOATING POINT DEFINITIONS.
/
	FAC=0
	FSUB=741
	FMUL=742
	FDIV=743
	LOAD=744
	STORE=745
	SETWRD=746
	INPUT=747
	OUTPUT=750
	ISTOR1=751
	SQRT=752
	SFLOAT=754
	DFLOAT=753
	FIX=755
	FADD=756
	ISTOR2=757
	FCOMP=761
	FZER=762
	FAPO=763
	FAZE=764
	RECIP=765
/
/
/PBLOCK
/JUNE 73
	 
	LIST
	 
	 
	 
/
/END SUBROUTINE LOG



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