home *** CD-ROM | disk | FTP | other *** search
- {produces Pascal Inline code from a .COM file}
- Program InlineGen;
- type str3=string[3];
- const txt:string[7]='Inline(';
- var t:text;
- c:file of byte;
- b:byte;
- i,j,k,l,m,n:integer;
- parms:string[127] absolute cseg:$80;
- function hex:str3;
- const x:array[0..15] of char = ('0','1','2','3','4','5','6','7','8',
- '9','A','B','C','D','E','F');
- begin
- hex:='$'+x[b shr 4]+x[b and $f];
- end;
- delete(parms,1,1);
- i:=1;
- while (parms[i]<>' ') and (i <= length(parms)) do i:=i+1;
- assign(c,copy(parms,1,i-1));
- reset(c);
- while (length(parms)>0) and (parms[1]<>' ') do delete(parms,1,1);
- while (length(parms)>0) and (parms[1]=' ') do delete(parms,1,1);
- if length(parms)=0 then assign(t,'Inline.Inc') else assign(t,parms);
- rewrite(t);
- j:=1;
- repeat
- read(c,b);
- if j mod 16 = 1 then
- write(t,txt);
- txt:=' ';
- write(t,hex);
- if eof(c) then writeln(t,');') else write(t,',');
- if j mod 16 = 0 then writeln(t);
- j:=j+1
- until eof(c);
- close(t);
- end.
-