← Back to context

Comment by winocm

1 month ago

The assembly really, really hurts to read.

In what way?

It looks much closer to real human-written Asm than compiler output, which is itself a big win. No stupid calling conventions or obvious bloat. The unmistakably bloated inefficiency of "compiler slop" (that term wasn't used at the time, but those who lived through that Asm vs HLL era on the PC will know exactly what I'm talking about) is not present. I can always spot immediate optimisation opportunities with compiler output, but at a quick glance, not in this code.

...and now I have the idea of getting AI to decompile some existing binaries and then have it optimise/rewrite in the style of human-written Asm... run something like Windows XP or even 11 through it and see if it can be optimised down to a tiny fraction of its current resource usage.

  • Random inconsistencies such as using push/pop for individual registers instead of pusha/popa for space constrained bits or setting the same register to the same value twice in a row.

    Not to even mention that random WORDS are capitalized for some REASON as well.

    • pusha/popa for space constrained bits

      Those instructions were introduced in the '186/8 but this project targets the 8086/8088.