Wow, Turbo Pascal! That brings back memories...
I hired a guy to write a test program for me. Running 24 hours per day, it took about 5 days to reach a result.
I knew that the problem lay in a buffer compare routine.
I had the guy rework the code such that this was a sub which "touched" all the vars that I needed.
I took the floppy back to my office and hacked in the binary code for the new "string" operations that Intel had for the 80186. Cut the execution time down to about 8 hours.
PS: I still have a pre-production 6 Mhz IBM PC with a 5MB Quantum hard card. Free to anybody who wants it. Production models were 8 Mhz. This thing boots and works, even has Lotus 123 on it!