;written July 2005 to decode files from the Interex archives ;archive must be untarred first, under Linux use a command like... ; tar -x --exclude='Dfile *' --exclude=' *' < $1 &> /dev/null ;untarred files will have oddball names incompatible with Windows. ;For right-click convenience I associated *.fst files to a ;script that cd's to where I wanted the untarred files to be ;then ran the tar -x .. command, then associated ":::" files ;to text and binary fix scripts... ; #!/bin/bash ; # change this to where these files are... ; cd /mnt/hda11/fstdecoder ; cp "$1" fstinput.fil ; echo attach ptr fstinput.fil > fixfiles.sim ; echo attach ptp $1.txt >> fixfiles.sim ; xterm -e hp2100 fix.sim ; rm fstinput.fil ;[binary version is identical except does hp2100 fixbin.sim] ;The fixfiles.sim file is a normal simh hp2100 startup script ;with set TTY, PTR, PTP etc configured to the build's slots ;and ending with... ; d s 123321 ; do fixfiles.sim ; load hpos_fix.abs ; run 2 ; exit ;The fixbin.sim file is identical except does d s 123456 ;original code follows... "Loading FST decoder utility FIXF %HLT %FIX" $PRINT CRLF ; ; FIXF - decodes files contained in FST archives ; .FST archive must be untarred and one file attached ; to PTR, PTP attached to output file. Uses the watchdog ; timer to restart HP-IPL/OS upon end of file or bad value, ; funky way to exit but avoids lockup and permits scripting. ; Put 123456 in SR to suppress CRLF between records ; For auto processing via SIMH script rename %HLT and %FIX, ; to !HLT and !FIX, !HLT halts if watchdog times out, !FIX ; autoruns FIXF if SR contains 123321 or 123456. ; For manual use %HLT and %FIX may be removed. ; OCTAL DEFINE FIXF +WDT ;enable watchdog timer DO ;forever, this program only exits via watchdog timeout MSPAPER 350 DUP GET 2 MSUSER PUT ;MSIN=PTR, MSOUT=ALTMEM MSWIN ;GET WORD COUNT DUP IFZ DROP ELSE ;IF COUNT <> 0 DUP IF<0 ;IF > 32768 WORDS "END" $PRINT DO MSWIN DROP #0 UNTIL ;read until it times out ELSE DUP ;COUNT TO CHECK #1 SWAP +DO ;LOOP FOR THAT MANY WORDS 5 >WDT ;set time out to 500ms MSWIN MSWOUT ;COPY PTR TO ALT MEMORY +LOOP DUP ;COUNT AGAIN MSWIN ;GET END COUNT SUB IFNZ ;IF NOT EQUAL "COUNT!" $PRINT DO MSWIN DROP #0 UNTIL ;timeout ELSE MSPAPER 351 DUP GET 2 MSUSER PUT ;MSIN=ALTMEM, MSOUT=PTP #1 SWAP +DO 10 >WDT MSWIN MSWOUT +LOOP SR>S 123456 SUB IFNZ MSCRLF ENDIF ;no crlf if binary ;status display... print dot every 64 lines ;note - uses location 100 100 DUP DUP GET INC PUT GET 77 AND IFZ 56 PCHR ENDIF ENDIF ;COUNT CHECK ENDIF ;BAD COUNT NUMBER ENDIF ;ZERO COUNT NUMBER #0 UNTIL ;something times out END ; ; The following are optional for automating via SIMH scripts ; Rename % to ! to make autostarting, triggering FIXF if ; SR contains 123321 (text) or 123456 (binary) ; ; Halt on WD timeout... OCTAL CREATE %HLT LDA 260 get ABFLG, 1 if timeout otherwise 0 SZA,RSS skip if timeout JMP END exit if not a timeout CLA STA 260 set flag to 0 to avoid retriggering HLT 7 halt the machine END ; Autostart if SR contains magic values OCTAL DEFINE %FIX SR>S CASE = 123321 "Converting text..." $PRINT FIXF = 123456 "Converting binary..." $PRINT FIXF ENDCASE END ;--------------- CONSOLE