Detect Borland TLINK version

Author: madebrCreated Jul 30, 2026Updated Aug 11, 2026
Labelssuggestion

I was looking into tdump.exe of Borland C++ 4.0 and found this code dumping the TLINK version: Image

I think this code is equivalent to the signature below. I'm creating this as an issue and not a pr since I do not know how to format the version string.

javascript
// Using MSDOS.js api: help/MSDOS.js
// inspired by: db/MSDOS/linker_Borland_TLINK.5.sg

meta("linker", "Borland TLINK");

function detect() {
  var magic1 = MSDOS.readSByte(0x1e);
  if (magic1 == -5) {
    var magic2 = MSDOS.readWord(0x20);
    if (magic2 == 0x6a72 || magic2 == 0x726a) {
      var version_byte = MSDOS.readByte(0x1f);
      var major = version_byte >> 4;
      var minor = version_byte & 0x0f;
      sVersion = format("%d.%02d", major, minor);
      bDetected = true;
    }
  }
}