
FORTRAN II - TAPE 5 INPUT CONVERSION ROUTINES

EXP2=COMMON

GETNUM,	CLC
	DAC FLT#SWT

GET1,	GETDEC
	CLA
GET2,	UNPACK
	JMP GET3
	SAD (CHAR R.
	JMP DFPOIN
	SAD (CHAR RE
	JMP DFEX
GET3,	ISZ FLTSWT
	JMP GET4
	LAC I2
	DAC COMMON
	CLA
	EXIT

GET4,	LAC (DECIMAL 53 OCTAL
	NORMA+1
	LAC JCNT
	JMP TERM

DFPOIN,	ISZ FLTSWT
	JMP TERM
	DZM J#CNT
	GETDGM
	NOP
	JMP GET2

DFEX,	LAC (DECIMAL 53 OCTAL
	NORMA+1
	CLA
	ISZ FLTSWT
	LAC JCNT
	DAC EXP10
	IDXCHR
	LAC (FLEX  +
	CHKNXT
	JMP DFEXM

DFEXP,	GETDEC
	CLA
	CMA
	TAD (1
	JMP DFEX1

DFEXM,	LAW CHAR R-
	CHKNXT
	JMP DFEXP
	GETDEC
	CLA
DFEX1,	TAD #EXP10

/INPUT CONVERSION - PAGE 2

TERM,	CMA
	TAD (1
	DAC EXP10

TERMC,	SNA
	JMP DONF
	SMA
	JMP TERMP

TERMM,	MULTAD	R0	OTEN0	I1
	MULTAD	R0	OTEN1	I2
	MULTAD	R1	OTEN0	I2
	MULTAD	R1	OTEN1	I3
	MULTAD	R2	OTEN0	I3
	LAM -2
	NORMA
	ISZ EXP10
	JMP TERMM
	JMP DONF

TERMP,	CMA
	TAD (1
	DAC EXP10

TERMP1,	MULTAD	R0	TEN	I1
	MULTAD	R1	TEN	I2
	MULTAD	R2	TEN	I3
	LAC (4
	NORMA
	ISZ EXP10
	JMP TERMP1
	JMP DONF

MULTAD,	DSPARA
	LAC PARA 3
	DAC M#ULT1
	LAC PARA 2
	DAC M#ULT0
	LAC I PARA 1
	MPY
	LAC I MULT0
	CLL
	TAD I MULT1
	DAC I MULT1
	LAC MP5
	SZL!CLL
MULTD1,	TAD (1
	ISZ MULT1
	TAD I MULT1
	DAC I MULT1
	SZL!CLA!CLL
	JMP MULTD1
	EXIT3

/INPUT CONVERSION - PAGE 3


MOVER,	DSPARA
	LAC I2	DAC I PARA 1	ISZ PARA 1
	LAC I1	DAC I PARA 1	ISZ PARA 1
	LAC I0	DAC I PARA 1
	CLEARI
	EXIT1
CLEARI,	DZM I0
	DZM I1
	DZM I2
	DZM I3
	EXIT

NORMA,	TAD EXP2
	DAC EXP2
	LAC I2
	ADD I1
	ADD I0
	SNA
	JMP NORMZ

NORM1,	LAC I0
	RAL
	SPA!CLC
	JMP NORMZ+1
	TAD EXP2
	DAC EXP2
	LAC I2	RCL	DAC I2
	LAC I1	RAL	DAC I1
	LAC I0	RAL	DAC I0
	JMP NORM1

NORMZ,	DZM EXP2
	MOVER	R2
	EXIT

/INPUT CONVERSION - PAGE 4

DONF,	XCT WSIZE
	JMP DONF3
	LAC EXP2
	RAL9
	AND (777000
	DAC EXP2
	LAC R0
	RAR8
	AND (777
	XOR EXP2
	DAC EXP2
	LAC R0
	RAL9
	AND (377000
	DAC COMMON 1
	LAC R1
	RAR9
	AND (777
	XOR COMMON 1

DONF1,	DAC COMMON 1
	LAC (1
	EXIT

DONF3,	LAC R1
	DAC COMMON 2
	LAC R0
	JMP DONF1

/INPUT CONVERSION - PAGE 5

/18+18@36 MULTIPLY

MPY,	DAC MP#1
	DZM MP#5
	SNA
	EXIT1
	DSPARA
	XCT PARA 1
	DAC MP#2
	SNA
	EXIT1
	LAM -22
	DAC TEMCNT

MP4,	LAC MP1
	RAR
	ISZ TEMCNT
	SKP
	EXIT1
	DAC MP1
	LAC MP5
	SZL!CLL
	TAD MP2
	RAR
	DAC MP5
	JMP MP4

/INPUT CONVERSION - PAGE 5

/GET AN OCTAL OR DECIMAL INTEGER

GETOCT,	LAC (10)
	SKP

GETDEC,	LAC (12
	DAC C#TEN
	CLEARI
	DZM JCNT
	LAC (EXIT

GETDG1,	DAC GETDGX 1
	UNPACK
	JMP GETDGX
	DIGIT
	JMP GETDGX
GETDGM,	IDXCHR
	LAC (EXIT1
	JMP GETDG1

GETDGX,	LAC I2
	XX

DIGIT,	SAD (20
	CLA
	DAC MP5
	TAD (-11
	SMA
	EXIT
	LAC I0
	AND (760000
	SZA
	EXIT1
	ISZ JCNT
	MOVER	INT2
	LAC MP5
	DAC I2
	MULTAD	CTEN	INT2	I2
	MULTAD	CTEN	INT1	I1
	MULTAD	CTEN	INT0	I0
	EXIT1

/INPUT CONVERSION - PAGE 6

/DATA STORAGE

OTEN0,	631463
OTEN1,	146315
TEN,	500000
I3,	0
I2,	0
I1,	0
I0,	0
R2,	0
R1,	0
R0,	0

INT2,	0
INT1,	0
INT0,	0

START
