/
/
/
/COPYRIGHT  (C)  1979 BY DIGITAL EQUIPMENT CORPORATION
/
/
/
/THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT NOTICE
/AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
/CORPORATION.  DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY
/FOR ANY ERRORS THAT MAY APPEAR IN THIS DOCUMENT.
/
/THE SOFTWARE DESCRIBED IN THIS DOCUMENT IS FURNISHED TO THE PURCHASER
/UNDER A LICENSE FOR USE ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED
/(WITH INCLUSION OF DIGITAL'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH
/SYSTEM, EXCEPT AS MAY OTHERWISE BE PROVIDED IN WRITING BY DIGITAL.
/
/DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY FOR THE USE
/OR RELIABILITY OF ITS SOFTWARE ON EQUIPMENT THAT IS NOT SUPPLIED BY
/DIGITAL.
/
/
/


/VERSION=V3A (D.H.)
/1	CCL RECOLLECTION ROUTINES

	.EXTERNAL REMD,SCAN,LBEGIN,BEGLN,PRMESG,PRINT

	DATWD=7666
	CLXR=35
	XR=16

	.ENTRY REMEM,FOREVER,RECALL
	.RSECT CCLREM
	FIELD 1

/CCL REMEMBERS UP TO 8 COMMAND LINES (EACH UP TO 55 DECIMAL
/SIXBIT CHARACTERS LONG) IN BLOCK 65 ON THE SYSTEM DEVICE.
/THIS BLOCK WHEN READ INTO 04000-04377 HAS THE FOLLOWING FORMAT:

/4000-4037	REM-LINE 0
/4040-4177	REM-LINE 1
/4100-4137	REM-LINE 2
/4140-4177	REM-LINE 3
/4200-4237	REM-LINE 4
/4240-4277	REM-LINE 5
/4300-4337	REM-LINE 6
/4340-4377	REM-LINE 7

/EACH REM-LINE HAS THE FOLLOWING FORMAT:

/WORD 0:	IN-USE FLAG, MUST BE '1234' TO INDICATE LINE WAS REMEMBERED HERE
/WORD 1:	DATE LINE WAS REMEMBERED
/WORD 2:	COMMAND DEPENDENT INFORMATION
/WORD 3:	RESERVED FOR FUTURE EXPANSION
/WORDS 4-37	COMMAND LINE NOT INCLUDING KEYWORD OR FOLLOWING SPACES
/		PACKED IN 6-BIT AND TERMINATED BY A 6-BIT 0.

/ROUTINES:

/	TAD (DEP
/	JMS REMEM
/	N

/REMEMBERS CURRENT LINE IN REM-LINE N.  AC IS LINE DEPENDENT INFORMATION.
/IF LINE IS TOO BIG, THIS PRINTS A WARNING MESSAGE AND RETURNS AS IF OK.

/	JMS RECALL
/	N

/RECALLS REM-LINE N INTO BUFFER
/IF NOTHING THERE, PRINTS A BAD SYNTAX MESSAGE AND RETURNS TO OS/8.
/UPON RETURN, LINE-DEPENDENT INFO IS IN AC.
/IF DATES DON'T MATCH, IT'S NOT THERE UNLESS DATE = -1

/0	USED BY TECO, MAKE COMMANDS
/1	USED BY EDIT, CREATE COMMANDS
/2	USED BY COMPILE, EXECUTE COMMANDS & PAL.
/	DEPENDENT WORD IS PTR TO FIRST ENTRY IN MAIN TABLE

/3	USED BY 'UA' COMMAND
/4	USED BY UB
/5	USED BY UC

/	JMS FOREVER

/CAUSES NEXT CALL TO REMEM TO INSERT -1 AS DATE
	REMSPACE=4000
	REMBLOCK=65

REMEM,	0
	DCA DEP
	TAD I (REMD
	SMA CLA
	JMP I REMEM	/DON'T REMEMBER IF JUST RECALLED
	JMS I (RDREM
	JMP I (MEMBIG
	TAD I REMEM
	ISZ REMEM
	CLL RTL
	RTL
	RAL		/MULTIPLY BY 40
	TAD (REMSPACE
	DCA LPTR
	TAD (1234
	CDF 0
	DCA I LPTR
	CDF 10
	ISZ LPTR
FORVR,	TAD I (DATWD	/REPLACED BY CMA IF WANT NO DATE
	JMS LPUT	/STORE DATE
	TAD DEP
	JMS LPUT	/STORE DEPENDENT INFO
	JMS LPUT	/RESERVED
	JMS I (SCAN	/GO PAST KEYWORD AND BLANKS
	TAD I (LBEGIN
	DCA XR
L$:	JMS I (GETF
	JMP 3$
	JMS I (ROTL
	DCA TML
	JMS I (GETF
	JMP 2$
	TAD TML
	JMS LPUT
	JMP L$
2$:	TAD TML
3$:	JMS LPUT
	JMS I (WRREM
	JMP I (MEMBIG
REMGO,	JMP I REMEM
DEP,	0
LPTR,	0		/PTS TO REM-LINE
TML,	0		/TEMP

/PUT INTO REM-LINE

LPUT,	0
	DCA TML
	TAD LPTR
	AND (37
	SNA CLA
	JMP I (MEMBIG
	TAD TML
	CDF 0
	DCA I LPTR
	CDF 10
	ISZ LPTR
	JMP I LPUT

FOREVER,0
	TAD LCMA
	DCA FORVR
	JMP I FOREVER	/NON-ZERO MEANS SET DATE TO -1
RECALL,	0
	JMS I (RDREM
	JMP I (REMERR
	TAD I RECALL
	ISZ RECALL
	JMS I (ROTL
	RAR
	TAD (REMSPACE
	DCA LPTR
	JMS LGET
	TAD (-1234
	SZA CLA
	JMP I (REMER2
	JMS LGET
	SNA
	JMP I (REMER2
LCMA,	CMA
	SNA
	JMP 1$
	IAC
	TAD I (DATWD	/SAME DAY?
	SZA CLA
	JMP I (REMER2
1$:	JMS LGET
	DCA DEP
	JMS LGET	/IGNORE RESERVED WORD
	CLA
	TAD (BEGLN-1
	DCA XR
	TAD (BEGLN-1
	DCA I (LBEGIN
L$:	JMS LGET
	DCA TML
	TAD TML
	JMS I (ROTL
	RAL
	JMS I (PUTF
	JMP LV$
	TAD TML
	JMS I (PUTF
	JMP LV$
	JMP L$

LV$:	TAD DEP
	JMP I RECALL
LGET,	0
	CDF 0
	TAD I LPTR
	CDF 10
	ISZ LPTR
	JMP I LGET
	PAGE
PUTF,	0
	AND (77
	SNA
	JMP PUTZ
	ISZ PUTF
	TAD (240
	AND (77
	TAD (240
PUTZ,	CDF 0
	DCA I XR
	CDF 10
	JMP I PUTF

REMERR,	JMS I (PRMESG
	REMBAD
REMER2,	JMS I (PRMESG
	BADREM
MEMBIG,	CLA
	JMS I (PRINT
	MEMWARN
	JMP I (REMGO

RDREM,	0
	CIF 0
	JMS I (7607
	200		/READ 2 PAGES INTO FIELD 0
	4000		/LOCATION 4000
	REMBLOCK
	SKP CLA
	ISZ RDREM
	JMP I RDREM

WRREM,	0
	CIF 0
	JMS I (7607
	4200		/WRITE 2 PAGES FROM FIELD 0
	4000		/LOCATION 4000
	REMBLOCK
	SKP CLA
	ISZ WRREM
	JMP I WRREM
/GET FROM INPUT LINE VIA XR

GETF,	0
	CDF 0
	TAD I XR
	CDF 10
	SZA
	ISZ GETF
	AND (77
	JMP I GETF
ROTL,	0
	CLL RTL
	RTL
	RTL
	JMP I ROTL

MEMWARN,TEXT	/%CAN'T REMEMBER/
REMBAD,	TEXT	\#I/O ERROR TRYING TO RECALL\
BADREM,	TEXT	/#BAD RECOLLECTION/
	PAGE

