procedure Beep; begin Write (#7) end; procedure IOErr (Message: AnyString); begin ErrFlag := true; Beep; Writeln (Message); Writeln end; procedure OpenFiles; var PPos: byte; RelName,InlName: FName; begin BytePtr := 128; BitCnt := 0; Finis := false; ErrFlag := false; EoFile := false; Writeln; Write ('REL-File: '); Read (RelName); if RelName='' then Finis := true else begin PPos := Pos (RelName,'.'); if PPos=0 then begin PPos := Length(RelName) + 1; RelName := RelName + '.REL' end; {$I-} Assign (RelFile,RelName); Reset (RelFile); {$I+} if IOResult>0 then IOErr (' Kein Rel-File!') else begin Write (' - Inline-File: '); Readln (InlName); Writeln; if InlName='' then InlName := Copy(RelName,1,PPos) + 'INL' else if Pos(InlName,'.')=0 then InlName := InlName + '.INL'; {$I-} Assign (InlFile,InlName); Rewrite (InlFile); {$I+} if IOResult>0 then IOErr ('Fehler im Inline-File!') end end end; type HexString = String[4]; function Hex (Number: integer): HexString; var N,Intm: integer; IntStr: HexString; begin Intstr := '0000'; for N := 4 downto 1 do begin Intm := (Number and $0F) + $30; if Intm > $39 then Intm := Intm + 7; IntStr[N] := Chr(Intm); Number := Number shr 4 end; Hex := IntStr end; function Max (A,B:integer): integer; begin if A>=B then Max := A else Max := B end;