DataMuseum.dk

Presents historical artifacts from the history of:

CP/M

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about CP/M

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦9715bbfa9⟧ TextFile

    Length: 1792 (0x700)
    Types: TextFile
    Names: »PRINT.PAS«

Derivation

└─⟦940cc5fc9⟧ Bits:30003294 ASM assembler og editor til RC700
    └─ ⟦this⟧ »PRINT.PAS« 

TextFile

PROGRAM hexdump; æ$A+,R-,S+å


TYPE
  sector = ARRAYÆ0..127Å OF byte;
  str4 = STRINGÆ4Å;
  filename = STRINGÆ14Å;
    
  const
  sp=' ';
  pa='.pa';
  pb='.PA';
  head='PAGE - NO : ';
  nchars=78;
    
VAR
  i,chars,x,line,page,p,n: integer;
  ch: char;
  t:str4;
  inname,outname: filename;
  buffer: sector;
  infile: FILE;
  outfile: text;


procedure formfeed;
begin
   write(outfile,@12,sp,sp,sp,head,page,' ',inname,@13@10,sp);line:=1;
   page:=page+1;
end;

  
BEGIN
  write('Input file name? '); readln(inname);
  IF inname='' THEN halt;
  write('Output file name? '); readln(outname);
  IF outname='' THEN halt;
  assign(infile,inname); æ$I-å reset(infile) æ$I+å;
  IF iores>0 THEN
  BEGIN
    writeln(inname,' does not exist'); halt;
  END;
  assign(outfile,outname); rewrite(outfile);
  line:=1;page:=1;chars:=1;
  formfeed;
  REPEAT
    blockread(infile,buffer,1,n);
    IF n<>0 THEN
    
    BEGIN
      FOR p:=0 TO 127 DO
      BEGIN
        x:=(bufferÆpÅ);
        chars:=chars+1;
        if x=138 then x:=10;
        tÆ0Å:=chr(3);
        tÆ1Å:=chr(x);
        tÆ2Å:=chr(bufferÆp+1Å);
        tÆ3Å:=chr(bufferÆp+2Å);
        if t=pa then
        begin
          formfeed;
        end;
        if t=pb then
        begin
          formfeed;
        end;
        if x=12 then 
        begin
          formfeed;
        end;  
	ch:=chr(x);
	if x=13 then
	begin
         for i:=chars to nchars do
	 begin 
	   write(outfile,' ');
     	 end;
	 write(outfile,'I');
	 line:=line+1;chars:=0;
	end;
	write(outfile,ch);
	if x=10 then write(outfile,sp);
      	if line=68 then formfeed;
      END;
      
      
    END;
  UNTIL n=0;
  close(infile); close(outfile);
END.
«eof»