MODIFICATION TO TURBO PASCAL 3.01A TO RUN ON THE PORTFOLIO



Copyright (c) 1991, BJ Gleason



This document will tell you have to make a minor modification to

Borland's Turbo Pascal, version 3.01a, (TP3) to have it run on

the Atari Portfolio Computer.



WHY TP3 WILL NOT RUN



It will... it just takes an amazingly long time.  When TP3 starts

up, it tries to determine the clock speed of the computer.  It

does this by waiting for a couple of timer ticks.  On a standard

PC, these ticks are generated 18.2 times a second.  On the

Portfolio, these ticks occur about every 2 MINUTES!  So TP3 sits

and waits.



It needs to determine the speed for the DELAY and SOUND

functions.



WHAT NEEDS TO BE DONE



The result of the speed determination is stored in memory. 

Instead of calculating this variable automatically, we will place

a constant value in there, and skip the calculation.



The constant value will be hexadecimal EC.  The is the number TP3

calculates for a standard 4.77 Mhz PC.  This is the duration for

1ms.  Since the Portfolio run slightly faster, you may want to

adjust this value upwards.  I did not, since EC should be close

enough.



MODIFYING TP3



You will need TURBO.COM and DEBUG.COM.



1.   Make a copy of TP3 to patch.  DO NOT MODIFY YOUR ORIGINAL!



          COPY TURBO.COM PURBO.COM



2.   Execute DEBUG to patch PURBO.COM



          DEBUG PURBO.COM



3.   Find the speed variable.  The code for initialization it

     should be at address 199 hex.



     -U 199

     xxxx:0199      MOV WORD PTR [0012],006E

     :

     :

     -



     If you do not see this statement at address 199, look about

     for it.  If the address is different, the rest of the

     addresses will also be different.



4.   Modify the 006E to 00EC.



     -E 19d

     xxxx:019D 6E.EC<return>

     -



5.   Insert a RET instruction to skip the rest of the routines.



     -E 19F

     xxxx:019F 2E.C3<return>

     -



6.   Save it and exit DEBUG.



     -w

     Writing xxxx bytes

     -q

     C:\>



7.   To use PURBO.COM, you should set the following system

     variables  (/|\ S):



          DISPLAY EXTERNAL    -> TRACKED

          REFRESH             -> BOTH



8.   Now you should be able to edit, run and compile TP3 programs

     on the Portfolio.  The compiled programs will also run on

     the PC, but any the timing might be off, depending on the

     clock speed of the PC.



Enjoy.



bj gleason   73337,2011

