Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-06 - 43,50366/recsm7.mac
There are no other files named recsm7.mac in the archive.
		SUBTTL SUBRUTINAS PARA CARACTERES DE CONTROL



         

	REPEAT 0,<SUBRUTINA PARA COMPILAR PARENTESIS IZQUIERDO>

PIZQ:	PUSHJ REC,CSALTO
	PUSH XPD,TEM
	PUSH YPD,[0]
	PUSH ZPD,[0]
	POPJ REC,



	REPEAT 0,<SUBRUTINA PARA COMPILAR PARENTESIS DERECHO>

PDER:	POP XPD,
	PUSHJ REC,CSALTO
	ADDI TEM,1
	POP YPD,AC1
	PUSHJ REC,SV
	PUSHJ REC,SF
	POP ZPD,AC1
	PUSHJ REC,SV
	SKIPN AC1,(XPD)
	JRST FINCO
	POPJ REC,



         REPEAT 0,<SUBRUTINA PARA COMPILAR PUNTO Y COMA>

PC:	MOVE AC1,(ZPD)
	PUSH ACOMP,AC1
	HRRZM ACOMP,(ZPD)
	JRST PDC



         REPEAT 0,<SUBRUTINA PAR COMPILAR PUNTO DOBLE>

PD:	MOVE AC1,(XPD)
	PUSH ACOMP,AC1
PDC:	PUSHJ REC,CSALTO
	HRRZ AC1,(YPD)
	PUSHJ REC,SV
	SETZM (YPD)
	POPJ REC,




         REPEAT 0,<SUBRUTINA PARA LLENAR LA CADENA DE DIRECIONES
                   PENDIENTES DE LLENAR CON LOS SALTOS CORRESPONDIENTES>

SV:	SKIPN AC1,AC1
	POPJ REC,
	MOVEM AC1,TS1
	MOVE AC1,@TS1
	MOVEM TEM,@TS1
	JRST SV





         REPEAT 0,<SUBRUTINA PARA INSERTAR UNA SALIDA FALSA
                   EN LA CADENA DE SALIDAS FALSAS>

SF:	MOVE AC1,(YPD)
	PUSH ACOMP,AC1
	HRRZM ACOMP,(YPD)
	POPJ REC,
SF1:	PUSH ACOMP,AC1
	POPJ REC,



                             
CSALTO:	HRRZ TEM,ACOMP
	ADDI TEM,1
	HRLI TEM,254000
	POPJ REC,

		SUBTTL SUBRUTINAS PARA COMPILAR OPERADORES


         

COMPI:   HLR AC1,TDSC(CHREC)
         HRLI AC1,260740
	JRST SF1



         

PR:      PUSHJ REC,COMPI     
         PUSHJ REC,SF        
         POPJ REC,           



         REPEAT 0,< SUBRUTINA PARA COMPILAR UN OPERADOR CON
                   UNA CADENA DE CARACTERES ASCII COMO ARGUMENTO>

COMPA:	PUSHJ REC,COMPI
	HRRZ AC1,ACOMP
	ADDI AC1,1
	HLL AC1,[POINT 7,,]
	MOVE TEM,CHREC
	ADDI TEM,40
	MOVEI AC2,42
	CAIE TEM,"'"
	MOVEI AC2,"'"
	JRST COMPA2
COMPA1:	PUSHJ REC,LEECA
	IDPB CHREC,AC1
	CAME CHREC,AC2
	JRST .+5
	EXCH AC2,TEM
	PUSHJ REC,COMPA1
	EXCH AC2,TEM
	JRST COMPA1
	CAME CHREC,TEM
	JRST COMPA1
	POPJ REC,
COMPA2:	PUSHJ REC,COMPA1
	CLEAR TEM,
	DPB TEM,AC1
	HRRZM AC1,ACOMP
	POPJ REC,


COMEN:	PUSHJ REC,LEECA
	CAIE CHREC,"]"
	JRST .-2
	JRST TRAECA

SK:     ADDI CHREC,40
        TTCALL 3,CRLF
        TTCALL 1,CHREC
        JRST ERR2




	REPEAT 0,<SUBRUTINA PARA COMPILAR CONTADOR.>

CPCON:	PUSHJ REC,COMPI
	PUSH ACOMP,[0]
	PUSHJ REC,SF
	POPJ REC,

	REPEAT 0,<SUBRUTINA PARA COMPILAR UN NUMERO
	>

COMPNU:	CLEAR AC2,

	PUSHJ REC,COMPI
	PUSHJ REC,RIDEC
	SKIPGE ,AC2
	MOVN TEM,TEM
	PUSH ACOMP,TEM
	POP REC,
	JRST TRAECA+5

RIDEC:	CLEAR AC1,
	ANDI CHREC,17
	ADD AC1,CHREC
	MOVEM AC1,TEM
	IMULI AC1,12
	PUSHJ REC,LEECA
	CAIG CHREC,71
	CAIGE CHREC,60
	POPJ REC,
	JRST RIDEC+1




C.REST:	CLEAR AC2,
	PUSHJ REC,LEECA
	CAIG CHREC,71
	CAIGE CHREC,60
	JRST .+4
	SETO AC2,
	SUBI CHREC,40
	JRST COMPNU+1
	MOVE [PUSHJ REC,RESTA]
	PUSH ACOMP,
	POP REC,
	JRST TRAECA+5


	SUBTTL EJECUCION
         

FINCO:	TRO FLAG,EXEC
	POP REC,
	HRRZ TEM,(YPD)
	HRLZI AC1,263740
	MOVEM AC1,@TEM
	HRLZI AC1,350017
	PUSH ACOMP,AC1
	MOVE AC1,@TEM
	PUSH ACOMP,AC1
	PUSHJ REC,LEECA
	CAIG CHREC,40
	JRST .-2
	CAIN CHREC,"$"
	JRST XEQ
	CAIN CHREC,100
	JRST DP
	JRST ERR3
XEQ:	TTCALL 11,0
	MOVEM ACOMP,SAC+4
	HRLZI ,SAC
	BLT ,14
	TRZ FLAG,EXEC
	HRRZ LEECA
	CAIN ,REA
	TLZ FLAG,S.R
	PUSHJ REC,@APCOM0
	JRST XF
	POP REC,APCOM0
XV:	AOS (REC)
	AOS (REC)
	PUSHJ REC,YECHO
	TRZ FLAG,PARENT
	HRRZ ACOMP,APCOM0
	SUBI ACOMP,101
	HRRZ ,APCOM0
	SUBI ,100
	HRRM ,CSBR.1
	HRRM ,DP.1
	HRRZI ,201
	ADD ,ACOMP
	MOVEM ,JOBFF
	CALLI ,11
	JRST ERR6
	POPJ REC,
XF:	POP REC,APCOM0
	JRST XV+1





	;SUBRUTINA PARA INICIALIZAR EL COMPILADOR

INICOM:	HRRZ ACOMP,JOBFF
	HRRZ AC1,JOBFF
	ADDI AC1,1
	HRRM AC1,CSBR.1
	HRRM AC1,DP.1
	HRRZM AC1,(AC1)
	HRRZI ,TEXTO+WKSIZE
	MOVEM ,LTEXT
	SETZM @LTEXT
	MOVE TEXT1,TEX00
	MOVEM TEXT1,TEXT0
	MOVE TEXT2,TEXT1
	MOVEM TEXT2,TEXT3
	MOVEI XPD,XPDL
	MOVEI YPD,YPDL
	MOVE ZPD,[XWD -17,ZPDL]
	SETZM (XPD)
	SETZM (YPD)
	SETZM (ZPD)
	MOVE ,LOW2
	MOVEM ,PP
	POPJ REC,




CORE:	MOVEI AC1,^D1024
	ADDB AC1,JOBFF
	CALLI AC1,11
	JRST ERR6
	POPJ REC,




		SUBTTL SUBRUTINAS PARA I/O

         

REA:	TLNN FLAG,S.R
	JRST ERR4
         SOSLE IB+2
         JRST ENTRA
         INPUT INCHN,
	STATZ INCHN,740000
	JRST ERR4
	STATZ INCHN,20000
	POPJ REC,
ENTRA:   ILDB CHREC,IB+1
        JUMPE CHREC,REA+2
	AOS ,(REC)
	POPJ REC,



WRI:	TLNN FLAG,S.W
	JRST ERR4
         SOSLE OB+2
         JRST SALE           
         OUTPUT OUCHN,
         STATZ OUCHN,740000
         JRST ERR4           
SALE:    IDPB CHREC, OB+1
	POPJ REC,

REA.1:	ILDB CHREC,QTEXT0
	JUMPE CHREC,CHINP
	AOS (REC)
	POPJ REC,
REA.2:	CAMN TEXT2,TEXTR
	JRST CHINP
	ILDB CHREC,TEXTR
	AOS (REC)
	POPJ REC,

	

O.RD:	TLNE FLAG,S.R
	RELEASE INCHN,0
	PUSHJ REC,F.SP
	SETZM ,O.RI
	MOVE AC1,F.DEV
	MOVEM AC1,O.R1
	MOVEI AC1,IB
	MOVEM AC1,O.RB
	OPEN INCHN,O.RI
	POPJ REC,
	MOVE AC6,JOBFF
	MOVEI AC1,IBUF1
	MOVEM AC1,JOBFF
	INBUF INCHN,2
	MOVEM AC6,JOBFF
	LOOKUP INCHN,F.NAM
	POPJ REC,
	TLO FLAG,S.R
	AOS ,(REC)
	POPJ REC,

	

O.RW:	TLNE FLAG,S.W
	PUSHJ REC,CLOSEF
	PUSHJ REC,F.SP
	MOVEI AC6,1
	MOVEM AC6,O.WI
	MOVE AC6,F.DEV
	MOVEM AC6,O.WD
	MOVSI AC6,OB
	MOVEM AC6,O.WB
	OPEN OUCHN,O.WI
	POPJ REC,
	MOVE AC1,JOBFF
	MOVEI AC6,OBUF1
	MOVEM AC6,JOBFF
	OUTBUF OUCHN,2
	MOVEM AC1,JOBFF
	ENTER OUCHN,F.NAM
	POPJ REC,
	TLO FLAG,S.W
	AOS ,(REC)
	POPJ REC,


	


	

CLOSEF:	TLZN FLAG,S.W
	POPJ REC,
	CLOSE OUCHN,2
	STATZ OUCHN,740000
	JRST ERR4
	RELEASE OUCHN,0
	POPJ REC,

	
F.SP:	SETZM ,F.DEV
	SETZM ,F.NAM
	SETZM ,F.NAM+1
	SETZM ,F.NAM+2
	SETZM ,F.NAM+3
        HRRI AC1,ARGIO
        HLL AC1,[POINT 7, ,]
	HRRI AC6,F.DEV
	HLL AC6,[POINT 6, ,]
F.SPL:	ILDB CHREC,AC1
	CAIN CHREC,":"
	JRST F.SP1
	CAIN CHREC,"."
	JRST F.SP2
	CAIN CHREC,15
	JRST F.SP2
	CAIN CHREC,"["
	JRST F.PPN
	JUMPE CHREC,F.SP2
	SUBI CHREC,40
	IBP ,AC6
	HRRZ TEM,AC6
	CAIE TEM,F.DEV
	JRST F.SP1
	DPB CHREC,AC6
	JRST F.SPL
F.SP1:	HRRI AC6,F.NAM
	HLL AC6,[POINT 6, ,]
	ILDB CHREC,AC1
	CAIN CHREC,"."
	JRST F.EXT
	CAIN CHREC,"["
	JRST F.PPN
	CAIN CHREC,15
	JRST F.SPC
	CAIN CHREC,"["
	JRST F.PPN
	JUMPE CHREC,F.SPC
	SUBI CHREC,40
	IBP ,AC6
	HRRZ TEM,AC6
	CAIE TEM,F.NAM
	JRST F.EXT
	DPB CHREC,AC6
	JRST F.SP1+2
F.EXT:	HRRI AC6,F.NAM+1
	HLL AC6,[POINT 6, ,]
	ILDB CHREC,AC1
	CAIN CHREC,"["
	JRST F.PPN
	CAIN CHREC,15
	JRST F.SPC
	JUMPE CHREC,F.SPC
	SUBI CHREC,40
IIIAAAA>>AAA>						AA@@@@IIIA			``BaQIF*U*81