Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!princeton!phoenix!pucc!6063366 From: 6063366@pucc.UUCP Newsgroups: net.sources.mac Subject: Re: Where is BinHex 4.0 ? Message-ID: <2150@PUCC.PRINCETON.EDU> Date: Wed, 1-Apr-87 19:48:31 EST Article-I.D.: PUCC.2150 Posted: Wed Apr 1 19:48:31 1987 Date-Received: Sat, 4-Apr-87 11:22:34 EST References: <226@ole.UUCP> <1352@umn-cs.UUCP> <522@u410a.stl.stc.co.uk> Reply-To: 6063366@PUCC.PRINCETON.EDU Organization: Princeton University - Computing and Information Technology Lines: 349 Disclaimer: Author bears full responsibility for contents of this article Run the following program under Macintosh Pascal to generate BinHex 4.0. --- BEGINNING OF MACINTOSH PASCAL PROGRAM --- program Make_BinHex4; { Requires 512K } { MakeMakers, by Steve Brecher,} { generated this program on 3/16/87 } {} {} {} {} {} {} { Select "Go" from "Run" menu. } {} {} {} {} {} {} {} const DataLines = 167; CodeWords = 129; {} var TextRect : rect; D : array[1..DataLines] of string[66]; Code : array[1..CodeWords] of integer; {} procedure InitDataArray; var i : integer; begin for i := 1 to DataLines do D[i] := ''; {set all values in case any lines were dropped} D[1] := '4E56FF80204E42A0BFC865FA41EEFFB043FA00E221490012316100186620A008'; D[2] := '670C0C40FFD0660EA009660A60F0117C0003001BA00A660000A632A80018222E'; D[3] := '000867000062214F0020703021400024224172001219E4495341244F76287000'; D[4] := '7403ED889711801951CAFFF815400002E0481540000148401480564A51C9FFE0'; D[5] := '705A244F722FE318141AB50051C9FFF812199203E54997118211B00167047201'; D[6] := '6034A0036038217C00001D81001CA012662242A8001CA00C661A700180290002'; D[7] := '43F1000345E8002024FC4150504C24D93491A00D3200A0014A41670230013200'; D[8] := '6704A009A0134E5E205F584F225F32814ED000000742696E48657834426E4871'; D[9] := '2000'; D[10] := '((()((((/*D(()TO((()>N1M0.5WCOAMDO9MA*)_B?9P0,1QCLIMF*a0A?HQ+8PKc+'; D[11] := '8=)8;,1V:/,L4K(X4(\22JPR 64) and ((Count <> 9) or (i <> 4)); if not Error then begin InlineP(StuffHex, @Code[CodeIndex], @D[Count]); CodeIndex := CodeIndex + 16; end; end; if not Error then begin Check := 0; for CodeIndex := 1 to CodeWords do Check := Check + Code[CodeIndex]; Error := Check <> 875676; end; if Error then BadDownload; DataToCode := not Error; end; {DataToCode} {} function WriteAppl : boolean; const JsrIndirectA0 = $4E90; noErr = 0; DataErr = 1; dirFulErr = -33; dskFulErr = -34; ioErr = -36; mFulErr = -41; fLckdErr = -45; vLckdErr = -46; wPrErr = -44; var i, j, Result : integer; RegRcd : record A : array[0..2] of ^integer; A3 : ^char; Filler : array[0..7] of longint end; Glue : array[1..5] of integer; begin Glue[1] := $2057; { MoveA.L (SP),A0 ;return addr } Glue[2] := $2E8A; { Move.L A2,(SP) ;ptr to Result } Glue[3] := $2F0B; { Move.L A3,-(SP) ;argument } Glue[4] := $2F08; { Move.L A0,-(SP) ;return addr } Glue[5] := $4ED1; { Jmp (A1) ;to subr in Code array } i := 10; repeat j := length(D[i]); Result := ord((j <> 66) and ((i <> DataLines) or (j <> 26))); if Result = noErr then begin with RegRcd do begin A[0] := @Glue[1]; A[1] := @Code[1]; A[2] := @Result; A3 := @D[i] end; generic(JsrIndirectA0, RegRcd); end; i := i + 1; until (i > DataLines) or (Result <> noErr); if Result = noErr then begin with RegRcd do begin A[0] := @Glue[1]; A[1] := @Code[1]; A[2] := @Result; A3 := nil; end; generic(JsrIndirectA0, RegRcd); end; case Result of DataErr : BadDownLoad; noErr : ; dirFulErr : writeln('Output disk''s directory is full.'); dskFulErr : writeln(' Output disk has too little free space.'); fLckdErr : writeln('Old "BinHex4" file is locked, can''t replace it.'); ioErr : writeln('Disk I/O error.'); mFulErr : writeln('Insufficient memory.'); vLckdErr : writeln('Output disk is locked.'); wPrErr : writeln('Output disk is write protected.'); otherwise write('File Manager returned unexpected error code = ', Result); end; WriteAppl := Result = noErr; end; {WriteAppl} {} begin {program} HideAll; SetRect(TextRect, 0, 20, 528, 342); SetTextRect(TextRect); ShowText; Writeln('Processing -- please wait...'); InitDataArray; if DataToCode then begin if WriteAppl then writeln('Done!') else writeln('Sorry, nothing was accomplished.'); writeln('To exit, select "Quit" from "File" menu.'); end end. --- END OF MACINTOSH PASCAL PROGRAM --- Carl Micarelli BITNET: 6063366@PUCC UUCP: {allegra,ihnp4,cbosgd}!psuvax1!PUCC.BITNET!6063366 INTERNET: 6063366@PUCC.PRINCETON.EDU USMAIL: 122 1903 Hall, Princeton, NJ 08544