File: EDITOR.PA of Disk: Disks/Working/MyProgs-22-04-07
(Source file text) 

/EDIT HANDLER
/
/
/
/
/
/
/
/
/
/COPYRIGHT  (C)  2013 W. VAN DER MARK (WVDMARK)
/
/
/
/
/
/
/
/
/
/
/THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT NOTICE
/AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY WVDMARK. WVDMARK 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 WVDMARK'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH
/SYSTEM, EXCEPT AS MAY OTHERWISE BE PROVIDED IN WRITING BY WVDMARK.
/
/WVDMARK ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS
/SOFTWARE ON EQUIPMENT THAT IS NOT SUPPLIED BY WVDMARK.
/
/
/
/
/
/
/
/
/
/
		EJECT EDITOR HANDLER VERSION A

/EDIT HANDLER

PSXX=6660	/EDOU LIKE PTP
PSKF=6661
PCLF=6662
PSKE=6663
PSTB=6664
PSIE=6665
PCLP=6666
PCIE=6667

DBST=6570	/LA180 LINEPRINTER, SKIP OUT AND CLEAR
DBSK=6571	/SKIP IN READY
DBRD=6572	/READ DATA IN
DBCF=6573	/CLEAR IN READY AND READ
DBTD=6574	/WRITE DATA OUT
DBSE=6575	/INT ENA
DBCE=6576	/INT DIS
DBSS=6577	/STROBE OUT

        *0
        -2
DEVICE EDIT;DEVICE EDOU;1430;EDO&177;ZBLOCK 2
DEVICE EDIT;DEVICE EDIN;2440;EDI&177;ZBLOCK 2


        VERSION="A&77


        *200
EDO,    VERSION
        CLA CLL CML     /SET LINK ON TO INDICATE PUNCH
        JMS ESETUP      /DO COMMON CRAP
EDOLP,  TAD I EDOCA
        JMS EDOPCH      /FIRST CHAR IN LOW ORDER 8 BITS OF WORD 1
        DCA EDI
        ISZ EDOCA
        TAD I EDOCA
        JMS EDOPCH      /SECOND CHAR IN LOW ORDER 8 BITS OF WORD 2
        CLL RTR
        RTR
        TAD EDI
        RTR
        RTR             /THIRD CHARACTER NOW IN AC
        JMS EDOPCH
EDOEND, ISZ EDOCA
ED70,   70              /JUST IN CASE WERE PUNCHING PG 7600
                        /KEEP THIS LITERAL HERE
        KSF
        JMP EDOISZ      /KEYBOARD FLAG OFF - DON'T WORRY ABOUT ^C
EDOKRS, KRS
EDO232, AND EDO177
        TAD EDOM3
        SZA CLA         /IS THERE A ^C IN THE TTY BUFFER?
        JMP EDOISZ      /NO
EDOCIF, CDF CIF 0
        JMP I ED7600
EDO177, 177


ESETUP, 0
        RDF             /GET FIELD OF CALLING PROGRAM
        TAD EDOCIF
        DCA EDOXIT      /SET UP RETURN SEQUENCE
        TAD I EDO
        AND ED70
        TAD EDPCDF
        DCA EDOCDF
        RAR             /GET LINK(1=EDO,0=EDI)
        TAD I EDO       /GET FUNCTION WORD
        ISZ EDO
        SPA             /CHECK CORRECT MODE
        JMP EDOERR      /SIGNAL "UNRECOVERABLE DEVICE ERROR"
        AND ED7700
        CMA             /SET UP -(WORD COUNT)/2-1
        DCA EDOWC
        TAD I EDO       /SET UP STARTING ADDRESS
        ISZ EDO
        DCA EDOCA
        TAD I EDO
EDOCDF, 0               /SET DATA FIELD TO ACCESS BUFFER
        EDOEOF=EDOCDF
        SZA CLA
        JMP EDOKRS
        SNL CLA
        JMP EDOKRS
EDOCLR,	PSXX		/CLEAR LINE PRINTER OUTPUT
        PSKF
        JMP .-1
EDOISZ, ISZ EDOWC
        JMP I ESETUP    /LOOP FOR BUFFER SIZE (128 WORDS)
EDORTN, TAD EDOEOF
        SZA CLA         /DID WE RUN OUT OF TAPE?
        ISZ EDO
        ISZ EDO
EDOXIT, HLT             /EXIT CDF GOES HERE
        JMP I EDO

EDOPCH, 0
	DCA EDIGCH
	TAD EDIGCH
	SNA
	JMP I EDOPCH	/IGNORE NULLS
	AND EDO177
	TAD EDM177	/TEST FOR RUBOUT
	SZA CLA		/IGNORE THEM ALSO
	TAD EDO377
	TAD ED7400
	AND EDIGCH
        PCLP            /NOTICE THE GLORIOUS LACK OF OVERLAP
        PSKF
        JMP .-1
        AND ED7400
        JMP I EDOPCH


EDI,    VERSION         /*** CORRECT ENTRY IN MAIN ASSEMBLY IF THIS IS MOVED!
        CLA CLL		/CLEAR LINK FOR INPUT
        TAD EDI
        DCA EDO
        JMS ESETUP      /SET UP ADDRESS, COUNT, FIELDS
EDILP,  JMS EDIGCH      /READ FIRST CHARACTER OF 3
        DCA I EDOCA
        JMS EDIGCH
        DCA EDOPCH
        JMS EDIGCH
        RTL
        RTL
        AND ED7400
        TAD I EDOCA
        DCA I EDOCA     /HIGH ORDER 4 BITS INTO WORD 1
        TAD EDI         /GET THE CHAR FROM THE EDI BUFFER
        BSW
        RTL             /PUT THE LOW ORDER BITS INTO AC 0-3
        AND ED7400
        TAD EDOPCH
        ISZ EDOCA
ED7400, 7400
        DCA I EDOCA     /LOW ORDER 4 BITS INTO WORD 2
        JMP EDOEND

EDIGCH, 0
        TAD EDOEOF
ED7700, SMA CLA		/INITIALIZED WITH 62X1
        JMP EDIEXI	/MAKE SURE BUFFER IS ZEROED
        DBCF		/WAS RRFC
        DBSK		/WAS RSKF
        JMP .-1		/READER NOT READY - CHECK TIMING
        DBRD		/WAS RRRB - READER READY - READ CHAR
	SPA
	JMP ED7600	/END OF FILE
EDIEXI,	DCA EDI
	TAD EDI
        JMP I EDIGCH    /AND RETURN
EDOERR, CLA CLL CML RAR /SIGNAL A "PERMANENT I/O ERROR" ON THE DEVICE
        JMP EDOXIT-2

ED7600,	7600		/ALSO CLEARS AC
	DCA EDOEOF
        TAD EDO232      /SEND ^Z TO BUFFER
	JMP EDIEXI

EDM177,	-177
EDO377,	377
EDPCDF, CDF 0
EDOM3,  -3
EDOWC,  0
EDOCA,  0