home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / bix / inline.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1986-08-04  |  969 b   |  38 lines

  1. {produces Pascal Inline code from a .COM file}
  2. Program InlineGen;
  3. type str3=string[3];
  4. const txt:string[7]='Inline(';
  5. var t:text;
  6.     c:file of byte;
  7.     b:byte;
  8.     i,j,k,l,m,n:integer;
  9.     parms:string[127] absolute cseg:$80;
  10. function hex:str3;
  11. const x:array[0..15] of char = ('0','1','2','3','4','5','6','7','8',
  12. '9','A','B','C','D','E','F');
  13. begin
  14. hex:='$'+x[b shr 4]+x[b and $f];
  15. end;
  16. delete(parms,1,1);
  17. i:=1;
  18. while (parms[i]<>' ') and (i <= length(parms)) do i:=i+1;
  19. assign(c,copy(parms,1,i-1));
  20. reset(c);
  21. while (length(parms)>0) and (parms[1]<>' ') do delete(parms,1,1);
  22. while (length(parms)>0) and (parms[1]=' ') do delete(parms,1,1);
  23. if length(parms)=0 then assign(t,'Inline.Inc') else assign(t,parms);
  24. rewrite(t);
  25. j:=1;
  26. repeat
  27. read(c,b);
  28. if j mod 16 = 1 then
  29. write(t,txt);
  30. txt:='       ';
  31. write(t,hex);
  32. if eof(c) then writeln(t,');') else write(t,',');
  33. if j mod 16 = 0 then writeln(t);
  34. j:=j+1
  35. until eof(c);
  36. close(t);
  37. end.
  38.