$DEBUG PAGELENGTH(50) /*************/ /* */ /* M A I N */ /* */ /*************/ MAIN:DO; /*********************************************************/ /* */ /* MAIN MODULE OF PROGARAM 'MENU' */ /* */ /* OPERATION : */ /* 1. Read invocation line and define program's */ /* name. */ /* 2. Repeat */ /* 1. Print message on screen. */ /* 2. Repeat */ /* Display menu and get response. Define */ /* execution routine's address. */ /* While execution procedure's address is */ /* not valid. */ /* 3. Enable interrupt 6 ( break interrupt ). */ /* 4. Call execution procedure, which prepares */ /* a command buffer. */ /* 5. Disable interrupt 6. */ /* While null command in buffer. */ /* 3. If command buffer conaines one line, insert */ /* command to ISIS-II :CI: buffer, and transfer */ /* control to program to be executed. */ /* Else, build a submit file, define :CI: as that */ /* file, and transfer control. */ /* */ /* LAST UPDATED - 26.5.82 DROR */ /* */ /*********************************************************/ $NOLIST $INCLUDE (COMMON.DCL) $INCLUDE (ISIS.DCL) $INCLUDE (MDSIO.DCL) $INCLUDE (:F1:ISISIO.DCL) $INCLUDE (STRING.DCL) $LIST GET$MENU: PROCEDURE(MENU$TREE$P) ADDRESS EXTERNAL; DECLARE MENU$TREE$P ADDRESS; END GET$MENU; DECLARE MENU$TREE$ROOT BYTE EXTERNAL; EXECUTE1: PROCEDURE(COM$LINE$P) EXTERNAL; DECLARE COM$LINE$P ADDRESS; END EXECUTE1; EXECUTE2: PROCEDURE(COM$LINE$P) EXTERNAL; DECLARE COM$LINE$P ADDRESS; END EXECUTE2; DECLARE CONSOL$LINE STRUCTURE( /* Console buffer */ ML ADDRESS, L ADDRESS, D(129) BYTE ) PUBLIC INITIAL(128,0,0); DECLARE CONSOL$LINE$I ADDRESS; /* Index to console line */ DECLARE MY$NAME STRUCTURE( /* Will conatin menu program's name */ ML ADDRESS, L ADDRESS, D(15) BYTE ) PUBLIC INITIAL(14,0,0); DECLARE COM$LINE STRUCTURE( /* Command line buffer */ ML ADDRESS, L ADDRESS, D(1025) BYTE ) INITIAL ( 1024, /* ML */ 0, /* L */ 0 /* D(0) */ ); DECLARE COM$LINE$I ADDRESS, /* Index to command line */ COM$LINE$TYPE BYTE; /* Command type: 0 - no command ( back to menu ) 1 - one line command 2 - moultiple lines command */ DECLARE STAT ADDRESS; /* ISIS-II status */ DECLARE EXEC$P ADDRESS; /* execution routine */ DECLARE MSG1(*) BYTE DATA( CLR$SCRN, '****************************************', '****************************************', '* ', ' Signal Processing Laboratory *', '* ISIS-II MENU PROGRAM, V1.0 ', ' Technion I.I.T , Haifa *', '* ', ' Israel 1982 *', '****************************************', '****************************************', 0); DECLARE START LABEL PUBLIC; /* Start point for 'break' interrupt */ START: DO; ENABLE; CALL RESCAN(CI$AFT,.STAT); CALL CHECK$STATUS(STAT); CALL RD$CONSOL(.CONSOL$LINE); CALL FIRST$PARM(.MY$NAME,.CONSOL$LINE,.CONSOL$LINE$I,FALSE); COM$LINE$TYPE=0; DO WHILE COM$LINE$TYPE=0; CALL MSG$OUT(.MSG1); EXEC$P=0; DO WHILE (EXEC$P=0); EXEC$P=GET$MENU(.MENU$TREE$ROOT); END; DISABLE; OUTPUT(INT$CNTL$MASK)=INPUT(INT$CNTL$MASK) AND 1011$1111B; ENABLE; CALL EXEC$P(.COM$LINE,.COM$LINE$TYPE); DISABLE; OUTPUT(INT$CNTL$MASK)=INPUT(INT$CNTL$MASK) OR 0100$0000B; ENABLE; IF COM$LINE$TYPE=1 THEN CALL EXECUTE1(.COM$LINE); ELSE IF COM$LINE$TYPE=2 THEN CALL EXECUTE2(.COM$LINE); END; CALL ERROR$MSG(81); CALL EXIT; END START; END MAIN;