File: CCLSB3.MA of Disk: V50/Source/Source-Listing-MAC-1
(Source file text) 

/CCL SUBROUTINES 3 FOR KBM V40
/
/
/
/
/
/	CCL SUBROUTINES PART 3
/	VERSION=4B

	.ENTRY LGISUB,LGOSUB,TLKSUB
	.ENTRY VERTN
	.EXTERNAL ERROR,PRINT,PRWD,LEAVE,CRLF
	.EXTERNAL RDMON,LISPRT,VMES,MMES,ZEROCD

	.NOLIST
	.INCLUDE OUT:CCLDEF.MA
	.LIST

IFDEF  GERMAN < PASWRD="B^2+"I^2+"T^2+"T^2+"E^2 / >
IFNDEF GERMAN < PASWRD="P^2+"L^2+"E^2+"A^2+"S^2+"E^2 / >

	ACCRST=7	/GIANT IOT CODE FOR ACCOUNT RESET
	ACCRD=10	/GIANT IOT CODE FOR READ ACCOUNT

	.RSECT CCLSB3
	FIELD 1
	.SBTTL TALK ROUTINE

TLKSUB,	0
	JMS	M8CHK
	CDF 0
	CLA CLL IAC RTL	/4
	GIOT
	BEGLN		/PREPARE FUTURE
	CLA
	CDF 10
	JMP I	TLKSUB

M8CHK,	0
	SM8		/IS MULTI8 ENABLED?
	JMS I	(ERROR
	27.		/#Only under Multi8
	CLA
	JMP I	M8CHK

LGOSUB,	0
	SM8
	SKP CLA
	JMS I	(BILL	/TELL HIM HOW MUCH TIME HE USED
	JMS I	(NOBATC	/KILL BATCH IF RUNNING
	JMS I	(SUBMIT
	.+2
	JMP I	LGOSUB
	FILENAME LOGOUT.BI

LGISUB,	0
	JMS I	(NOBATC	/KILL BATCH IF RUNNING
HELLO1,	CLA		/USER TRAP ADDRESS
	JMS I	(CRLF
	TAD	(HELLO1		/ADD	NORM	TRAP
	CDF 0			/7600	4207	JMP 7605
	DCA I	(7602		/7601	5000	5000
	TAD	(7605&177+5200	/7602	0000	HELLO1
	DCA I	(7600		/7603	0033	0033
	TAD	(7602&177+5600	/7604	7602	7602
	DCA I	(7606		/7605	6203	6203
	CDF 10			/7606	5267	JMP I 7602
	CLA STL RTL	/NO ECHO = 2
	GIOT
	JMS I	(PRINT	/PRINT CLEARS AC
	PASMES
	DCA	T
GETLOP,	JMS I	(GET	/GET CHAR FROM KB
	TAD	(-215
	SNA
	 JMP	GOTNAM
	TAD	(215
	TAD	T
	CLL RAL
	DCA	T	/BUILD PASSWORD
	JMP GETLOP
GOTNAM,	TAD	T
	TAD	(-PASWRD
	SZA CLA
	 JMP HELLO1	/NO GOOD, TRY ON AND ON
	CDF 0		/OK, REMOVE TRAP
	TAD	(4207
	DCA I	(7600
	DCA I	(7602
	TAD	(5267
	DCA I	(7606
	CDF 10
	TAD	(ACCRST
	GIOT		/RESET ACCOUNT INFO
	CLA IAC STL RAL	/ECHO = 3
	GIOT
	CLA		/CLEAR AC
	JMS I	(CRLF
	JMS I	(VERTN	/VERSION MESSAGE
	JMS I	(SUBMIT
	.+2
	JMP I	LGISUB
	FILENAME LOGIN.BI

	PAGE
BILL,	0		/TELL THE USER HOW MUCH TIME HE USED
	TAD (ACCRD
	6770		/THIS GETS THE TIME IN AC,MQ
	DCA	T	/HIGHORDER TIME
	MQA
	DCA	TT	/LOWORDER TIME
	JMS	DVI
	 10.			/THROW OUT .1 SECS
	JMS	DVI
	 60.
	DCA	SECOND
	MQA
	DCA	SECOND+1
	JMS	DVI
	 60.
	DCA	MINUTE
	MQA
	DCA	MINUTE+1
	JMS	DVI
	 24.
	DCA	HOUR
	MQA
	DCA	HOUR+1
	JMS	DVI
	 100.			/SOME LARGE NUMBER
	DCA	DAY
	MQA
	DCA	DAY+1
	JMS I	(PRINT
	CPUMES
	JMP I BILL	/RETURN
.NOLIST BE
.ENABLE ASCII

PASMES,
.IF NDF GERMAN < TEXT /Password ? _/ >
.IF DF GERMAN  < TEXT /Passwort ? _/ >

.DISABLE FILL

CPUMES,
.IF NDF GERMAN < TEXT /CPU-time used : / >
.IF DF GERMAN  < TEXT /CPU-Rechenzeit: / >
DAY,
.IF NDF GERMAN < TEXT /00 days, / >
.IF DF GERMAN  < TEXT /00 Tage, / >
HOUR,
.IF NDF GERMAN < TEXT /00 hours, / >
.IF DF GERMAN  < TEXT /00 Stunden, / >
MINUTE,
.IF NDF GERMAN < TEXT /00 minutes, / >
.IF DF GERMAN  < TEXT /00 Minuten, / >
SECOND,
.IF NDF GERMAN < TEXT /00 seconds. / >
.IF DF GERMAN  < TEXT /00 Sekunden. / >
	0000
.ENABLE FILL
.LIST BE
	PAGE
DVI,	0		/DEVIDE HTIME,LTIME BY PARAMETER
	CLA
	TAD I	DVI	/GET PARAMETER
	ISZ	DVI	/ADJUST RETURN
	DCA	DIV$
	DCA	QUOH$
	DCA	QUOL$
DIVL$:	TAD	DIV$
	CLL CIA
	TAD	TT
	DCA	TT
	SNL		/TEST BORROW
	 CLL CMA
	TAD	T
	DCA	T	/END OF SUBSTRACT
	SNL		/UNDERFLOW ?
	 JMP	DVEND$	/YES
	ISZ	QUOL$	/NO
	 JMP	DIVL$
	ISZ	QUOH$
	JMP	DIVL$
DVEND$:	TAD	TT
	TAD	DIV$
	DCA	DIV$	/REMAINDER
	TAD	QUOL$	/YES, RESTORE L,HTIME
	DCA	TT
	TAD	QUOH$
	DCA	T
	DCA	QUOL$
	TAD	DIV$	/THAT'S THE RESULT
	TAD	(-12
	ISZ	QUOL$
	SMA
	JMP	.-3
	TAD	("0+12
	MQL		/LO NUMBER
	STA
	TAD	QUOL$
	SNA
	TAD	(" -"0
	TAD	("0	/HI NUMBER
	JMP I	DVI
DIV$:	0
QUOL$:	0
QUOH$:	0
SUBMIT,	0
	TAD I	SUBMIT
	ISZ	SUBMIT
	DCA	LGIONM
	TAD	(-5	/ZERO OPTIONS TOO
	JMS I	(ZEROCD
	CLA STL RAR	/SET ALT-MODE
	DCA I	(MPARAM-1
	TAD	(20	/SET HUSH
	DCA I	(MPARAM
	TAD	CCLDEV
	JMS I	(USR
	2		/LOOKUP ON CCL-DEVICE
LGIONM,	0
	0
	JMP	SUBERR
	TAD	CCLDEV
	DCA I	(MIFILE
	TAD	LGIONM
	DCA I	(MIFILE+1
	JMP I	SUBMIT
SUBERR,	TAD	('*.
	JMS I	(PRWD
	TAD	('BI
	JMS I	(PRWD
	JMS I	(ERROR	/ not found
	6.

GET,	0
	KSF
	JMP .-1
	KRB
	AND (177
	TAD (-140
	SMA
	TAD (-40
	TAD (340
	JMP I GET

NOBATC,	0
	CDF 0
	CLA CLL CMA RTR	/5777
	AND I (7777
	DCA I (7777	/KILL BATCH IF RUNNING
	CDF 10
	JMP I	NOBATC
	PAGE
	.SBTTL VERSION COMMAND

VERTN,	0
	JMS I	(LISPRT
	0		/READ OVERLAY
	JMS I	(RDMON	/READ MONITOR
	CDF 0
	TAD I	(2031	/GET PATCH LEVEL
	CDF 10
	DCA I	(VMES+17
	CDF 0
	TAD I	(2000	/GET VERSION #
	CDF 10
	SPA
KK7600:	7600		/"0" MEANS OLD
	TAD	(260
	DCA I	(VMES+16
	SM8		/SKIP ON MULTI8
	JMP	N8$
	TAD	(240
	DCA I	(MMES-1	/HANG ON MULTI8 PART
	CLA IAC
	GIOT		/GIANT IOT #1
	JMS	VCONV
	TAD	("0	/BACKGROUND NUMBER
	DCA I	(MMES+52
	MQA
	TAD	("0	/TERMINAL NUMBER
	DCA I	(MMES+32
	TAD	(12
	GIOT		/GIANT IOT #12
	JMS	VCONV
	DCA I	(MMES+13	/VERSION
	MQA
	TAD	(100
	DCA I	(MMES+14	/PATCH
N8$:	JMS I	(PRINT
	VMES		/Version Message
	JMP I	VERTN

VCONV,	0
	MQL
	MQA
	AND	(77
	SWP
	BSW
	AND	(77
	JMP I	VCONV