The gold standard of optimization: A look under the hood of RollerCoaster Tycoon

https://lemmy.world/post/44614748

The gold standard of optimization: A look under the hood of RollerCoaster Tycoon - Lemmy.World

Crossposted from https://lemmy.bestiver.se/post/1003114 [https://lemmy.bestiver.se/post/1003114] ----- Comments [https://news.ycombinator.com/item?id=47480886]

Programmer friend years ago broke it down for me like this. Yes, he did it in assembly, but similar to all computer things; he used large chunks of copy pasta. In no way does it diminish the achievement. But for layman, hearing that it was all written in machine code conjured images of vacuum tubes and Margaret Hamilton standing next to a literal person sized stack of typed pages. He moved mountains efficiently and intelligently with clever acumen. A real feat!

Now if you will excuse me, a handyman is drowning.

Is assembly code really comparable to vacuum tubes? Maybe it’s because I work with video, but usage of assembly is still a thing in performance critical Codec code.

P.S. I think machine code is a step below assembly. I could be wrong though.

Assembly is the ‘human-readable’ version. It has mnemonic values for the opcodes, so you can write eg. RET to return from a subroutine rather than the machine code 0xC3 / 195. It also lets you write named labels for offsets in the code which are substituted for their number values during assembly, which saves a lot of tedious counting, and macros, which are expanded into a longer list of instructions, saving lots of copy-paste.

So yeah, machine code is a step down. Not a big step down, there’s pretty much a 1:1 conversion between either form, but assembly has a couple of niceties that make it much easier for humans to work with.