1 'DECmate de-booing program MSBDM2.BAS 2 DEFINT A-Z:ZRUBOUT$=CHR$(8)+" "+CHR$(8):ZESCAPE$=CHR$(27):'Sreen utility definitions B.E. 3 ZLEADIN$=ZESCAPE$+"[":ZCLEAR$=ZLEADIN$+"J":ZHOME$=ZLEADIN$+"0;0H" 4 ZDOUBLE1$=ZESCAPE$+"#3":ZDOUBLE2$=ZESCAPE$+"#4":WIDTH 255 5 ZBOLD$=ZLEADIN$+"1m":ZBLINK$=ZLEADIN$+"5m":ZSAVE$=ZESCAPE$+"7" 6 ZREVERSE$=ZLEADIN$+"7m":ZOFF$=ZLEADIN$+"0m":ZREST$=ZESCAPE$+"8" 7 ZGRAPHON$=ZESCAPE$+"(0":ZGRAPHOFF$=ZESCAPE$+"(B":ZBACKER$=ZLEADIN$+"0K" 8 ZKEYPAD$=ZESCAPE$+"=":ZBELL$=CHR$(7):ZCLRLIN$=ZLEADIN$+"2K" 9 DEF FNXY$(ZX,ZY)=ZLEADIN$+MID$(STR$(INT(ZX)),2)+";"+MID$(STR$(INT(ZY)),2)+"H":'Cursor Adressing function (ZX=Line[1..24],ZY=Column[1..80]) 10 GOTO 30:'This to be modified to GOTO Start of program <=================== 11 ZSTRING$="":ZORGL=ZLENGTH:PRINT ZSAVE$+ZREVERSE$+STRING$(ZORGL,95)+ZOFF$+STRING$(ZORGL,8);:'General Input-GOSUB (Input:ZLENGTH, OUTPUT:ZLENGTH,ZSTRING,ZNUMBER,ZRANDOM) 12 ZTEMP$=INKEY$:ZRANDOM=(ZRANDOM MOD 2000)+1:IF LEN(ZTEMP$)=0 THEN 12'Wait for Char 13 IF ASC(ZTEMP$)=127 OR ASC(ZTEMP$)=8 THEN 18 ELSE IF ASC(ZTEMP$)=21 THEN PRINT ZREST$+ZBACKER$;:ZLENGTH=ZORGL:GOTO 11 ELSE PRINT ZTEMP$;'RUBOUT 14 IF ASC(ZTEMP$)=3 THEN GOTO 9999 ELSE IF ZTEMP$ >= "a" THEN ZTEMP$=CHR$(ASC(ZTEMP$)-32)'Uppercase Modify GOTO xx to Control-C intercept <===================== 15 IF ASC(ZTEMP$)=13 THEN PRINT:GOTO 17'RETURN finishes 16 ZSTRING$=ZSTRING$+ZTEMP$:ZLENGTH=ZLENGTH-1:IF ZLENGTH >0 THEN 12 17 ZLENGTH=LEN(ZSTRING$):ZNUMBER=VAL(ZSTRING$): RETURN 18 IF LEN(ZSTRING$)>0 THEN ZLENGTH=ZLENGTH+1:ZSTRING$=LEFT$(ZSTRING$,(LEN(ZSTRING$)-1)):PRINT ZRUBOUT$;:GOTO 12 ELSE PRINT ZBELL$;: GOTO 12'Cleanup after RUBOUT 19 'End of VT100 definitions ***** 20 'Use this BASIC program on the CP/M side of the DECmate (with MicroSoft 21 'MBasic) to translate the MSVDM2.BOO file on your CP/M-80 disk to 22 'binary .EXE format, then from the MS-DOS side use CONVERT to transfer 23 'the result to the MS-DOS file system. This program takes about 30 24 'minutes to run on a DECmate II with floppy disks. 25 'Bill Catchings, CU; modified for Rainbow by Bernie Eiben, DEC; 26 'modified for DECmate CP/M-80 by Charles Lasner CLA. 30 PRINT ZHOME$+ZCLEAR$;"DECmate CP/M 4-for-3 Code Expander (de-booing) Utility Version 1.0" 40 PRINT:PRINT: N$ = CHR$(0) 50 Z = ASC("0") 60 T = ASC("~")-Z 70 DEF FNUCHR%(A$)=ASC(A$)-Z 80 PRINT "FILE-NAME to Expand : ";:ZLENGTH=13:GOSUB 11:'Get Input 90 OPEN "I",1,ZSTRING$ 100 INPUT#1,F$ ' Is this the right file? 110 IF LEN(F$) > 20 THEN GOTO 900 120 OPEN "O",2,F$ ' Ouput-name from file 130 PRINT "Outputting to "+F$ 200 IF EOF(1) THEN GOTO 800 ' Exit nicely on end of file. 210 INPUT#1,X$ ' Get a line. 220 Y$ = "" ' Clear the output buffer. 230 GOTO 400 300 PRINT#2,Y$; ' Print output buffer to file. 310 GOTO 200 ' Get another line. 400 IF LEN(X$) < 2 GOTO 300 ' Input buffer empty? (* 6 Feb 85 *) 410 A = FNUCHR%(X$) 420 IF A = T THEN GOTO 700 ' Null repeat character? 425 IF LEN(X$) < 3 GOTO 300 ' (* 6 Feb 85 *) 430 Q$=MID$(X$,2,3) ' Get the quadruplet to decode. 440 X$=MID$(X$,5) 450 B = FNUCHR%(Q$) 460 Q$ = MID$(Q$,2) 470 C = FNUCHR%(Q$) 480 Q$ = MID$(Q$,2) 490 D = FNUCHR%(Q$) 500 Y$ = Y$ + CHR$(((A * 4) + (B \ 16)) AND 255) ' Decode the quad. 510 Y$ = Y$ + CHR$(((B * 16) + (C \ 4)) AND 255) 520 Y$ = Y$ + CHR$(((C * 64) + D) AND 255) 530 GOTO 400 ' Get another quad. 700 X$ = MID$(X$,2) ' Expand the nulls. 710 R = FNUCHR%(X$) ' Get the number of nulls. 715 PRINT FNXY$(6,5)+ZCLRLIN$;" Null: ",R 720 X$ = MID$(X$,2) 730 FOR I=1 TO R ' Loop, adding nulls to string. 740 Y$ = Y$ + N$ 750 NEXT 760 PRINT#2,Y$; ' Output the nulls to the file. 770 Y$ = "" ' Clear the output buffer. 780 GOTO 400 800 PRINT "Processing complete" 810 PRINT "Output in "+F$ 820 CLOSE #1,#2 830 GOTO 9999 900 PRINT "?The FORMAT of the ",ZSTRING$," file is incorrect" 910 GOTO 820 9999 SYSTEM:END