3 ms·
Well, Sawyer started writing Transport Tycoon in 1992, when free or affordable C compilers were not as widely available. Turbo C was never known for optimizatio
by orthoxerox 7mo ago
Well, Sawyer started writing Transport Tycoon in 1992, when free or affordable C compilers were not as widely available. Turbo C was never known for optimizations. GCC 1.40 was good enough for Linus, but I guess Chris was already a good assembly programmer.
- fweimer 7mo agoTurbo C++ 3.0 from 1992 already does this optimization, according to a quick experiment over there: https://turboc.pages.dev/ https://turboc.pages.dev/ 0: 55 push %bp 1: 8b ec mov %sp,%bp 3: 8b 46 04 mov 0x4(%bp),%ax 6: c1 e0 02 shl $0x2,%ax 9: eb 00 jmp 0xb b: 5d pop %bp c: c3 ret That's for: int main (int argc, char **argv) { return argc * 4; } And disassembled with contemporary binutils (not sure if Turbo C++ came with a disassembler.)