LEX 'SECURELX' TITLE Enhanced (UN)SECURE; J.J. Moreau JPC#31 CON(2) 1 CON(2) 79 CON(2) 79 REL(5) SEC/U NIBHEX F * * Since the tokens for SECURE and * UNSECURE are not consecutive, we must * use two linked LEX files. Therefore, we cannot use * the usual pseudo-ops. This allows us to use common * code / subroutines * REL(4) (Tx00)+1 CON(4) 0 CON(5) 0 CON(3) 0 REL(5) Secure CON(1) 13 Tx00 CON(1) 11 NIBASC 'SECURE' CON(2) 79 NIBHEX 1FF * ************************ * * EQUates Table * BSERR EQU #0939A CNFFND EQU #109AC CURRST EQU #2F55D EOLCK EQU #02A7E EOLXCK EQU #05405 FILSK+ EQU #06F1D FINDF+ EQU #09F63 FSPECe EQU #02F02 FSPECp EQU #03CC5 FSPECx EQU #09F2D LOCADR EQU #0A611 MAINST EQU #2F558 NXTSTM EQU #08A48 POLL EQU #12337 PURGDC EQU #05745 RAMROM EQU #0A5F7 RESPTR EQU #03172 ROMCID EQU #00BFE ROMFND EQU #1102F S-R0-0 EQU #2F871 S-R0-1 EQU #2F876 S-R0-2 EQU #2F87B S-R0-3 EQU #2F880 eDVCNF EQU #00040 eFACCS EQU #0003C lFNAMh EQU #00010 lFTYPh EQU #00004 oFLENh EQU #00020 pFPROT EQU #0000B tALL EQU #000F8 tKEYS EQU #000CF ENDTXT * * * Decompile routine for revised statements: * UN/SECURE [filename][:devId/ALL/keys] * Secp GOSBVL EOLCK UN/SECURE followed by EOL? GONC Secp10 no Resptr GOVLNG RESPTR yes, nothing to add Secp10 GOSUB Resptr restore D1 GOSBVL FSPECp followed by filename or memory unit? RTNNC LC(2) tALL no, perhaps it is an ALL? ?A=C B GOYES Secp11 if yes, let the system finish decompile LC(2) tKEYS perhaps it is KEYS instead of ALL? ?A#C B GOYES Fspece no, must be garbage Secp11 RTNCC OK, let the system take over Fspece GOVLNG FSPECe (we will not let the user slip one past us) Purgdc GOVLNG PURGDC STITLE Execution code for (UN)SECURE ******************************************** ******************************************** * * Name: Secure - Execute statment SECURE * Uecure - Execute the statement UNSECURE * Class: STEXEC * * Goal: execute (UN)SECURE * * Entry requirements: D0 must point after the tSECURE * or tUNSECURE tokens * P=0 * Exit: via NXTSTM * * CPU registers / RAM used: * A-D,D1,D0,R0-R3 * All of STMTR0, S0-S2, S6-S8, S-11 * * Subroutines: CNFFND,EOLXCL,FILSK+,FINDF+,FSPECx,POLL,ROMFND * * RSTK subroutine levels used: 6 * * Syntax: (UN)SECURE [filename][:devId/ALL/KEYS] * * Future applications: it should be possible to * modify the Sec95 code to extend this enhanced * syntax to other keywords such as ENABLE/DISABLE, PURGE, HELP ... * * flags S3-S6, S9-S10 are not used * * Created 86/01/17 by J.J. Moreau, based on the CAT routine by N.N. * ********************************************************************* REL(5) Purgdc REL(5) Secp Secure ST=0 11 ST11=0 uniquely for SECURE execution Sec-1 A=DAT0 B See IDS vol. 3 (CAT) for details GOSBVL EOLXCK GONC Sec05 D1=(5) =CURRST C=DAT1 A D1=C Sec00 GOSUB Sec95 (We come here only if there is only one file GOTO Nxtstm to (UN)SECURE Sec05 P= 15 LCHEX E P= 0 D1=(5) =S-R0-3 DAT1=C S LC(2) tALL ?A=C B GOYES Sec39 C=0 S DAT1=C S GOSBVL FSPECx GONC Sec38 Bserr GOVLNG BSERR Sec38 GOSBVL FINDF+ GONC Sec00 ?ST=1 6 GOYES Bserr ?C=0 S GOYES Bserr C=D S C=C-1 S GONC Sec40 Sec39 GOTO Sec10 Sec40 C=C-1 S GOC Sec70 GOSBVL POLL CON(2) =pFPROT GOC Bserr ?XM=0 GOYES Nxtstm D=D+1 S D=D+D S GOC Fspec+ ?A#0 W GOYES Sec42 Fspec+ GOTO Fspece Sec42 C=0 A LC(2) =eFACCS GONC Bserr (B.E.T.) Sec70 D=D+1 B GONC Sec82 D1=(5) =S-R0-3 DAT1=C S GOSUB Romchk GONC Sec90 Sec34 C=0 A LC(2) =eDVCNF GOTO Bserr Sec82 GOSUB Romf-1 GOC Sec34 CD1EX GOTO Sec11 Secal? Secalp D1=(5) =S-R0-3 C=DAT1 S ?C#0 S GOYES Sec84 Nxtstm GOVLNG NXTSTM Sec84 C=C+1 S GONC Seccnt Sec85 GOSBVL ROMFND Sec87 GOC Nxtstm Sec90 A=DAT1 B ?A=0 B GOYES Sec85 CD1EX GOTO Sec11 Seccnt DAT1=C S GOSUB Romchk GOTO Sec87 Sec10 D1=(5) =MAINST C=DAT1 A Sec11 D1=(5) =S-R0-1 DAT1=C A GOTO Eoflc+ Eoflch A=C A GOSBVL FILSK+ Eoflc+ D1=C A=DAT1 B ?A#0 B GOYES Eoflch D1=(5) =S-R0-2 DAT1=C A D1=(5) =S-R0-1 A=DAT1 A D0=A C=DAT0 B ?C=0 B GOYES Secal+ D1=D1- 5 Sec17 DAT1=A A D1=A GOSUB Sec95 D1=(5) =S-R0-0 A=DAT1 A C=0 A LC(2) =oFLENh A=A+C A D0=A A=DAT0 A CD0EX A=A+C A D0=A C=DAT0 B ?C#0 B GOYES Sec17 Secal+ GOTO Secalp * * * The routine to UNSECURE files * It is the one to be modified to enhance * the ENABLE / DISABLE, ect. keywords * Keep in mind that S3-S5, S9-S10 are used by neither Sec-1 nor Sec95 * D1 @ header of the file to be acted upon * R0-R3 may not be modified * * Sec95 CD1EX C(A) @ file header GOSBVL LOCADR GOSBVL RAMROM is it RAM or IRAM? GOC Sec96 GOTO Nxtstm Sec96 D1=D1+ lFNAMh D1 @ field S of header D1=D1+ lFTYPh A=DAT1 B LCHEX 1 ?ST=0 11 Secure? GOYES SecSe LCHEX E Cancel file protect A=A&C P GONC SecDn (B.E.T.) SecSe A=A!C P protect file SecDn DAT1=A P RTN Romchk P= 0 (HP routine) LC(2) =ROMCID GOSBVL CNFFND ?A=0 X RTNYES D1=D1+ 1 B=A X C=DAT1 8 D=C W D1=D1+ 3 C=DAT1 3 D1=D1+ 3 C=DAT1 S C=C+1 S D=C S D1=D1+ 4 CSL A CSL A LCHEX 8 AD1EX D1=C ASL W ASL W ASL W A=B X R1=A RTNCC Romf-1 D=D-1 B C=D A R3=C GOSUB Romchk RTNC GONC Romf-3 (B.E.T.) Romf-2 GOSBVL ROMFND RTNC Romf-3 C=R3 ?C#D B GOYES Romf-2 RTNCC * * * The linked LEX follows * * SEC/U CON(2) 1 CON(2) 90 CON(2) 90 CON(5) 0 no more linked LEX files follow * NIBHEX F REL(4) (Tx01)+1 CON(4) 0 no message table CON(5) 0 no poll handlers CON(3) 0 REL(5) Uecure CON(1) 13 Tx01 CON(1) 15 NIBASC 'UNSECURE' CON(2) 90 NIBHEX 1FF REL(5) Purgdc REL(5) Secp Uecure ST=1 11 ST11=1 when UNSECURE is executed GOLONG Sec-1