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

⟦29ab8e0ef⟧ TextFile

    Length: 896 (0x380)
    Types: TextFile
    Names: »SIN.PAS«

Derivation

└─⟦dea633962⟧ Bits:30003306 PROMbrænder software til RC703
    └─ ⟦this⟧ »SIN.PAS« 

TextFile

program test;
var
  x,y   : real;
  i,j   : integer;
  k,l   : byte;
  fl    : file of byte;
  fh    : file of byte;
begin
  assign(fl,'sinl1.hex'); rewrite(fl);
  assign(fh,'sinh1.hex'); rewrite(fh);
  for i:=0 to maxint do
  begin
    x:=sin(i/maxint*pi);
    j:=trunc(x*maxint);
    k:=j and 255;
    l:=j shr 8;
    write(fl,k); write(fh,l);
(*    writeln('sin(',i:2,') = ',x:1:14,'  ',j:5,' ',k:3,l:3);
    if keypress then read;
*)  end;
  writeln(chr(7));
  close(fl); close(fh);
  assign(fl,'sinl2.hex'); rewrite(fl);
  assign(fh,'sinh2.hex'); rewrite(fh);
  for i:=0 to maxint do
  begin
    x:=sin(pi+i/maxint*pi);
    j:=trunc(x*maxint);
    k:=j and 255;
    l:=j shr 8;
    write(fl,k); write(fh,l);
(*    writeln('sin(',i:2,') = ',x:1:14,'  ',j:5,' ',k:3,l:3);
    if keypress then read;
*)  end;
  writeln(chr(7));
  close(fl); close(fh);
end.