TOPBENCH was written in Turbo Pascal 7.0, with the very important exception of the metric suite code, which was written entirely in assembler so that its performance characteristics wouldn’t rely on compiler output. The basic stub functions, like the metric code suites and video subsystem detection, were all written on an IBM 5160 (IBM PC/XT) with both CGA and MDA monitors attached. (More complicated detection was handled by pre-existing detection libraries, although I made some bugfixes to the code wherever I found them.) The larger TOPBENCH utility code (user interface, object routines, comparison code, etc.) was coded in DOSBox on a modern machine for speed and convenience. The TOPBENCH source including all libraries is roughly 38K lines of pascal and assembler.
The TOPBENCH source code is at GitHub. Grab the source if you think you can stomach Pascal and Assembler code in a git repository. For complete compilation, you will probably also need the contents of the UNITS repo.