diff --git a/Borland Turbo Pascal v1/DT.BAK b/Borland Turbo Pascal v1/DT.BAK
deleted file mode 100644
index 90bf26e..0000000
--- a/Borland Turbo Pascal v1/DT.BAK	
+++ /dev/null
@@ -1,10 +0,0 @@
-program dt;
-
-var
-  h, m, s, s100: word;
-
-begin
-    GetTime( h, m, s, s100 );
-    Write( 'time: ' );
-    Write( h, ':', m, s, s100 );
-end.
\ No newline at end of file
diff --git a/Borland Turbo Pascal v1/TIMEDIFF.BAK b/Borland Turbo Pascal v1/TIMEDIFF.BAK
deleted file mode 100644
index 336776e..0000000
--- a/Borland Turbo Pascal v1/TIMEDIFF.BAK	
+++ /dev/null
@@ -1,105 +0,0 @@
-program TimeDifference;
-
-type
-timetype = record h, m, s, l : integer; end;
-
-regpack = record
-          ax,bx,cx,dx,bp,si,di,ds,es,flags: integer;
-          end;
-
-var
-  ta, tb, tdiff: timetype;
-  i, j, x: integer;
-  sh, sm, ss, sl: string[2];
-
-procedure time_difference( var tStart, tEnd, tDiff : timetype );
-begin
-    if ( tEnd.l >= tStart.l ) then
-      tDiff.l := tEnd.l - tStart.l
-    else
-    begin
-      tDiff.l := 100 + tEnd.l - tStart.l;
-      tStart.s := tStart.s + 1;
-    end;
-
-    if ( tEnd.s >= tStart.s ) then
-      tDiff.s := tEnd.s - tStart.s
-    else
-    begin
-      tDiff.s := 60 + tEnd.s - tStart.s;
-      tStart.m := tStart.m + 1;
-    end;
-
-    if ( tend.m >= tStart.m ) then
-      tDiff.m := tEnd.m - tStart.m
-    else
-    begin
-      tDiff.m := 60 + tEnd.m - tStart.m;
-      tStart.h := tStart.h + 1;
-    end;
-    if ( tEnd.h >= tStart.h ) then
-      tDiff.h := tEnd.h - tStart.h
-    else
-      tDiff.h := 12 - tEnd.h - tStart.h;
-end;
-
-procedure get_time( var tt : timetype );
-var
-  recpack:          regpack;             {assign record}
-  ah,al,ch,cl,dh:   byte;
-
-begin
-  ah := $2c;                             {initialize correct registers}
-  with recpack do
-  begin
-    ax := ah shl 8 + al;
-  end;
-  intr($21,recpack);                     {call interrupt}
-  with recpack do
-  begin
-    tt.h := cx shr 8;
-    tt.m := cx mod 256;
-    tt.s := dx shr 8;
-    tt.l := dx mod 256;
-  end;
-end;
-
-procedure print_time( var t: timetype );
-
-var sval : string[2];
-
-begin
-    if ( t.h < 10 ) then write( '0' );
-    write( t.h, ':' );
-    if ( t.m < 10 ) then write( '0' );
-    write( t.m, ':' );
-    if ( t.s < 10 ) then write( '0' );
-    write( t.s, '.' );
-    if ( t.l < 10 ) then write( '0' );
-    write( t.l );
-end;
-
-begin
-  get_time( ta );
-
-  write( 'start time: ' );
-  print_time( ta );
-  writeln;
-
-  for j := 1 to 300 do
-    for i := 1 to 30000 do
-       x := i * 4 * 4 + x;
-
-  get_time( tb );
-  write( 'end time: ' );
-  print_time( tb );
-  writeln;
-
-  time_difference( ta, tb, tdiff );
-  write( 'difference: ' );
-  print_time( tdiff );
-  writeln;
-
-  writeln( 'done' );
-end.
-
\ No newline at end of file
diff --git a/Borland Turbo Pascal v1/m.bat b/Borland Turbo Pascal v1/m.bat
new file mode 100644
index 0000000..c5ad3b6
--- /dev/null
+++ b/Borland Turbo Pascal v1/m.bat	
@@ -0,0 +1,3 @@
+rem there are no command-line tools for turbo pascal. Run the app and compile from within.
+
+
diff --git a/Borland Turbo Pascal v2/ART.PAS b/Borland Turbo Pascal v2/ART.PAS
new file mode 100644
index 0000000..692ed22
--- /dev/null
+++ b/Borland Turbo Pascal v2/ART.PAS	
@@ -0,0 +1,153 @@
+
+const
+  Memory = 150;
+
+var
+  Line:  array [1..Memory] of record
+                                LX1,LY1: integer;
+                                LX2,LY2: integer;
+                                LColor:  integer;
+                              end;
+  X1,X2,Y1,Y2,
+  CurrentLine,
+  ColorCount,
+  IncrementCount,
+  DeltaX1,DeltaY1,DeltaX2,DeltaY2,
+  I,Color:            integer;
+  Ch: char;
+
+
+procedure Check;
+var
+  Ch: char;
+begin
+  writeln('This program will only work if you have the color graphics adapter installed');
+  write('Continue Y/N ');
+  repeat read (Kbd,Ch)  until Upcase(Ch) in ['Y','N'];
+  if Upcase(Ch)='N' then Halt;
+end;
+
+
+
+procedure Init;
+begin
+  for I:=1 to Memory do
+  with Line[I] do
+  begin
+    LX1:=0; LX2:=0;
+    LY1:=0; LY2:=0;
+  end;
+  X1:=0; Y1:=0; X2:=0; Y2:=0;
+  CurrentLine:=1;
+  ColorCount:=0;
+  IncrementCount:=0;
+  Ch:=' ';
+end;
+
+procedure AdjustX(var X,DeltaX: integer);
+var
+  TestX: integer;
+begin
+  TestX:=X+DeltaX;
+  if (TestX<1) or (TestX>320) then
+  begin
+    TestX:=X;
+    DeltaX:=-DeltaX;
+  end;
+  X:=TestX;
+end;
+
+procedure AdjustY(var Y,DeltaY: integer);
+var
+  TestY: integer;
+begin
+  TestY:=Y+DeltaY;
+  if (TestY<1) or (TestY>190) then
+  begin
+    TestY:=Y;
+    DeltaY:=-DeltaY;
+  end;
+  Y:=TestY;
+end;
+
+procedure SelectNewColor;
+begin
+  Color:=Random(3)+1;
+  ColorCount:=5*(1+Random(10));
+end;
+
+procedure SelectNewDeltaValues;
+begin
+  DeltaX1:=Random(7)-3;
+  DeltaX2:=Random(7)-3;
+  DeltaY1:=Random(7)-3;
+  DeltaY2:=Random(7)-3;
+  IncrementCount:=4*(1+Random(9));
+end;
+
+
+procedure SaveCurrentLine;
+begin
+  with Line[CurrentLine] do
+  begin
+    LX1:=X1;
+    LY1:=Y1;
+    LX2:=X2;
+    LY2:=Y2;
+    LColor:=Color;
+  end;
+end;
+
+
+procedure Regenerate;
+var
+  I: integer;
+begin
+  NoSound;
+  GraphColorMode; Palette(2);
+  for I:=1 to Memory do with Line[I] do Draw(LX1,LY1,LX2,LY2,LColor);
+  gotoxy(1,25);
+  write('Press any key to continue, ESC to stop');
+  read(Kbd,Ch);
+end;
+
+begin
+  Check;
+  Init;
+  GraphColorMode;
+  Palette(2);
+  Color:=2;
+  gotoxy(1,25);
+  write('Press any key to regenerate, ESC to stop');
+  repeat
+    with Line[CurrentLine] do Draw(LX1,LY1,LX2,LY2,0);
+
+    if ColorCount=0 then SelectNewColor;
+    if IncrementCount=0 then SelectNewDeltaValues;
+
+    AdjustX(X1,DeltaX1); AdjustX(X2,DeltaX2);
+    AdjustY(Y1,DeltaY1); AdjustY(Y2,DeltaY2);
+
+    Draw(X1,Y1,X2,Y2,Color);
+
+    SaveCurrentLine;
+
+    CurrentLine:=Succ(CurrentLine);
+    if CurrentLine>Memory then CurrentLine:=1;
+    ColorCount:=Pred(ColorCount); IncrementCount:=Pred(IncrementCount);
+
+    if KeyPressed then
+    begin
+      read(Kbd,Ch);
+      if Ch<>#27 then
+      begin
+        Regenerate;
+        gotoxy(1,25);
+        write('Press any key to regenerate, ESC to stop');
+      end;
+    end;
+  until Ch=#27;
+  TextMode;
+end.
+
+
\ No newline at end of file
diff --git a/Borland Turbo Pascal v2/CALC.HLP b/Borland Turbo Pascal v2/CALC.HLP
new file mode 100644
index 0000000..9e1d2a1
--- /dev/null
+++ b/Borland Turbo Pascal v2/CALC.HLP	
@@ -0,0 +1,144 @@
+                    INTRODUCTION
+
+MicroCalc is a tiny spread sheet program a la  VisiCalc. It  is
+provided with the TURBO-Pascal system as an example program.
+
+Since MicroCalc is only a demonstation program it has its limita-
+tions (which you may have fun eliminating):
+
+  * You can not copy formulas from one cell to others.
+  * You can not insert and delete lines or columns.
+
+In spite of its limitations MicroCalc does provide some interest-
+ing features among which are:
+
+  *  11 digits floating point reals (Thanks to TURBO Pascal!)
+  *  Full set of mathematical functions (SIN,COS,LN,EXP etc.)
+  *  Built in line editor for text and formula editing.
+  *  Text  can  be  entered across cells.
+  *  Once entered a formula is protected from accidental erasure.
+.PA
+
+
+In addition to this MicroCalc offers all the usual features of  a
+spread sheet program:
+
+
+  *  Load a spread sheet from the disk.
+  *  Save a spread sheet on the disk.
+  *  Automatic recalculation after each entry. (May be disabled).
+  *  Print the spread sheet on the printer.
+  *  Clear the current spread sheet.
+
+The spread sheet is an electronic piece of paper on which you can
+enter  text,  numbers and formulas and have MicroCalc do calcula-
+tions automatically.
+
+The next page shows the electronic spread sheet.
+.PA
+----------------------------------------------------------------
+       A          B         C         D  ....
+ 1   22.00
+ 2    1.00
+ 3    2.00
+ 4    3.00
+ 5   28.00
+ .
+ .
+A 5  Formula:
+(A1+A2+A3+A4+A5)
+----------------------------------------------------------------- 
+
+In  the example the next last line shows that the active cell  is
+cell  A5  and that A5 contains  a  formula:  (A1+A2+A3+A4)  which
+means  that  the numbers in A1,A2,A3 and A4 should be  added  and
+placed in A5.
+
+The formula can be abbreviated to: (A1>A4) meaning: add all cells
+from A1 to A4.
+.PA
+You move the cursor around just like you do in the TURBO editor:
+
+                             (Up)
+                            Ctrl-E
+                (Left) Ctrl-S     Ctrl-G (Right)
+                            Ctrl-X
+                            (Down)
+
+        ---> On the IBM-PC you may also use the arrows. <---
+
+A cell may contain a number, a formula or some text. The type of the cell
+and its coordinates are shown in the bottom left corner of the screen:
+
+A 5   Formula:         (Means that the current cell is A5 and that it
+                       contains a formula)
+
+A 1   Text             (Cell A1 contains text)
+
+A 2   Numeric          (Cell A2 contains a number and no cell references)
+
+.PA
+                     Summary of MicroCalc
+     Cells are denoted A1 through G21 giving a total of 147 cells.
+
+Summary of standard functions and operators:
+ABS, SQRT, SQR, SIN, COS, ARCTAN, LN, LOG, EXP, FACT
++,-,*,/, ^ to raise to any power e.g. 2^3 = 8
+Futhermore the operator '>' can be used to denote a range of cells to add.
+
+Entering data
+To enter data in any field move the cursor to the cell and enter the
+data. MicroCalc automatically determines if the field is numeric or a
+a text field.
+
+When moving between fields:
+^S,^D,^E,^X move left right up and down.
+
+When editing a field
+^S,^D moves left and right. ^A,^F moves to beginning/end of line.
+DEL,^G  deletes left or right character.
+^V (or Ins on the PC) changes between insert-/overwrite mode.
+ESC makes it possible to regret changes and to edit an existing cell.
+.PA
+
+
+                     Summary of commands
+
+
+    /   will restore the screen
+    Q   will Quit MicroCalc
+    L   will Load a spread sheet from the disk.
+    S   will Save a spread sheet on the disk.
+    R   will Recalculate
+    P   will Print the spread sheet.
+    F   makes it possible to change the output format for numbers.
+    A   switches Autocalc ON and OFF
+
+Note: to use scientific notation use the the F command and enter minus one
+      -1 for the number of decimals.
+
+.PA
+
+                              EXAMPLES
+
+The following are examples of valid cell formulas:
+
+(A1+(B2-C7))  subtract cell C7 from B2 and add the result to cell A1
+(A1>A23)    the sum of cells:  A1,A2,A3..A23
+(A1>B5)     the sum of cells:  A1..A5 and B1..B5
+
+The formulas may be as complicated as you want: 
+
+(SIN(A1)*COS(A2)/((1.2*A8)+LN(FACT(A8)+8.9E-3))+(C1>C5))
+
+To edit an existing formula or text simply move to the cell and
+press ESC, make your changes and press <RETURN>. If you make
+a mistake you may press ESC again, the old value of the cell will
+then be restored.
+
+
+   --> To try MicroCalc now use the /L command to <--
+   --> load the file: CALCDEMO.                   <--
+
+
+
\ No newline at end of file
diff --git a/Borland Turbo Pascal v2/CALC.PAS b/Borland Turbo Pascal v2/CALC.PAS
new file mode 100644
index 0000000..fc10933
--- /dev/null
+++ b/Borland Turbo Pascal v2/CALC.PAS	
@@ -0,0 +1,1259 @@
+
+
+{ This program is hereby donated to the public domain                }
+{ for non commercial use only                                        }
+
+{Here is a note to the compiler:                                     }
+{$R-,U-,V-,X-,C-}
+
+program MicroCalc;
+
+const
+  FXMax: Char  = 'G';  { Maximum number of columns in spread sheet   }
+  FYMax        = 21;   { Maximum number of lines in spread sheet     }
+
+type
+  Anystring   = string[70];
+  SheetIndex  = 'A'..'G';
+  Attributes  = (Constant,Formula,Txt,OverWritten,Locked,Calculated);
+
+{ The spreadsheet is made out of Cells every Cell is defined as      }
+{ the following record:}
+
+  CellRec    = record
+    CellStatus: set of Attributes; { Status of cell (see type def.)  }
+    Contents:   String[70];        { Contains a formula or some text }
+    Value:      Real;              { Last calculated cell value      }
+    DEC,FW:     0..20;             { Decimals and Cell Whith         }
+  end;
+
+  Cells      =  array[SheetIndex,1..FYMax] of CellRec;
+
+const
+  XPOS: array[SheetIndex] of integer = (3,14,25,36,47,58,68);
+
+var
+  Sheet:         Cells;             { Definition of the spread sheet }
+  FX:            SheetIndex;        { Culumn of current cell         }
+  FY:            Integer;           { Line of current cell           }
+  Ch:            Char;              { Last read character            }
+  MCFile:        file of CellRec;   { File to store sheets in        }
+  AutoCalc:      boolean;           { Recalculate after each entry?  }
+
+
+ { For easy reference the procedures and functions are grouped in mo-}
+ { dules called MC-MOD00 through MC-MOD05.                           }
+
+
+ {.PA}
+{*******************************************************************}
+{*  SOURCE CODE MODULE: MC-MOD00                                   *}
+{*  PURPOSE:            Micellaneous utilities and commands.        *}
+{*******************************************************************}
+
+
+procedure Msg(S: AnyString);
+begin
+  GotoXY(1,24);
+  ClrEol;
+  Write(S);
+end;
+
+procedure Flash(X: integer; S: AnyString;  Blink: boolean);
+begin
+  HighVideo;
+  GotoXY(X,23);
+  Write(S);
+  if Blink then
+  begin
+    repeat
+      GotoXY(X,23);
+      Blink:=not Blink; if Blink then HighVideo else LowVideo;
+      Write(S);
+      Delay(175);
+    until KeyPressed;
+  end;
+  LowVideo;
+end;
+
+procedure IBMCh(var Ch: Char);
+begin
+  case Ch of
+    'H': Ch:=^E;
+    'P': Ch:=^X;
+    'M': Ch:=^D;
+    'K': Ch:=^S;
+    'S': Ch:=#127;
+    'R': Ch:=^V;
+    'G',
+    'I',
+    'O',
+    'Q': Ch:=#00;
+  end;
+end;
+
+procedure Auto;
+begin
+  AutoCalc:=not AutoCalc;
+  if AutoCalc then  Flash(60,'AutoCalc: ON ',false)
+  else Flash(60,'AutoCalc: OFF',false);
+end;
+
+
+{.PA}
+{*******************************************************************}
+{*  SOURCE CODE MODULE: MC-MOD01                                   *}
+{*  PURPOSE:            Display grid and initialize all cells      *}
+{*                      in the spread sheet.                       *}
+{*******************************************************************}
+
+
+
+procedure Grid;
+var I: integer;
+    Count: Char;
+begin
+  HighVideo;
+  For Count:='A' to FXMax do
+  begin
+    GotoXY(XPos[Count],1);
+    Write(Count);
+  end;
+  GotoXY(1,2);
+  for I:=1 to FYMax do writeln(I:2);
+  LowVideo;
+  if AutoCalc then  Flash(60,'AutoCalc: ON' ,false)
+  else Flash(60,'AutoCalc: OFF',false);
+  Flash(33,'  Type / for Commands',false);
+end;
+
+
+procedure Init;
+var
+  I: SheetIndex;
+  J: Integer;
+  LastName: string[2];
+begin
+  for I:='A' to FXMAX do
+  begin
+    for J:=1 to FYMAX do
+    begin
+      with Sheet[I,J] do
+      begin
+        CellStatus:=[Txt];
+        Contents:='';
+        Value:=0;
+        DEC:=2;              { Default number of decimals        }
+        FW:=10;              { Default field width               }
+      end;
+    end;
+  end;
+  AutoCalc:=True;
+  FX:='A'; FY:=1;            { First field in upper left corner  }
+end;
+
+procedure Clear;
+begin
+  HighVideo;
+  GotoXY(1,24); ClrEol;
+  Write('Clear this worksheet? (Y/N) ');
+  repeat Read(Kbd,Ch) until Upcase(Ch) in ['Y','N'];
+  Write(Upcase(Ch));
+  if UpCase(Ch)='Y' then
+  begin
+    ClrScr;
+    Init;
+    Grid;
+  end;
+end;
+
+
+
+{.PA}
+{*******************************************************************}
+{*  SOURCE CODE MODULE: MC-MOD02                                   *}
+{*  PURPOSE:            Display values in cells and move between   *}
+{*                      cells in the spread sheet.                 *}
+{*******************************************************************}
+
+
+procedure FlashType;
+begin
+  with Sheet[FX,FY] do
+  begin
+    GotoXY(1,23);
+    Write(FX,FY:2,' ');
+    if Formula in CellStatus  then write('Formula:')  else
+    if Constant in CellStatus then Write('Numeric ') else
+    if Txt in CellStatus then Write('Text    ');
+    GotoXY(1,24); ClrEol;
+    if Formula in CellStatus then Write(Contents);
+  end;
+end;
+
+
+{ The following procedures move between the Cells on the calc sheet.}
+{ Each Cell has an associated record containing its X,Y coordinates }
+{ and data. See the type definition for "Cell".                     }
+
+procedure GotoCell(GX: SheetIndex; GY: integer);
+begin
+  with Sheet[GX,GY] do
+  begin
+    HighVideo;
+    GotoXY(XPos[GX],GY+1);
+    Write('           ');
+    GotoXY(XPos[GX],GY+1);
+    if Txt in CellStatus then Write(Contents)
+    else
+    begin
+      if DEC>=0 then Write(Value:FW:DEC)
+      else Write(Value:FW);
+    end;
+    FlashType;
+    GotoXY(XPos[GX],GY+1);
+  end;
+  LowVideo;
+end;
+
+{.CP20}
+
+procedure LeaveCell(FX:SheetIndex;FY: integer);
+begin
+  with Sheet[FX,FY] do
+  begin
+    GotoXY(XPos[FX],FY+1);
+    LowVideo;
+    if Txt in CellStatus then Write(Contents)
+    else
+    begin
+      if DEC>=0 then Write(Value:FW:DEC)
+      else Write(Value:FW);
+    end;
+  end;
+end;
+
+
+{.CP20}
+
+procedure Update;
+var
+  UFX: SheetIndex;
+  UFY: integer;
+begin
+  ClrScr;
+  Grid;
+  for UFX:='A' to FXMax do for UFY:=1 to FYMax do
+  if Sheet[UFX,UFY].Contents<>'' then LeaveCell(UFX,UFY);
+  GotoCell(FX,FY);
+end;
+
+{.CP20}
+
+procedure MoveDown;
+var Start: integer;
+begin
+  LeaveCell(FX,FY);
+  Start:=FY;
+  repeat
+    FY:=FY+1;
+    if FY>FYMax then FY:=1;
+  until (Sheet[FX,FY].CellStatus*[OverWritten,Locked]=[]) or (FY=Start);
+  if FY<>Start then GotoCell(FX,FY);
+end;
+
+{.CP20}
+
+procedure MoveUp;
+var Start: integer;
+begin
+  LeaveCell(FX,FY);
+  Start:=FY;
+  repeat
+    FY:=FY-1;
+    if FY<1 then FY:=FYMax;
+  until (Sheet[FX,FY].CellStatus*[OverWritten,Locked]=[]) or (FY=Start);
+  if FY<>Start then GotoCell(FX,FY);
+end;
+
+{.CP20}
+
+procedure MoveRight;
+var Start: SheetIndex;
+begin
+  LeaveCell(FX,FY);
+  Start:=FX;
+  repeat
+    FX:=Succ(FX);
+    if FX>FXMax then
+    begin
+      FX:='A';
+      FY:=FY+1;
+      if FY>FYMax then FY:=1;
+    end;
+  until (Sheet[FX,FY].CellStatus*[OverWritten,Locked]=[]) or (FX=Start);
+  if FX<>Start then GotoCell(FX,FY);
+end;
+
+{.CP20}
+
+procedure MoveLeft;
+var Start: SheetIndex;
+begin
+  LeaveCell(FX,FY);
+  Start:=FX;
+  repeat
+    FX:=Pred(FX);
+    if FX<'A' then
+    begin
+      FX:=FXMax;
+      FY:=FY-1;
+      if FY<1 then FY:=FYMax;
+    end;
+  until (Sheet[FX,FY].CellStatus*[OverWritten,Locked]=[]) or (FX=Start);
+  if FX<>Start then GotoCell(FX,FY);
+end;
+
+
+{.PA}
+{*******************************************************************}
+{*  SOURCE CODE MODULE: MC-MOD03                                   *}
+{*  PURPOSE:            Read, Save and Print a spread sheet.       *}
+{*                      Display on-line manual.                    *}
+{*******************************************************************}
+
+type
+  String3 = string[3];
+
+var
+  FileName: string[14];
+  Line: string[100];
+
+function Exist(FileN: AnyString): boolean;
+var F: file;
+begin
+   {$I-}
+   assign(F,FileN);
+   reset(F);
+   {$I+}
+   if IOResult<>0 then Exist:=false
+   else Exist:=true;
+end;
+
+
+procedure GetFileName(var Line: AnyString; FileType:String3);
+begin
+  Line:='';
+  repeat
+    Read(Kbd,Ch);
+    if Upcase(Ch) in ['A'..'Z',^M] then
+    begin
+      write(Upcase(Ch));
+      Line:=Line+Ch;
+    end;
+  until (Ch=^M) or (length(Line)=8);
+  if Ch=^M then Delete(Line,Length(Line),1);
+  if Line<>'' then Line:=Line+'.'+FileType;
+end;
+
+{.CP20}
+
+procedure Save;
+var I: SheetIndex;
+J: integer;
+begin
+  HighVideo;
+  Msg('Save: Enter filename  ');
+  GetFileName(Filename,'MCS');
+  if FileName<>'' then
+  begin
+    Assign(MCFile,FileName);
+    Rewrite(MCFile);
+    for I:='A' to FXmax do
+    begin
+      for J:=1 to FYmax do
+      write(MCfile,Sheet[I,J]);
+    end;
+    Grid;
+    Close(MCFile);
+    LowVideo;
+    GotoCell(FX,FY);
+  end;
+end;
+
+{.CP30}
+
+procedure Load;
+begin
+  HighVideo;
+  Msg('Load: Enter filename  ');
+  GetFileName(Filename,'MCS');
+  if (Filename<>'') then if (not exist(FileName)) then
+  repeat
+    Msg('File not Found: Enter another filename  ');
+    GetFileName(Filename,'MCS');
+  until exist(FileName) or (FileName='');
+  if FileName<>'' then
+  begin
+    ClrScr;
+    Msg('Please Wait. Loading definition...');
+    Assign(MCFile,FileName);
+    Reset(MCFile);
+    for FX:='A' to FXmax do
+     for FY:=1 to FYmax do read(MCFile,Sheet[FX,FY]);
+    FX:='A'; FY:=1;
+    LowVideo;
+    UpDate;
+  end;
+  GotoCell(FX,FY);
+end;
+
+
+{.PA}
+
+procedure Print;
+var
+  I:      SheetIndex;
+  J,Count,
+  LeftMargin: Integer;
+  P:          string[20];
+  MCFile:     Text;
+begin
+  HighVideo;
+  Msg('Print: Enter filename "P" for Printer> ');
+  GetFileName(Filename,'LST');
+  Msg('Left margin > ');  Read(LeftMargin);
+  if FileName='P.LST' then FileName:='Printer';
+  Msg('Printing to: ' + FileName + '....');
+  Assign(MCFile,FileName);
+  Rewrite(MCFile);
+  For Count:=1 to 5 do Writeln(MCFile);
+  for J:=1 to FYmax do
+  begin
+    Line:='';
+    for I:='A' to FXmax do
+    begin
+      with Sheet[I,J] do
+      begin
+        while (Length(Line)<XPOS[I]-4) do Line:=Line+' ';
+        if (Constant in CellStatus) or (Formula in CellStatus) then
+        begin
+          if not (Locked in CellStatus) then
+          begin
+            if DEC>0 then Str(Value:FW:DEC,P) else Str(Value:FW,P);
+            Line:=Line+P;
+          end;
+        end else Line:=Line+Contents;
+      end; { With }
+    end; { One line }
+    For Count:=1 to LeftMargin do Write(MCFile,' ');
+    writeln(MCFile,Line);
+  end; { End Column }
+  Grid;
+  Close(MCFile);
+  LowVideo;
+  GotoCell(FX,FY);
+end;
+
+{.PA}
+
+procedure Help;
+var
+  H: text;
+  Line: string[80];
+  J: integer;
+  Bold: boolean;
+
+begin
+  if Exist('CALC.HLP') then
+  begin
+    Assign(H,'CALC.HLP');
+    Reset(H);
+    while not Eof(H) do
+    begin
+      ClrScr; Bold:=false; LowVideo;
+      Readln(H,Line);
+      repeat
+        Write('     ');
+        For J:=1 to Length(Line) do
+        begin
+          if Line[J]=^B then
+          begin
+            Bold:=not Bold;
+            if Bold then HighVideo else LowVideo;
+          end else write(Line[J]);
+        end;
+        Writeln;
+        Readln(H,Line);
+      until  Eof(H) or (Copy(Line,1,3)='.PA');
+      GotoXY(26,24); HighVideo;
+      write('<<< Please press any key to continue >>>');
+      LowVideo;
+      read(Kbd,Ch);
+    end;
+    GotoXY(20,24); HighVideo;
+    write('<<< Please press <RETURN> to start MicroCalc >>>');
+    LowVideo;
+    Readln(Ch);
+    UpDate;
+  end else { Help file did not exist }
+  begin
+    Msg('To get help the file CALC.HLP must be on your disk. Press <RETURN>');
+    repeat Read(kbd,Ch) until Ch=^M;
+    GotoCell(FX,FY);
+  end;
+end;
+
+
+{.PA}
+{*******************************************************************}
+{*  SOURCE CODE MODULE: MC-MOD04                                   *}
+{*  PURPOSE:            Evaluate formulas.                         *}
+{*                      Recalculate spread sheet.                  *}
+{*                                                                 *}
+{*  NOTE:               This module contains recursive procedures  *}
+{*******************************************************************}
+
+var
+  Form: Boolean;
+
+{$A-}
+procedure Evaluate(var IsFormula: Boolean; { True if formula}
+                   var Formula: AnyString; { Fomula to evaluate}
+                   var Value: Real;  { Result of formula }
+                   var ErrPos: Integer);{ Position of error }
+const
+  Numbers: set of Char = ['0'..'9'];
+  EofLine  = ^M;
+
+var
+  Pos: Integer;    { Current position in formula                     }
+  Ch: Char;        { Current character being scanned                 }
+  EXY: string[3];  { Intermidiate string for conversion              }
+
+{ Procedure NextCh returns the next character in the formula         }
+{ The variable Pos contains the position ann Ch the character        }
+
+  procedure NextCh;
+  begin
+    repeat
+      Pos:=Pos+1;
+      if Pos<=Length(Formula) then
+      Ch:=Formula[Pos] else Ch:=eofline;
+    until Ch<>' ';
+  end  { NextCh };
+
+
+  function Expression: Real;
+  var
+    E: Real;
+    Opr: Char;
+
+    function SimpleExpression: Real;
+    var
+      S: Real;
+      Opr: Char;
+
+      function Term: Real;
+      var
+        T: Real;
+
+        function SignedFactor: Real;
+
+          function Factor: Real;
+          type
+            StandardFunction = (fabs,fsqrt,fsqr,fsin,fcos,
+            farctan,fln,flog,fexp,ffact);
+            StandardFunctionList = array[StandardFunction] of string[6];
+
+          const
+            StandardFunctionNames: StandardFunctionList =('ABS','SQRT','SQR','SIN','COS',
+                                                          'ARCTAN','LN','LOG','EXP','FACT');
+          var
+            E,EE,L:  Integer;       { intermidiate variables }
+            Found:Boolean;
+            F: Real;
+            Sf:StandardFunction;
+            OldEFY,                 { Current cell  }
+            EFY,
+            SumFY,
+            Start:Integer;
+            OldEFX,
+            EFX,
+            SumFX:SheetIndex;
+            CellSum: Real;
+
+              function Fact(I: Integer): Real;
+              begin
+                if I > 0 then begin Fact:=I*Fact(I-1); end
+                else Fact:=1;
+              end  { Fact };
+
+{.PA}
+          begin { Function Factor }
+            if Ch in Numbers then
+            begin
+              Start:=Pos;
+              repeat NextCh until not (Ch in Numbers);
+              if Ch='.' then repeat NextCh until not (Ch in Numbers);
+              if Ch='E' then
+              begin
+                NextCh;
+                repeat NextCh until not (Ch in Numbers);
+              end;
+              Val(Copy(Formula,Start,Pos-Start),F,ErrPos);
+            end else
+            if Ch='(' then
+            begin
+              NextCh;
+              F:=Expression;
+              if Ch=')' then NextCh else ErrPos:=Pos;
+            end else
+            if Ch in ['A'..'G'] then { Maybe a cell reference }
+            begin
+              EFX:=Ch;
+              NextCh;
+              if Ch in Numbers then
+              begin
+                F:=0;
+                EXY:=Ch; NextCh;
+                if Ch in Numbers then
+                begin
+                  EXY:=EXY+Ch;
+                  NextCh;
+                end;
+                Val(EXY,EFY,ErrPos);
+                IsFormula:=true;
+                if (Constant in Sheet[EFX,EFY].CellStatus) and
+                not (Calculated in Sheet[EFX,EFY].CellStatus) then
+                begin
+                  Evaluate(Form,Sheet[EFX,EFY].contents,f,ErrPos);
+                  Sheet[EFX,EFY].CellStatus:=Sheet[EFX,EFY].CellStatus+[Calculated]
+                end else if not (Txt in Sheet[EFX,EFY].CellStatus) then
+                F:=Sheet[EFX,EFY].Value;
+                if Ch='>' then
+                begin
+                  OldEFX:=EFX; OldEFY:=EFY;
+                  NextCh;
+                  EFX:=Ch;
+                  NextCh;
+                  if Ch in Numbers then
+                  begin
+                    EXY:=Ch;
+                    NextCh;
+                    if Ch in Numbers then
+                    begin
+                      EXY:=EXY+Ch;
+                      NextCh;
+                    end;
+                    val(EXY,EFY,ErrPos);
+                    Cellsum:=0;
+                    for SumFY:=OldEFY to EFY do
+                    begin
+                      for SumFX:=OldEFX to EFX do
+                      begin
+                        F:=0;
+                        if (Constant in Sheet[SumFX,SumFY].CellStatus) and
+                        not (Calculated in Sheet[SumFX,SumFY].CellStatus) then
+                        begin
+                          Evaluate(Form,Sheet[SumFX,SumFY].contents,f,errPos);
+                          Sheet[SumFX,SumFY].CellStatus:=
+                          Sheet[SumFX,SumFY].CellStatus+[Calculated];
+                        end else if not (Txt in Sheet[SumFX,SumFY].CellStatus) then
+                        F:=Sheet[SumFX,SumFY].Value;
+                        Cellsum:=Cellsum+f;
+                        f:=Cellsum;
+                      end;
+                    end;
+                  end;
+                end;
+              end;
+            end else
+            begin
+              found:=false;
+              for sf:=fabs to ffact do
+              if not found then
+              begin
+                l:=Length(StandardFunctionNames[sf]);
+                if copy(Formula,Pos,l)=StandardFunctionNames[sf] then
+                begin
+                  Pos:=Pos+l-1; NextCh;
+                  F:=Factor;
+                  case sf of
+                    fabs:     f:=abs(f);
+                    fsqrt:    f:=sqrt(f);
+                    fsqr:     f:=sqr(f);
+                    fsin:     f:=sin(f);
+                    fcos:     f:=cos(f);
+                    farctan:  f:=arctan(f);
+                    fln :     f:=ln(f);
+                    flog:     f:=ln(f)/ln(10);
+                    fexp:     f:=exp(f);
+                    ffact:    f:=fact(trunc(f));
+                  end;
+                  Found:=true;
+                end;
+              end;
+              if not Found then ErrPos:=Pos;
+            end;
+            Factor:=F;
+          end { function Factor};
+{.PA}
+
+        begin { SignedFactor }
+          if Ch='-' then
+          begin
+            NextCh; SignedFactor:=-Factor;
+          end else SignedFactor:=Factor;
+        end { SignedFactor };
+
+      begin { Term }
+        T:=SignedFactor;
+        while Ch='^' do
+        begin
+          NextCh; t:=exp(ln(t)*SignedFactor);
+        end;
+        Term:=t;
+      end { Term };
+
+
+    begin { SimpleExpression }
+      s:=term;
+      while Ch in ['*','/'] do
+      begin
+        Opr:=Ch; NextCh;
+        case Opr of
+          '*': s:=s*term;
+          '/': s:=s/term;
+        end;
+      end;
+      SimpleExpression:=s;
+    end { SimpleExpression };
+
+  begin { Expression }
+    E:=SimpleExpression;
+    while Ch in ['+','-'] do
+    begin
+      Opr:=Ch; NextCh;
+      case Opr of
+        '+': e:=e+SimpleExpression;
+        '-': e:=e-SimpleExpression;
+      end;
+    end;
+    Expression:=E;
+  end { Expression };
+
+
+begin { procedure Evaluate }
+  if Formula[1]='.' then Formula:='0'+Formula;
+  if Formula[1]='+' then delete(Formula,1,1);
+  IsFormula:=false;
+  Pos:=0; NextCh;
+  Value:=Expression;
+  if Ch=EofLine then ErrPos:=0 else ErrPos:=Pos;
+end { Evaluate };
+
+{.PA}
+
+procedure Recalculate;
+var
+  RFX: SheetIndex;
+  RFY:integer;
+  OldValue: real;
+  Err: integer;
+
+begin
+  LowVideo;
+  GotoXY(1,24); ClrEol;
+  Write('Calculating..');
+  for RFY:=1 to FYMax do
+  begin
+    for RFX:='A' to FXMax do
+    begin
+      with Sheet[RFX,RFY] do
+      begin
+        if (Formula in CellStatus) then
+        begin
+          CellStatus:=CellStatus+[Calculated];
+          OldValue:=Value;
+          Evaluate(Form,Contents,Value,Err);
+          if OldValue<>Value then
+          begin
+            GotoXY(XPos[RFX],RFY+1);
+            if (DEC>=0) then Write(Value:FW:DEC)
+            else Write(Value:FW);
+          end;
+        end;
+      end;
+    end;
+  end;
+  GotoCell(FX,FY);
+end;
+
+{.PA}
+{*******************************************************************}
+{*  SOURCE CODE MODULE: MC-MOD05                                   *}
+{*  PURPOSE:            Read the contents of a cell and update     *}
+{*                      associated cells.                          *}
+{*******************************************************************}
+
+
+procedure GetLine(var S: AnyString;           { String to edit       }
+                         ColNO,LineNO,        { Where start line     }
+                         MAX,                 { Max length           }
+                         ErrPos: integer;     { Where to begin       }
+                         UpperCase:Boolean);  { True if auto Upcase  }
+var
+  X: integer;
+  InsertOn: boolean;
+  OkChars: set of Char;
+
+
+  procedure GotoX;
+  begin
+    GotoXY(X+ColNo-1,LineNo);
+  end;
+
+begin
+  OkChars:=[' '..'}'];
+  InsertOn:=true;
+  X:=1; GotoX;
+  Write(S);
+  if Length(S)=1 then X:=2;
+  if ErrPos<>0 then X:=ErrPos;
+  GotoX;
+  repeat
+    Read(Kbd,Ch);
+    if KeyPressed then
+    begin
+      Read(kbd,Ch);
+      IBMCh(Ch);
+    end;
+    if UpperCase then Ch:=UpCase(Ch);
+    case Ch of
+       ^[: begin
+             S:=chr($FF); { abort editing }
+             Ch:=^M;
+           end;
+       ^D: begin { Move cursor right }
+             X:=X+1;
+             if (X>length(S)+1) or (X>MAX) then X:=X-1;
+             GotoX;
+           end;
+       ^G: begin { Delete right char }
+             if X<=Length(S) then
+             begin
+               Delete(S,X,1);
+               Write(copy(S,X,Length(S)-X+1),' ');
+               GotoX;
+             end;
+           end;
+    ^S,^H: begin { Move cursor left }
+             X:=X-1;
+             if X<1 then X:=1;
+             GotoX;
+           end;
+       ^F: begin { Move cursor to end of line }
+              X:=Length(S)+1;
+              GotoX;
+           end;
+       ^A: begin { Move cursor to beginning of line }
+             X:=1;
+             GotoX;
+           end;
+     #127: begin { Delete left char }
+             X:=X-1;
+             if (Length(S)>0) and (X>0)  then
+             begin
+               Delete(S,X,1);
+               Write(copy(S,X,Length(S)-X+1),' ');
+               GotoX;
+               if X<1 then X:=1;
+             end else X:=1;
+           end;
+       ^V: InsertOn:= not InsertOn;
+
+{.PA}
+
+    else
+      begin
+        if Ch in OkChars  then
+        begin
+          if InsertOn then
+          begin
+            insert(Ch,S,X);
+            Write(copy(S,X,Length(S)-X+1),' ');
+          end else
+          begin
+            write(Ch);
+            if X=length(S) then S:=S+Ch
+              else S[X]:=Ch;
+          end;
+          if Length(S)+1<=MAX then X:=X+1
+          else OkChars:=[]; { Line too Long }
+          GotoX;
+        end else
+        if Length(S)+1<=Max then
+          OkChars:= [' '..'}']; { Line ok again }
+      end;
+    end;
+  until CH=^M;
+end;
+
+
+{.PA}
+
+
+procedure  GetCell(FX: SheetIndex;FY: Integer);
+var
+  S:             AnyString;
+  NewStat:       Set of Attributes;
+  ErrorPosition: Integer;
+  I:             SheetIndex;
+  Result:        Real;
+  Abort:         Boolean;
+  IsForm:        Boolean;
+
+{ Procedure ClearCells clears the current cell and its associated    }
+{ cells. An associated cell is a cell overwritten by data from the   }
+{ current cell. The data can be text in which case the cell has the  }
+{ attribute "OverWritten". If the data is a result from an expression}
+{ and the field with is larger tahn 11 then the cell is "Locked"     }
+
+  procedure ClearCells;
+  begin
+    I:=FX;
+    repeat
+      with Sheet[I,FY] do
+      begin
+        GotoXY(XPos[I],FY+1);
+        write('           '); I:=Succ(I);
+      end;
+    until ([OverWritten,Locked]*Sheet[I,FY].CellStatus=[]);
+    { Cell is not OVerWritten not Locked }
+  end;
+
+{.CP20}
+{ The new type of the cell is flashed at the bottom of the Sheet     }
+{ Notice that a constant of type array is used to indicate the type  }
+
+  procedure FlashType;
+  begin
+    HighVideo;
+    GotoXY(5,23);
+    LowVideo;
+  end;
+
+{.CP20}
+  procedure GetFormula;
+  begin
+    FlashType;
+    repeat
+      GetLine(S,1,24,70,ErrorPosition,True);
+      if S<>Chr($FF) then
+      begin
+        Evaluate(IsForm,S,Result,ErrorPosition);
+        if ErrorPosition<>0 then
+          Flash(15,'Error at cursor'+^G,false)
+        else Flash(15,'               ',false);
+      end;
+    until (ErrorPosition=0) or (S=Chr($FF));
+    if IsForm then NewStat:=NewStat+[Formula];
+  end;
+
+{.CP20}
+{ Procedure GetText calls the procedure GetLine with the current     }
+{ cells X,Y position as parameters. This means that text entering    }
+{ takes place direcly at the cells position on the Sheet.            }
+
+  procedure GetText;
+  begin
+    FlashType;
+    with Sheet[FX,FY] do GetLine(S,XPos[FX],FY+1,70,ErrorPosition,False);
+  end;
+
+{.CP20}
+{ Procedure EditCell loads a copy of the current cells contents in   }
+{ in the variable S before calling either GetText or GetFormula. In  }
+{ this way no changes are made to the current cell.                  }
+
+  procedure EditCell;
+  begin
+    with Sheet[FX,FY] do
+    begin
+      S:=Contents;
+      if Txt in CellStatus then GetText else GetFormula;
+    end;
+  end;
+
+{.PA}
+{ Procedure UpdateCells is a little more complicated. Basically it   }
+{ makes sure to tag and untag cells which has been overwritten or    }
+{ cleared from data from  another cell. It also updates the current  }
+{ with the new type and the contents which still is in the temporaly }
+{ variable "S".                                                      }
+
+
+  procedure UpdateCells;
+  var
+    Flength: Integer;
+  begin
+    Sheet[FX,FY].Contents:=S;
+    if Txt in NewStat {Sheet[FX,FY].CellStatus} then
+    begin
+      I:=FX; FLength:=Length(S);
+      repeat
+        I:=Succ(I);
+        with Sheet[I,FY] do
+        begin
+          FLength:=Flength-11;
+          if (Flength>0) then
+          begin
+            CellStatus:=[Overwritten,Txt];
+            Contents:='';
+          end else
+          begin
+            if OverWritten in CellStatus then
+            begin
+              CellStatus:=[Txt];
+              GotoCell(I,FY);LeaveCell(I,FY);
+            end;
+          end;
+        end;
+      until (I=FXMax)  or (Sheet[I,FY].Contents<>'');
+      Sheet[FX,FY].CellStatus:=[Txt];
+    end else { string changed to formula or constant }
+    begin { Event number two }
+      I:=FX;
+      repeat
+        with Sheet[I,FY] do
+        begin
+          if OverWritten in CellStatus then
+          begin
+            CellStatus:=[Txt];
+            Contents:='';
+          end;
+          I:=Succ(I);
+        end;
+      until not (OverWritten in Sheet[I,FY].CellStatus);
+      with Sheet[FX,FY] do
+      begin
+        CellStatus:=[Constant];
+        if IsForm then CellStatus:=CellStatus+[Formula];
+        Value:=Result;
+      end;
+    end;
+  end;
+
+
+{.PA}
+{ Procedure GetCell finnaly starts here. This procedure uses all     }
+{ all the above local procedures. First it initializes the temporaly }
+{ variable "S" with the last read character. It then depending on    }
+{ this character calls GetFormula, GetText, or EditCell.             }
+
+begin { procedure GetCell }
+  S:=Ch; ErrorPosition:=0; Abort:=false;
+  NewStat:=[];
+  if Ch in ['0'..'9','+','-','.','(',')'] then
+  begin
+    NewStat:=[Constant];
+    if not (Formula in Sheet[FX,FY].CellStatus) then
+    begin
+      GotoXY(11,24); ClrEol;
+      ClearCells;
+      GetFormula;
+    end else
+    begin
+      Flash(15,'Edit formula Y/N?',true);
+      repeat read(Kbd,Ch) until UpCase(CH) in ['Y','N'];
+      Flash(15,'                 ',false);
+      if UpCase(Ch)='Y' then EditCell Else Abort:=true;
+    end;
+  end else
+  begin
+    if Ch=^[ then
+    begin
+      NewStat:=(Sheet[FX,FY].CellStatus)*[Txt,Constant];
+      EditCell;
+    end else
+    begin
+      if formula in Sheet[FX,FY].CellStatus then
+      begin
+        Flash(15,'Edit formula Y/N?',true);
+        repeat read(Kbd,Ch) until UpCase(CH) in ['Y','N'];
+        Flash(15,'                 ',false);
+        if UpCase(Ch)='Y' then EditCell Else Abort:=true;
+      end else
+      begin
+        NewStat:=[Txt];
+        ClearCells;
+        GetText;
+      end;
+    end;
+  end;
+  if not Abort then
+  begin
+    if S<>Chr($FF) then UpDateCells;
+    GotoCell(FX,FY);
+    if AutoCalc and (Constant in Sheet[FX,FY].CellStatus) then Recalculate;
+    if Txt in NewStat then
+    begin
+      GotoXY(3,FY+1); Clreol;
+      For I:='A' to FXMax do
+      LeaveCell(I,FY);
+    end;
+  end;
+  Flash(15,'                ',False);
+  GotoCell(FX,FY);
+end;
+
+{.PA}
+{ Procedure Format is used to }
+
+
+procedure Format;
+var
+  J,FW,DEC,
+  FromLine,ToLine: integer;
+  Lock:            Boolean;
+
+
+  procedure GetInt(var I: integer; Max: Integer);
+  var
+    S: string[8];
+    Err: Integer;
+    Ch: Char;
+  begin
+    S:='';
+    repeat
+      repeat Read(Kbd,Ch) until Ch in ['0'..'9','-',^M];
+      if Ch<>^M then
+      begin
+        Write(Ch); S:=S+Ch;
+        Val(S,I,Err);
+      end;
+    until (I>=Max) or (Ch=^M);
+    if I>Max then I:=Max;
+  end;
+
+begin
+  HighVideo;
+  Msg('Format: Enter number of decimals (Max 11):  ');
+  GetInt(DEC,11);
+  Msg('Enter Cell whith remember if larger than 10 next column will lock: ');
+  GetInt(FW,20);
+  Msg('From which line in column '+FX+': ');
+  GetInt(FromLine,FYMax);
+  Msg('To which line in column '+FX+': ');
+  GetInt(ToLine,FYMax);
+  if FW>10 then Lock:=true else Lock:=False;
+  for J:=FromLine to ToLine do
+  begin
+    Sheet[FX,J].DEC:=DEC;
+    Sheet[FX,J].FW:=FW;
+    with Sheet[Succ(FX),J] do
+    begin
+      if Lock then
+      begin
+        CellStatus:=CellStatus+[Locked,Txt];
+        Contents:='';
+      end else CellStatus:=CellStatus-[Locked];
+    end;
+  end;
+  NormVideo;
+  UpDate;
+  GotoCell(FX,FY);
+end;
+
+
+{.PA}
+{*********************************************************************}
+{*                START OF MAIN PROGRAM PROCEDURES                   *}
+{*********************************************************************}
+
+
+{ Procedure Commands is activated from the main loop in this program }
+{ when the user types a slash (/). a procedure activates a procedure}
+{ which will execute the command. These procedures are located in the}
+{ above modules.                                                     }
+
+{ For easy reference the source code module number is shown in a     }
+{ comment on the right following the procedure call.                 }
+
+procedure Commands;
+begin
+  GotoXY(1,24);
+  HighVideo;
+  Write('/ restore Quit, Load, Save, Recalculate, Print, Format, AutoCalc, Help ');
+  Read(Kbd,Ch);
+  Ch:=UpCase(Ch);
+  case Ch of                                             { In module }
+    'Q': Halt;
+    'F': Format;                                               {  04 }
+    'S': Save;                                                 {  03 }
+    'L': Load;                                                 {  03 }
+    'H': Help;                                                 {  03 }
+    'R': Recalculate;                                          {  05 }
+    'A': Auto;                                                 {  00 }
+    '/': Update;                                               {  01 }
+    'C': Clear;                                                {  01 }
+    'P': Print;                                                {  03 }
+  end;
+  Grid;                                                        {  01 }
+  GotoCell(FX,FY);                                             {  02 }
+end;
+
+{ Procedure Hello says hello and activates the help procedure if the }
+{ user presses anything but Return                                   }
+
+procedure Welcome;
+
+  procedure Center(S: AnyString);
+  var I: integer;
+  begin
+    for I:=1 to (80-Length(S)) div 2 do Write(' ');
+    writeln(S);
+  end;
+
+begin { procedure Wellcome }
+  ClrScr; GotoXY(1,9);
+  Center('Welcome to MicroCalc.  A Turbo demonstation program');
+  Center('Press any key for help or <RETURN> to start');
+  GotoXY(40,12);
+  Read(Kbd,Ch);
+  if Ch<>^M then Help;
+end;
+
+{.PA}
+{*********************************************************************}
+{*          THIS IS WHERE THE PROGRAM STARTS EXECUTING               *}
+{*********************************************************************}
+
+begin
+  Init;                                                        {  01 }
+  Welcome;
+  ClrScr; Grid;                                                {  01 }
+  GotoCell(FX,FY);
+  repeat
+    Read(Kbd,Ch);
+    if KeyPressed then
+    begin
+      read(kbd,Ch);
+      IBMCh(Ch);
+    end;
+    case Ch of
+      ^E:       MoveUp;                                        {  02 }
+      ^X,^J:    MoveDown;                                      {  02 }
+      ^D,^M,^F: MoveRight;                                     {  02 }
+      ^S,^A:    MoveLeft;                                      {  02 }
+      '/':      Commands;
+      ^[:       GetCell(FX,FY);                                {  04 }
+    else
+      if Ch in [' '..'~'] then
+      GetCell(FX,FY);                                          {  04 }
+    end;
+  until true=false;          { (program stops in procedure Commands) }
+end.
+
+
\ No newline at end of file
diff --git a/Borland Turbo Pascal v2/CALCDEMO.MCS b/Borland Turbo Pascal v2/CALCDEMO.MCS
new file mode 100644
index 0000000..70aa48c
Binary files /dev/null and b/Borland Turbo Pascal v2/CALCDEMO.MCS differ
diff --git a/Borland Turbo Pascal v2/CALCMAIN.PAS b/Borland Turbo Pascal v2/CALCMAIN.PAS
new file mode 100644
index 0000000..db57bfc
--- /dev/null
+++ b/Borland Turbo Pascal v2/CALCMAIN.PAS	
@@ -0,0 +1,28 @@
+{ Compile this file if you get the error message: "Compiler overflow"
+  when compiling the file CALC.PAS.
+
+  When developing programs it is a good idea to split the program into
+  several include files, and then have a small main file containing the
+  global variables and Include directives for the different source code
+  modules.You may want to spit the file CALC.PAS into such modules.
+
+  If you want to edit the file CALC.PAS then select it as Work file using
+  the W command.
+
+  The calc demo prorgam CALC.PAS is now included:
+}
+
+
+{$ICALC.PAS}
+
+{ If you have more than 128K RAM it is possible to have the following in
+  RAM at the same time:
+
+   Compiler and Editor
+   CALC.PAS
+   Object code generated for CALC.PAS
+   Data area for CALC.PAS
+
+}
+
+
\ No newline at end of file
diff --git a/Borland Turbo Pascal v2/COLOR.PAS b/Borland Turbo Pascal v2/COLOR.PAS
new file mode 100644
index 0000000..d5aa5ce
--- /dev/null
+++ b/Borland Turbo Pascal v2/COLOR.PAS	
@@ -0,0 +1,133 @@
+program ColorDemo;
+
+type
+  AnyString = string[40];
+
+
+procedure Check;
+var
+  Ch: char;
+begin
+  writeln('This program will only work if you have the color graphics adapter installed');
+  write('Continue Y/N ');
+  repeat read (Kbd,Ch)  until Upcase(Ch) in ['Y','N'];
+  if Upcase(Ch)='N' then Halt;
+end;
+
+
+
+procedure PaletteDemo;
+var
+  Ch: Char;
+  PaletteNumber, Background: integer;
+  PaletteChange: boolean;
+
+  procedure DrawBoxes;
+  var
+    Y: integer;
+  begin
+    for Y:=1 to 24 do Draw(10,10*8+Y,320,10*8+Y,1);
+    for Y:=1 to 24 do Draw(10,13*8+Y,320,13*8+Y,2);
+    for Y:=1 to 24 do Draw(10,16*8+Y,320,16*8+Y,3);
+  end {DrawBoxes};
+
+  procedure Msg(X,Y: integer; S: AnyString);
+  { write the string S at X,Y }
+  begin
+    GotoXY(X,Y);
+    Write(S);
+  end {Msg};
+
+  procedure Help;
+  begin { write the help text}
+    Msg(1,1,'           TURBO COLOR DEMO ');
+    Msg(1,3,'Procedures used:');
+    Msg(1,6,' To make  background: ');
+    Msg(1,7,' To select a palette:  ');
+    Msg(1,9,'Colors in selected palette are:');
+    Msg(1,12,'1');
+    Msg(1,15,'2');
+    Msg(1,18,'3');
+    Msg(1,21,'Use arrows to change palette number');
+    Msg(1,22,'or press B to change Background');
+    GotoXY(1,25);
+    write('Press ESC twice to exit');
+  end {Help};
+
+
+  procedure Update;
+  begin
+    GotoXY(22,6); write('GraphBackground(',Background,') ');
+    GotoXY(22,7); write('Palette(',PaletteNumber,')');
+    GraphBackground(Background);
+    Palette(PaletteNumber);
+    if PaletteChange then
+    begin
+      GotoXY(1,21);
+      writeln('Use arrows to change palette number    ');
+      write('Press B to change Background ');
+    end else
+    begin
+      GotoXY(1,21);
+      writeln('Use arrows to change background number');
+      write('or press P to change Palette    ');
+    end;
+  end {Update};
+
+begin {PaletteDemo}
+  GraphColorMode;
+  BackGround:=0;
+  PaletteNumber:=0;
+  GraphBackground(BackGround);
+  Palette(PaletteNumber);
+  DrawBoxes;
+  Help;
+  Update;
+  repeat
+    repeat read(Kbd,Ch) until Ch in ['P','p','B','b',#27];
+    case Upcase(Ch) of
+      'P': PaletteChange:=true;
+      'B': PaletteChange:=false;
+      #27: begin
+             read(Kbd,Ch);
+             case Ch of
+               'P': begin
+                      if PaletteChange then
+                      begin
+                        PaletteNumber:=PaletteNumber-1;
+                        if PaletteNumber<0 then PaletteNumber:=0;
+                      end else
+                      begin
+                        Background:=BackGround-1;
+                        if BackGround<0 then BackGround:=0;
+                      end;
+                    end;
+               'H': begin
+                      if PaletteChange then
+                      begin
+                        PaletteNumber:=PaletteNumber+1;
+                        if PaletteNumber>3 then PaletteNumber:=3;
+                      end else
+                      begin
+                        Background:=BackGround+1;
+                        if BackGround>15 then BackGround:=15;
+                      end;
+                    end;
+           end;
+         end;
+    end;
+    Update;
+  until Ch=#27;
+end {Palettedemo};
+
+
+
+begin {Main program}
+  Check;
+  PaletteDemo;
+  TextMode;
+end.
+
+
+
+
\ No newline at end of file
diff --git a/Borland Turbo Pascal v2/DOSFCALL.DOC b/Borland Turbo Pascal v2/DOSFCALL.DOC
new file mode 100644
index 0000000..6b7596a
--- /dev/null
+++ b/Borland Turbo Pascal v2/DOSFCALL.DOC	
@@ -0,0 +1,48 @@
+{* WARNING WARNING WARNING WARNING WARNING WARNING WARNING
+
+    Do not try to use the MsDos function call unless you are
+    very familiar with the operating system and have technical
+    information available to you!
+
+   The following program uses the MsDos command in Turbo to
+   retrieve the system date.  This is achieved via DOS function
+   call 42 (or 2A hex).  The function call is placed in the AH
+   register according to the technical reference manual.
+
+   Type in the following code.  The only output is the date
+   at the top of your screen.*}
+
+program GetDate;
+type
+  DateStr = string[10];
+
+function Date: DateStr;
+type
+  regpack = record
+              ax,bx,cx,dx,bp,si,ds,es,flags: integer;
+            end;
+
+var
+  recpack:       regpack;                {record for MsDos call}
+  month,day:     string[2];
+  year:          string[4];
+  dx,cx:         integer;
+
+begin
+  with recpack do
+  begin
+    ax := $2a shl 8;
+  end;
+  MsDos(recpack);                        { call function }
+  with recpack do
+  begin
+    str(cx,year);                        {convert to string}
+    str(dx mod 256,day);                     { " }
+    str(dx shr 8,month);                     { " }
+  end;
+  date := month+'/'+day+'/'+year;
+end;
+
+begin
+  writeln(date);
+end.
\ No newline at end of file
diff --git a/Borland Turbo Pascal v1/OUTCHAR.BAK b/Borland Turbo Pascal v2/DOS_GT.PAS
similarity index 54%
rename from Borland Turbo Pascal v1/OUTCHAR.BAK
rename to Borland Turbo Pascal v2/DOS_GT.PAS
index a3190d7..6272014 100644
--- a/Borland Turbo Pascal v1/OUTCHAR.BAK	
+++ b/Borland Turbo Pascal v2/DOS_GT.PAS	
@@ -1,29 +1,27 @@
-program outchar;
-
 type
   regpack = record
             ax,bx,cx,dx,bp,si,di,ds,es,flags: integer;
             end;
 
-procedure oc( var c : char );
+procedure get_time( var tt : timetype );
 var
   recpack:        regpack;
   ah,al,ch,cl,dh: byte;
 
 begin
-  ah := $8;
+  ah := $2c;
   with recpack do
   begin
     ax := ah shl 8 + al;
-    dh := 87; {c;}
   end;
   intr( $21, recpack );
-
+  with recpack do
+  begin
+    tt.h := cx shr 8;
+    tt.m := cx mod 256;
+    tt.s := dx shr 8;
+    tt.l := dx mod 256;
+  end;
 end;
 
-var c : char;
-begin { outchar }
-  c := 'W';
-  oc( c );
-end. { outchar }
-
\ No newline at end of file
+
diff --git a/Borland Turbo Pascal v2/E.PAS b/Borland Turbo Pascal v2/E.PAS
new file mode 100644
index 0000000..9290430
--- /dev/null
+++ b/Borland Turbo Pascal v2/E.PAS	
@@ -0,0 +1,42 @@
+program e;
+
+const
+   DIGITS = 200;
+
+type
+    arrayType = array[ 0..DIGITS ] of integer;
+
+var
+    high, n, x : integer;
+    a : arrayType;
+
+begin
+    high := DIGITS;
+    x := 0;
+
+    n := high - 1;
+    while n > 0 do begin
+        a[ n ] := 1;
+        n := n - 1;
+    end;
+
+    a[ 1 ] := 2;
+    a[ 0 ] := 0;
+
+    while high > 9 do begin
+        high := high - 1;
+        n := high;
+        while 0 <> n do begin
+            a[ n ] := x MOD n;
+            x := 10 * a[ n - 1 ] + x DIV n;
+            n := n - 1;
+        end;
+
+        Write( x );
+    end;
+
+    writeln;
+    writeln( 'done' );
+end.
+
+
\ No newline at end of file
diff --git a/Borland Turbo Pascal v2/EXTERNAL.DOC b/Borland Turbo Pascal v2/EXTERNAL.DOC
new file mode 100644
index 0000000..1f83023
--- /dev/null
+++ b/Borland Turbo Pascal v2/EXTERNAL.DOC	
@@ -0,0 +1,89 @@
+
+; * WARNING WARNING WARNING WARNING WARNING WARNING WARNING *
+
+;   Please do not try to use external procedures
+;   unless you are familiar with assembly language.
+;
+;   IMPORTANT: Externals must be written in assembly language.
+;
+;   The following example translates a string to upper case.
+
+;
+;   Place the following code in a file: "STU.ASM"
+;
+
+
+CODE    SEGMENT
+        ASSUME     CS:CODE
+
+STU     PROC       NEAR
+
+        PUSH       BP                    ; SAVE ENVIRONMENT
+        MOV        BP,SP                 ; MANUAL PAGE 189
+
+        LES        DI,[BP+4]             ; GET PARAMETER
+        MOV        CL,ES:[DI]
+        INC        CL
+L1:     DEC        CL
+        JZ         L2
+        INC        DI
+        CMP        ES:BYTE PTR[DI],'a'
+        JB         L1
+        CMP        ES:BYTE PTR[DI],'z'
+        JA         L1
+        SUB        ES:BYTE PTR[DI],20H
+        JMP        SHORT L1
+
+L2:     MOV        SP,BP                 ; RESTORE ENVIRONMENT
+        POP        BP                    ; MANUAL PAGE 190
+        RET        4
+STU     ENDP
+CODE    ENDS
+        END
+
+; Now exit to PC-DOS and type:
+;
+; ASM STU
+; LINK STU
+; EXE2BIN STU.EXE STU.COM
+;
+; IGNORE MINOR ERRORS FROM ASM AND LINK
+
+
+
+To use, write the following program:
+
+
+type
+  AnyString = string[255];
+
+var
+  S: AnyString;
+  I: integer;
+
+
+procedure STU(var S: AnyString); external 'STU.COM';
+
+begin
+  readln(S);
+  STU(S);
+  writeln(S);
+end.
+
+
+
+
+;   The above external procedure is only an example. You
+;   can achieve the same result in Turbo-Pascal:
+;
+;   procedure STU(var S: AnyString);
+;   var
+;     I: integer;
+;   begin
+;     for I:=1 to Length(S) do S[I]:=Upcase(S[I]);
+;   end;
+;
+;   So why bother ?????
+
+
+
\ No newline at end of file
diff --git a/Borland Turbo Pascal v2/INTRPTCL.DOC b/Borland Turbo Pascal v2/INTRPTCL.DOC
new file mode 100644
index 0000000..1ead8d8
--- /dev/null
+++ b/Borland Turbo Pascal v2/INTRPTCL.DOC	
@@ -0,0 +1,47 @@
+{* WARNING WARNING WARNING WARNING WARNING WARNING WARNING
+    In order to use the Intr procedure in Turbo Pascal you
+    must be familiar with interrupts and have access to a
+    technical reference manual.
+
+    The following program uses the Intr function in Turbo to
+    get the time.  Registers have to be set correctly according
+    to the DOS technical reference manual before the function
+    is called.
+
+    The program simply returns the time in a string at the top
+    of the screen.*}
+
+program TimeInterrupt;
+type
+  TimeString = string[8];
+
+function time: TimeString;
+type
+  regpack = record
+              ax,bx,cx,dx,bp,di,si,ds,es,flags: integer;
+            end;
+
+var
+  recpack:          regpack;             {assign record}
+  ah,al,ch,cl,dh:   byte;
+  hour,min,sec:     string[2];
+
+begin
+  ah := $2c;                             {initialize correct registers}
+  with recpack do
+  begin
+    ax := ah shl 8 + al;
+  end;
+  intr($21,recpack);                     {call interrupt}
+  with recpack do
+  begin
+    str(cx shr 8,hour);                  {convert to string}
+    str(cx mod 256,min);                       { " }
+    str(dx shr 8,sec);                         { " }
+  end;
+  time := hour+':'+min+':'+sec;
+end;
+
+begin
+  writeln(time);
+end.
\ No newline at end of file
diff --git a/Borland Turbo Pascal v2/READ.ME b/Borland Turbo Pascal v2/READ.ME
new file mode 100644
index 0000000..ee625d3
--- /dev/null
+++ b/Borland Turbo Pascal v2/READ.ME	
@@ -0,0 +1,26 @@
+                   RUN-TIME ERRORS IN OVERLAYS
+                   ---------------------------
+
+
+     Run-time  errors occurring in overlays are found  as  usual,
+and  an  address  is issued by the error  handling  system.  This
+address,  however,  is  an address within the overlay  area,  and
+there  is no way of knowing which overlay subprogram was actually
+active when the error occurred.
+     Run-time  errors  in overlays can therefore  not  always  be
+readily  found  with  the Options menu's  'Find  run-time  error'
+facility.  What 'Find run-time error' will point out is the first
+occurrence of code at the specified address. This, of course, may
+be  the place of the error,  but the error may as well occur in a
+subsequent subprogram within the same overlay group.
+     This  it not a serious limitation,  however,  as the type of
+error  and  the way it occurs most often will indicate to you  in
+which subprogram the error happened.  The way to locate the error
+precisely is then to place the suspected subprogram as the  first
+subprogram of the overlay group.  'Find run-time error' will then
+work.
+     THE BEST THING TO DO IS NOT TO PLACE SUBPROGRAMS IN OVERLAYS
+UNTIL THEY HAVE BEEN FULLY DEBUGGED!
+
+
+
\ No newline at end of file
diff --git a/Borland Turbo Pascal v2/SIEVE.PAS b/Borland Turbo Pascal v2/SIEVE.PAS
new file mode 100644
index 0000000..12729cf
--- /dev/null
+++ b/Borland Turbo Pascal v2/SIEVE.PAS	
@@ -0,0 +1,31 @@
+program sieve;
+
+const
+    size = 8190;
+
+type
+    flagType = array[ 0..size ] of boolean;
+
+var
+    i, k, prime, count, iter : integer;
+    flags : flagType;
+
+begin
+    for iter := 1 to 10 do begin
+        count := 0;
+        for i := 0 to size do flags[ i ] := true;
+        for i := 0 to size do begin
+            if flags[ i ] then begin
+                prime := i + i + 3;
+                k := i + prime;
+                while k <= size do begin
+                    flags[ k ] := false;
+                    k := k + prime;
+                end;
+                count := count + 1;
+            end;
+        end;
+    end;
+
+    writeln( 'count of primes: ', count );
+end.
\ No newline at end of file
diff --git a/Borland Turbo Pascal v2/SOUND.PAS b/Borland Turbo Pascal v2/SOUND.PAS
new file mode 100644
index 0000000..845930a
--- /dev/null
+++ b/Borland Turbo Pascal v2/SOUND.PAS	
@@ -0,0 +1,76 @@
+program SoundDemo;
+
+
+type
+  NoteRecord = record
+                  C,CF,D,DF,E,F,FF,G,GF,A,AF,B: integer;
+               end;
+
+Const
+  Notes: NoteRecord =
+          (C:1;CF:2;D:3;DF:4;E:5;F:6;FF:7;G:8;GF:9;A:10;AF:11;B:12);
+
+
+procedure Play(Octave,Note,Duration: integer);
+
+{ Play Note in Octave Duration milliseconds  }
+{ Frequency computed by first computing C in }
+{ Octave then increasing frequency by Note-1 }
+{ times the twelfth root of 2. (1.059463994) }
+{                                            }
+{ If Duration is zero  Note will be played   }
+{ until you activate procedure NoSound       }
+
+var
+  Frequency: real;
+  I: integer;
+begin
+  Frequency:=32.625;
+  { Compute C in Octave }
+  for I:=1 to Octave do Frequency:=Frequency*2;
+  { Increase frequency Note-1 times }
+  for I:=1 to Note-1 do Frequency:=Frequency*1.059463094;
+  if Duration<>0 then
+  begin
+    Sound(Round(Frequency));
+    Delay(Duration);
+    NoSound;
+  end else Sound(Round(Frequency));
+end;
+
+
+procedure SoftAlarm;
+{ Play the notes G and D in octave three 7 times }
+{ each with a duration of 70 milliseconds.       }
+var
+  I: integer;
+begin
+  for I:=1 to 7 do with Notes do
+  begin
+    Play(4,G,70);
+    Play(4,D,70);
+  end;
+  Delay(1000);
+end;
+
+
+procedure Sirene;
+var
+  Frequency: integer;
+begin
+  for Frequency:= 500 to     2000 do begin Delay(1); Sound(Frequency); end;
+  for Frequency:=2000 downto  500 do begin Delay(1); Sound(Frequency); end;
+end;
+
+
+begin
+  writeln('Press any key to Stop');
+  repeat SoftAlarm until KeyPressed;
+  read(Kbd);
+  writeln('Press any key to Stop');
+  repeat Sirene until KeyPressed;
+  NoSound;
+end.
+
+
+
\ No newline at end of file
diff --git a/Borland Turbo Pascal v2/TIMEUTIL.PAS b/Borland Turbo Pascal v2/TIMEUTIL.PAS
new file mode 100644
index 0000000..2a7c17e
--- /dev/null
+++ b/Borland Turbo Pascal v2/TIMEUTIL.PAS	
@@ -0,0 +1,65 @@
+type
+  timetype = record h, m, s, l : integer; end;
+
+procedure time_difference( var tStart, tEnd, tDiff : timetype );
+var
+  startSecond, startMinute, startHour : integer;
+
+begin { time_difference }
+  startSecond := tStart.s;
+  startMinute := tStart.m;
+  startHour := tStart.h;
+
+  tDiff.l := tEnd.l - tStart.l;
+  if ( tDiff.l < 0 ) then
+  begin
+    tDiff.l := tDiff.l + 100;
+    startSecond := startSecond + 1;
+  end;
+
+  tDiff.s := tEnd.s - startSecond;
+  if ( tDiff.s < 0 ) then
+  begin
+    tDiff.s := tDiff.s + 60;
+    startMinute := startMinute + 1;
+  end;
+
+  tDiff.m := tEnd.m - startMinute;
+  if ( tDiff.m < 0 ) then
+  begin
+    tDiff.m := tDiff.m + 60;
+    startHour := startHour + 1;
+  end;
+
+  tDiff.h := tEnd.h - startHour;
+  if ( tDiff.h < 0 ) then
+    tDiff.h := tDiff.h + 12;
+end;
+
+procedure print_time_part( num : integer );
+begin
+  if ( num < 10 ) then write( '0' );
+  write( num );
+end;
+
+procedure print_time( var t: timetype );
+begin
+  print_time_part( t.h );
+  write( ':' );
+  print_time_part( t.m );
+  write( ':' );
+  print_time_part( t.s );
+  write( '.' );
+  print_time_part( t.l );
+end;
+
+procedure print_elapsed_time( var timeStart, timeEnd: timetype );
+var
+  timeDiff: timetype;
+begin
+  time_difference( timeStart, timeEnd, timeDiff );
+  write( 'elapsed time: ' );
+  print_time( timeDiff );
+  writeln;
+end;
+
\ No newline at end of file
diff --git a/Borland Turbo Pascal v2/TINST.COM b/Borland Turbo Pascal v2/TINST.COM
new file mode 100644
index 0000000..d784648
Binary files /dev/null and b/Borland Turbo Pascal v2/TINST.COM differ
diff --git a/Borland Turbo Pascal v2/TINST.MSG b/Borland Turbo Pascal v2/TINST.MSG
new file mode 100644
index 0000000..75ec0a4
--- /dev/null
+++ b/Borland Turbo Pascal v2/TINST.MSG	
@@ -0,0 +1,129 @@
+1                  TURBO Pascal installation menu.
+2           Choose installation item from the following:
+3 
+4 [S]creen installation   |   [C]ommand installation   |   [Q]uit
+5 
+6                        Enter S, C, or Q:
+10 Duplicate definition. Error occurred between question
+11 Commands starting with the same letter must have the same length.
+   Error occurred between question
+12 The total maximum length of commands are execeeded
+13  ->
+
+
+14 CURSOR MOVEMENTS:
+
+20  Character left               
+21    Alternative                
+22  Character right              
+23  Word left                    
+24  Word right                   
+25  Line up                      
+26  Line down                    
+27  Scroll down                  
+28  Scroll up                    
+29  Page up                      
+30  Page down                    
+31  To left on line              
+32  To right on line             
+33  To top of page               
+34  To bottom of page            
+35  To top of file               
+36  To end of file               
+37  To begining of block         
+38  To end of block              
+39  To last cursor position      
+
+
+15 INSERT & DELETE:
+
+40  Insert mode on/off           
+41  Insert line                  
+42  Delete line                  
+43  Delete to end of line        
+44  Delete right word            
+45  Delete character under cursor
+46  Delete left character        
+47    Alternative                
+
+
+16 BLOCK COMMANDS:
+
+48  Mark block begin             
+49  Mark block end               
+50  Mark single word             
+51  Hide/display block           
+52  Copy block                   
+53  Move block                   
+54  Delete block                 
+55  Read block from disk         
+56  Write block to disk          
+
+
+17 MISC. EDITING COMMANDS:  
+
+57  End edit                     
+58  Tab                          
+59  Auto tab on/off              
+60  Restore line                 
+61  Find                         
+62  Find & replace               
+63  Repeat last find             
+64  Control character prefix     
+
+101 Nothing
+ ^Q: Quit, ^R: Last page, ^C: Next page, <RETURN>: Select terminal:
+ Wait Sorting Definitions
+ Change to:
+ (Y/N)? 
+ y
+ n
+ Text file name:
+ Command:
+ Numeric entry expected
+ Legal range is 
+ , please re-enter: 
+ Choose one of the following terminals:
+ None of the above   ( Max. 20 Characters )
+ Delete a definition ( Max. 20 Characters )
+ Which terminal? (Enter no. or ^Q to exit): 
+ Delete terminal? (Enter no. or ^Q to exit):
+ Do you want to modify this definition before installation? 
+ Terminal type:
+ Send an initialization string to the terminal?
+ Initializaion defined as a command string? (No = a file)
+ Send a reset string to the terminal
+ Reset defined as a command? (No = a file)
+ CURSOR LEAD-IN command: 
+ CURSOR POSITIONING COMMAND to send between line and column:   
+ CURSOR POSITIONING COMMAND to send after both line and column:
+ Column first
+ OFFSET to add to LINE:  
+ OFFSET to add to COLUMN:
+ Binary address
+ Number of ASCII digits (2 or 3): 
+ CLEAR SCREEN command: 
+ Does CLEAR SCREEN also HOME cursor
+ HOME command: 
+ DELETE LINE command: 
+ INSERT LINE command: 
+ ERASE TO END OF LINE command:
+ START HIGHLIGHTING command:  
+ END HIGHLIGHTING command:    
+ Number of rows (lines) on your screen: 
+ Number of columns on your screen:      
+ Delay after CURSOR ADDRESS (0-255 ms):                     
+ Delay after CLEAR, DELETE and INSERT (0-255 ms):           
+ Delay after ERASE TO END OF LINE and HIGHLIGHT (0-255 ms): 
+ Is this definition correct?
+                     Hardware dependent information
+ Operating frequency of your microprocessor in MHz (for delays):
+200 Choose one of the following displays:
+201 Which display? (Enter no. or ^Q to exit): 
+202 Default display mode
+203 Monochrome display
+204 Color display 80x25
+205 Color display 40x25
+206 b/w   display 80x25
+207 b/w   display 40x25
+
\ No newline at end of file
diff --git a/Borland Turbo Pascal v2/TLIST.COM b/Borland Turbo Pascal v2/TLIST.COM
new file mode 100644
index 0000000..469cdf0
Binary files /dev/null and b/Borland Turbo Pascal v2/TLIST.COM differ
diff --git a/Borland Turbo Pascal v2/TTT.PAS b/Borland Turbo Pascal v2/TTT.PAS
new file mode 100644
index 0000000..8313422
--- /dev/null
+++ b/Borland Turbo Pascal v2/TTT.PAS	
@@ -0,0 +1,287 @@
+{ App to prove you can't win at Tic-Tac-Toe }
+
+program ttt;
+{$I timeutil.pas}
+{$I dos_gt.pas }
+
+const
+    scoreWin = 6;
+    scoreTie = 5;
+    scoreLose = 4;
+    scoreMax = 9;
+    scoreMin = 2;
+    scoreInvalid = 0;
+
+    pieceBlank = 0;
+    pieceX = 1;
+    pieceO = 2;
+
+    iterations = 1;
+
+type
+    boardType = array[ 0..8 ] of integer;
+    CommandString = string[127];
+
+var
+    evaluated: integer;
+    board: boardType;
+    timeStart, timeEnd: timetype;
+
+procedure dumpBoard;
+var
+    i : integer;
+begin
+    Write( '{' );
+    for i := 0 to 8 do
+        Write( board[i] );
+    Write( '}' );
+end;
+
+function lookForWinner : integer;
+var
+    t, p : integer;
+begin
+    {dumpBoard;}
+    p := pieceBlank;
+    t := board[ 0 ];
+    if pieceBlank <> t then
+    begin
+        if ( ( ( t = board[1] ) and ( t = board[2] ) ) or
+             ( ( t = board[3] ) and ( t = board[6] ) ) ) then
+            p := t;
+    end;
+
+    if pieceBlank = p then
+    begin
+        t := board[1];
+        if ( t = board[4] ) and ( t = board[7] ) then
+            p := t
+        else
+        begin
+            t := board[2];
+            if ( t = board[5] ) and ( t = board[8] ) then
+                p := t
+            else
+            begin
+                t := board[3];
+                if ( t = board[4] ) and ( t = board[5] ) then
+                    p := t
+                else
+                begin
+                    t := board[6];
+                    if ( t = board[7] ) and ( t = board[8] ) then
+                        p := t
+                    else
+                    begin
+                      t := board[4];
+                      if ( ( ( t = board[0] ) and ( t = board[8] ) ) or
+                           ( ( t = board[2] ) and ( t = board[6] ) ) ) then
+                          p := t
+                    end;
+                end;
+            end;
+        end;
+    end;
+
+    lookForWinner := p;
+end;
+
+function winner2( move: integer ) : integer;
+var
+    x : integer;
+begin
+    case move of
+        0:  begin
+            x := board[ 0 ];
+            if not ( ( ( x = board[1] ) and ( x = board[2] ) ) or
+                     ( ( x = board[3] ) and ( x = board[6] ) ) or
+                     ( ( x = board[4] ) and ( x = board[8] ) ) )
+                then x := PieceBlank;
+            end;
+        1:  begin
+            x := board[ 1 ];
+            if not ( ( ( x = board[0] ) and ( x = board[2] ) ) or
+                     ( ( x = board[4] ) and ( x = board[7] ) ) )
+                then x := PieceBlank;
+            end;
+        2:  begin
+            x := board[ 2 ];
+            if not ( ( ( x = board[0] ) and ( x = board[1] ) ) or
+                     ( ( x = board[5] ) and ( x = board[8] ) ) or
+                     ( ( x = board[4] ) and ( x = board[6] ) ) )
+                then x := PieceBlank;
+            end;
+        3:  begin
+            x := board[ 3 ];
+            if not ( ( ( x = board[4] ) and ( x = board[5] ) ) or
+                     ( ( x = board[0] ) and ( x = board[6] ) ) )
+                then x := PieceBlank;
+            end;
+        4:  begin
+            x := board[ 4 ];
+            if not ( ( ( x = board[0] ) and ( x = board[8] ) ) or
+                     ( ( x = board[2] ) and ( x = board[6] ) ) or
+                     ( ( x = board[1] ) and ( x = board[7] ) ) or
+                     ( ( x = board[3] ) and ( x = board[5] ) ) )
+                then x := PieceBlank;
+            end;
+        5:  begin
+            x := board[ 5 ];
+            if not ( ( ( x = board[3] ) and ( x = board[4] ) ) or
+                     ( ( x = board[2] ) and ( x = board[8] ) ) )
+                then x := PieceBlank;
+            end;
+        6:  begin
+            x := board[ 6 ];
+            if not ( ( ( x = board[7] ) and ( x = board[8] ) ) or
+                     ( ( x = board[0] ) and ( x = board[3] ) ) or
+                     ( ( x = board[4] ) and ( x = board[2] ) ) )
+                then x := PieceBlank;
+            end;
+        7:  begin
+            x := board[ 7 ];
+            if not ( ( ( x = board[6] ) and ( x = board[8] ) ) or
+                     ( ( x = board[1] ) and ( x = board[4] ) ) )
+                then x := PieceBlank;
+            end;
+        8:  begin
+            x := board[ 8 ];
+            if not ( ( ( x = board[6] ) and ( x = board[7] ) ) or
+                     ( ( x = board[2] ) and ( x = board[5] ) ) or
+                     ( ( x = board[0] ) and ( x = board[4] ) ) )
+                then x := PieceBlank;
+            end;
+    end;
+
+    winner2 := x;
+end;
+
+function minmax( alpha: integer; beta: integer; depth: integer; move: integer ): integer;
+var
+    p, value, pieceMove, score : integer;
+begin
+    evaluated := evaluated + 1;
+    value := scoreInvalid;
+    if depth >= 4 then
+    begin
+        { p := lookForWinner; }  { this is much slower }
+        p := winner2( move );
+        if p <> pieceBlank then
+        begin
+            if p = pieceX then
+                value := scoreWin
+            else
+                value := scoreLose
+        end
+        else if depth = 8 then
+            value := scoreTie;
+    end;
+
+    if value = scoreInvalid then
+    begin
+        if Odd( depth ) then
+        begin
+            value := scoreMin;
+            pieceMove := pieceX;
+        end
+        else
+        begin
+            value := scoreMax;
+            pieceMove := pieceO;
+        end;
+
+        p := 0;
+        repeat
+            if board[ p ] = pieceBlank then
+            begin
+                board[ p ] := pieceMove;
+                score := minmax( alpha, beta, depth + 1, p );
+                board[ p ] := pieceBlank;
+
+                if Odd( depth ) then
+                begin
+                    if ( score > value ) then
+                    begin
+                        value := score;
+                        if ( value = scoreWin ) or ( value >= beta ) then p := 10
+                        else if ( value > alpha ) then alpha := value;
+                    end;
+                end
+                else
+                begin
+                    if ( score < value ) then
+                    begin
+                        value := score;
+                        if ( value = scoreLose ) or ( value <= alpha ) then p := 10
+                        else if ( value < beta ) then beta := value;
+                    end;
+                end;
+            end;
+            p := p + 1;
+        until p > 8;
+    end;
+
+    minmax := value;
+end;
+
+procedure runit( move : integer );
+var
+    score: integer;
+begin
+    board[move] := pieceX;
+    score := minmax( scoreMin, scoreMax, 0, move );
+    board[move] := pieceBlank;
+end;
+
+function Trim( intext : CommandString ): CommandString;
+var FirstPos, LastPos: integer;
+begin
+    FirstPos := 1;
+    while ( FirstPos <= Length( intext ) ) and ( intext[FirstPos] = #32 ) do
+        FirstPos := FirstPos + 1;
+  
+    LastPos := Length( intext );
+    while ( LastPos >= 1 ) and ( intext[LastPos] = #32 ) do
+        LastPos := LastPos - 1;
+  
+    Trim := Copy( intext, FirstPos, LastPos - FirstPos + 1 );
+end;
+
+var
+    i, loops, errpos: integer;
+    strArg : CommandString;
+    cmdTail : CommandString absolute Cseg : $80;
+begin
+    loops := Iterations;
+  
+    { not available on TP v1
+    if 0 <> Length( ParamStr( 1 ) ) then Val( ParamStr( 1 ), loops, errpos );
+    }
+  
+    if Length( cmdTail ) > 0 then
+    begin
+        { trim the space at the start that's always there }
+        strArg := Trim( cmdTail );
+        Val( strArg, loops, errpos );
+    end;
+  
+    for i := 0 to 8 do
+        board[i] := pieceBlank;
+  
+    WriteLn( 'begin' );
+    get_time( timeStart );
+  
+    for i := 1 to loops do
+    begin
+        evaluated := 0;  { once per loop to prevent overflow }
+        runit( 0 );
+        runit( 1 );
+        runit( 4 );
+    end;
+  
+    get_time( timeEnd );
+    print_elapsed_time( timeStart, timeEnd );
+  
+    WriteLn( 'moves evaluated: ', evaluated );
+    WriteLn( 'iterations: ', loops );
+end.
diff --git a/Borland Turbo Pascal v2/TURBO.COM b/Borland Turbo Pascal v2/TURBO.COM
new file mode 100644
index 0000000..acb3ea1
Binary files /dev/null and b/Borland Turbo Pascal v2/TURBO.COM differ
diff --git a/Borland Turbo Pascal v2/TURBO.MSG b/Borland Turbo Pascal v2/TURBO.MSG
new file mode 100644
index 0000000..56a7b69
--- /dev/null
+++ b/Borland Turbo Pascal v2/TURBO.MSG	
@@ -0,0 +1,105 @@
+ are not allowed
+ can not be
+ constant
+ does not
+ expression
+ identifier
+ file
+ here
+Integer
+File
+Illegal
+ or
+Undefined
+ match
+ real
+String
+Textfile
+ out of range
+ variable
+ overflow
+ expected
+ type
+Invalid
+ pointer
+01';'
+02':'
+03','
+04'('
+05')'
+06'='
+07':='
+08'['
+09']'
+10'.'
+11'..'
+12BEGIN
+13DO
+14END
+15OF
+16PROCEDURE FUNCTION
+17THEN
+18TO DOWNTO
+20Boolean
+21
+22
+23
+24
+25
+26
+27
+28Pointer
+29Record
+30Simple
+31Simple
+32
+33
+34
+35
+36Type
+37Untyped
+40 label
+41Unknown syntax error
+42 in preceding definitions
+43Duplicate label
+44Type mismatch
+45
+46 and CASE selector
+47Operand(s) operator
+48 result
+49  length
+50 length
+51 subrange base
+52Lower bound > upper bound
+53Reserved word
+54 assignment
+55 exceeds line
+56Error in integer
+57Error in
+58 character in
+60s
+61s ands
+62Structureds
+63s
+64s and untypeds
+65Untypeds
+66I/O
+67s must be parameters
+68 componentss
+69dering of fields
+70Set base
+71 GOTO
+72Label not within current block
+73 FORWARD procedure(s)
+74INLINE error
+75 use of ABSOLUTE
+76Overlays forwarded
+77Overlays in direct mode
+90 not found
+91Unexpected end of source
+92Unable to create overlay
+93 compiler directive
+96Nested include
+97Too many nested WITH's
+98Memory
+99Compiler
\ No newline at end of file
diff --git a/Borland Turbo Pascal v2/WINDOW.PAS b/Borland Turbo Pascal v2/WINDOW.PAS
new file mode 100644
index 0000000..f440c29
--- /dev/null
+++ b/Borland Turbo Pascal v2/WINDOW.PAS	
@@ -0,0 +1,112 @@
+program TestWindow;
+{$C-}
+
+const
+   Windows    = 3;
+   Wtab       : array[1..Windows,1..5] of Integer
+                = (( 5,  2,  35, 11,  1), { X0,Y0,X1,Y1,LineNo }
+                   (45,  2,  75, 11,  1),
+                   ( 5, 15,  75, 23,  1)
+                  );
+type
+   String255  = String[255];
+
+var
+   i          : Integer;
+   Ch         : Char;
+
+
+   procedure Frame(UpperLeftX, UpperLeftY, LowerRightX, LowerRightY: Integer);
+   var
+      i: Integer;
+   begin
+      GotoXY(UpperLeftX, UpperLeftY);  Write(chr(218));
+      for i:=UpperLeftX+1 to LowerRightX-1 do Write(chr(196));
+      Write(chr(191));
+      for i:=UpperLeftY+1 to LowerRightY-1 do
+      begin
+         GotoXY(UpperLeftX , i);  Write(chr(179));
+         GotoXY(LowerRightX, i);  Write(chr(179));
+      end;
+      GotoXY(UpperLeftX, LowerRightY);
+      Write(chr(192));
+      for i:=UpperLeftX+1 to LowerRightX-1 do Write(chr(196));
+      Write(chr(217));
+   end  { Frame };
+
+
+   function RanStr(Len: Integer): String255;
+   var
+      S: String255;
+      i: Integer;
+   begin
+      S[0]:=Chr(Len);
+      for Len:=1 to Len do
+      begin
+         repeat  i:=Random(255)  until not (Chr(I) in[^@,^G,^H,^J,^M]);
+         S[Len]:=Chr(i);
+      end;
+      RanStr:=S;
+   end  { RanStr };
+
+
+   procedure SelectWindow(Win: Integer);
+   begin
+      Window(Wtab[Win,1], Wtab[Win,2], Wtab[Win,3], Wtab[Win,4])
+   end  { SelectWindow };
+
+
+   procedure Window1;
+   begin
+      LowVideo;
+      SelectWindow(1);
+      GotoXY(1,1);
+      DelLine;
+      GotoXY(1, Wtab[1,4]-Wtab[1,2]+1);
+      Write('Line ', Wtab[1,5]:5,' ',chr(219),' ',RanStr(15));
+      Wtab[1,5]:=Succ(Wtab[1,5]);
+      NormVideo;
+   end  { Window1 };
+
+   procedure Window2;
+   begin
+      LowVideo;
+      SelectWindow(2);
+      GotoXY(1,1);
+      DelLine;
+      GotoXY(1, Wtab[2,4]-Wtab[2,2]+1);
+      Write('Line ', Wtab[2,5]:5,' ',chr(219),' ',RanStr(15));
+      Wtab[2,5]:=Succ(Wtab[2,5]);
+      NormVideo;
+   end  { Window2 };
+
+
+   procedure Window3;
+   begin
+      LowVideo;
+      SelectWindow(3);
+      GotoXY(1,1);
+      InsLine;
+      WriteLn('Line ', Wtab[3,5]:5,' ',chr(219),' ',RanStr(55));
+      Wtab[3,5]:=Succ(Wtab[3,5]);
+      NormVideo;
+   end  { Window3 };
+
+begin
+   GotoXY(15,25);
+   Write('TURBO PASCAL Window Demo  -  Press any key to stop');
+
+   for i:=1 to Windows do
+      Frame(Wtab[i,1]-1, Wtab[i,2]-1, Wtab[i,3]+1, Wtab[i,4]+1);
+
+   repeat
+      Window1;
+      Window2;
+      Window3;
+   until KeyPressed;
+   Read(KBD, Ch);
+   Window(1,1,80,25);
+   GotoXY(1,24);
+
+end.
+
\ No newline at end of file
diff --git a/Borland Turbo Pascal v2/m.bat b/Borland Turbo Pascal v2/m.bat
new file mode 100644
index 0000000..c5ad3b6
--- /dev/null
+++ b/Borland Turbo Pascal v2/m.bat	
@@ -0,0 +1,3 @@
+rem there are no command-line tools for turbo pascal. Run the app and compile from within.
+
+
