From slogin@optonline.net Thu Nov 3 22:25:47 2005 Date: Thu, 03 Nov 2005 22:08:37 -0500 From: slogin@optonline.net Subject: PHONE does not compile under PANDA To: tops-20@lingling.panda.com Message-id: MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-language: en Content-transfer-encoding: 7BIT Content-disposition: inline X-Accept-Language: en Priority: normal Symptoms: PHONE.MAC, as shipped and modified for a PANDA monitor, will not compile on a PANDA monitor. MACRO produces U, E and A errors. In addition, when run on systems with differing local terminals, PHONE may abnormally terminate or otherwise produce odd results. The version number that the EXEC outputs for PHONE is gubbish. Problems: 0) PHONE defines a number of terminals which do NOT exist in the current PANDA MONSYM: .TT132 (6) VT132 .TTS1V (29) SELANAR VT100 .TTR1V (30) V1 RETROGRAPHICS VT100 .TTR2V (31) V2 RETROGRAPHICS VT100 1) PHONE assumes that an ANSI terminal type is 27, whereas in the PANDA MONSYM, it is 5. This produces A errors. 2) PHONE does not and can not range change the value returned by GTTYP%, the current terminal type. 3) PHONE does not seem to have a version defined. The hardwired value -1,,377777 is used in the entry vector. Analysis: The XX macro assumes that all terminals which are requested exist. In most cases, these are in MONSYM; but some of these terminal symbols are defined locally, if they do not exist. Since PHONE can be compiled on non-PANDA platforms, this may not be a safe approach for a number of reasons: 0) Few assumptions can be made about the order and value of non-DEC terminal entry values. 1) Non-DEC terminals may have different values, locally. 2) Defining an undefined non-DEC terminal may clash with existing local terminals. In addition, if run on a foreign system which defines a terminal type which is higher than the maximum for which PHONE was assembled, PHONE will produce inconsistent results. The terminal index will fall off the end of the video display table and point into actual code. Solution: 0) Remove the MONSYM terminal definitions underide. If they aren't in the MONSYM on the system for which we are compiling, then we shouldn't be trying to use them. 1) Calculate a new variable .TTMAX, which is the highest terminal type that we can handle. Range check the value returned by GTTYP% against this. Furthermore, I'd also like to float the proposal that this symbol (.TTMAX) and value be defined by the PANDA MONSYM; this concept is used by GETJI%, MUTIL% and also in the FDB. What do you think, MRC? 2) Modify the XX macro to not try to use a terminal symbol which is not defined. 3) Modify the XX macro to produce a sorted terminal display list, come what may. 4) Insert 'new' VT100 compatible terminal type VT300 (Kermit 95 uses this) 5) Insert a version number. Code: File 1) DSK:PHONE.MAC[4,123] created: 2137 03-Nov-05 File 2) DSK:PHONE.BAK[4,123] created: 1353 01-Jul-87 1)1 ;[TOMMYT]STAR:PHONE.MAC.1710, 1-Nov-2005 15:24:22, Edit by SLOGIN 1) ;[T32] Current PHONE will not compile under PANDA 1) ;PHONE.MAC.1709, 1-Jul-87 10:53:39, Edit by MRC **** 2)1 ;PHONE.MAC.1709, 1-Jul-87 10:53:39, Edit by MRC ************** 1)1 ;[T32] PHONE Version definitions 1) PHNMAJ==1 ;[T32] PHONE's release version 1) PHNMIN==1 ;[T32] PHONE's minor version 1) PHNEDT==^D1710 ;[T32] PHONE's edit version 1) PHNWHO==7 ;[T32] who last edited PHONE (non-DEC) 1) PHNVER==FLD(PHNWHO,VI%WHO)!FLD(PHNMAJ,VI%MAJ)!FLD(PHNMIN,VI%MIN)!^_ 1) FLD(PHNEDT,VI%EDN)!VI%DEC ;[T32] 1) PGVER. (PHNMAJ,PHNMIN,PHNEDT,PHNWHO) ;[T32] 1) ASCIZ " **** 2)1 ASCIZ " ************** 1)4 ;[T32] IFNDEF .TT125,.TT125==:^D35 ;VT125 1) ;[T32] IFNDEF .TT102,.TT102==:^D37 ;VT102 1) ;[T32] IFNDEF .TTH19,.TTH19==:^D38 ;H19 (ANSI) 1) ;[T32] IFNDEF .TT131,.TT131==:^D39 ;VT131 1) IFNDEF .MORTF,.MORTF==:54 ;READ TERMINAL FLAGS **** 2)4 IFNDEF .TT125,.TT125==:^D35 ;VT125 2) IFNDEF .TT102,.TT102==:^D37 ;VT102 2) IFNDEF .TTH19,.TTH19==:^D38 ;H19 (ANSI) 2) IFNDEF .TT131,.TT131==:^D39 ;VT131 2) IFNDEF .MORTF,.MORTF==:54 ;READ TERMINAL FLAGS ************** 1)12 PHNVER ;[T32] Phone version 1) ;[T32] -1,,377777 ;[T32] What's this number? 1) START: RESET ;STOP THE WORLD! **** 2)12 -1,,377777 2) START: RESET ;STOP THE WORLD! ************** 1)36 CAXG T2,.TTMAX ;;[T32] Out of range? 1) SKIPN VTXDSP(T2) ;KNOWN? **** 2)36 SKIPN VTXDSP(T2) ;KNOWN? ************** 1)69 CAXG T2,.TTMAX ;;[T32] Out of range? 1) SKIPN VTXDSP(T2) ;;[T32] CHECK IF GOOD TTY TYPE 1) IFNSK. ;;[T32] 1) MOVEI X2,ST$TTY ;LOSING TTY TYPE **** 2)69 SKIPE VTXDSP(T2) ;CHECK IF GOOD TTY TYPE 2) IFSKP. 2) MOVEI X2,ST$TTY ;LOSING TTY TYPE ************** 1)73 CAXLE T2,.TTMAX ;;[T32] Out of range? 1) JRST UNUSE ;;[T32] Yes, can't use it 1) SKIPN VTXDSP(T2) ;KNOWN? **** 2)73 SKIPN VTXDSP(T2) ;KNOWN? ************** 1)84 DEFINE XXINIT (BASE) < ;;[T32] Initialize counters for XX macro 1) .TTMAX==0 ;;[T32] Highest terminal we know about 1) %%BASE==BASE ;;[T32] Base of table 1) %%LAST==BASE ;;[T32] Last address we did 1) > ;XXINIT ;;[T32] End of macro 1) DEFINE XX (NAM,ADDR,%THIS,%LOFF) <;;[T32] Define a particular terminal 1) IFDEF .TT'NAM < ;;[T32] Don't bother if MONSYM doesn't have this 1) %THIS==.TT'NAM ;;[T32] Define the value for this symbol 1) %LOFF==<%THIS-.TTMAX> ;;[T32] Calculate local difference 1) IFL %LOFF,< ;;[T32] Less than current? 1) RELOC %%BASE+%THIS ;;[T32] Get to the appropriate address 1) EXP ADDR ;;[T32] Emit the routine for this type 1) RELOC %%LAST ;;[T32] Reset to highest value 1) > ;;[T32] End case of out of order value 1) IFGE %LOFF, < ;;[T32] Space up to entry, if necessary 1) REPEAT <<%%BASE+%THIS>-%%LAST>, 1) EXP ADDR ;;[T32] Emit the routine for this type 1) .TTMAX==%THIS ;;[T32] This is the highest terminal value seen 1) %%LAST==. ;;[T32] Record last location 1) > ;;[T32] End case of higher than current 1) > ;;[T32] End case of symbol exists 1) > ;XX 1) VTXDSP: ;PHASE 0 ;[T32] Don't need this now 1) XXINIT (.) ;[T32] Initialize the XX macro 1) IFN PANDASW,< ;[1] Add PANDA VT100 terminal clones **** 2)84 DEFINE XX (NAM,ADDR) < 2) BLOCK .TT'NAM-. 2) EXP ADDR 2) > ;XX 2) VTXDSP: PHASE 0 2) IFN PANDASW,< ;[1] Add PANDA VT100 terminal clones ************** 1)84 XX 300,VT1TBL ;(52) VT300 ;;[T32] 1) >;END IFN PANDASW 1) ;[T32] DEPHASE 1) ;;;REGIS CLEAR SEQUENCE **** 2)84 >;END IFN PANDASW 2) DEPHASE 2) ;;;REGIS CLEAR SEQUENCE ************** PS: Note winning Y2K compliant FILCOM! Thanks MRC!!