// HACKER NEWS — CYBERSECURITY
Ten Lines of Code That Changed My World
Ten lines of code that, one way or another, mean something to me. Either because I wrote them, or I extensively copied them, or they made me laugh. Or cry.
I don’t know when I typed this for the first time, or if it was exactly this version. Might have been without the comma, or with more exclamation marks.
Nevertheless, the computer obliged, cheerfully greeting the world, and very much in particular, the wide-eyed kid who had just communicated with a computer for the first time.
The second line drove home the point that a computer will do anything you tell it to. Hello world forever!
Copy the line and paste it your browser’s console for a crossover between old school pop culture TV and nerdy coding humor, with a big fat dose of “JavaScript is stupid” on top.
Machine language is as close to the metal as it gets. No warnings, no logs, no guardrails. It even allows you to modify itself, by overwriting the actual bytes of the code while it runs.
Like in this example, where you update the high bytes of the source and destination addresses. The branch loops from $2000 to $20FF, and the subsequent INC changes the address from $2000 to $2100, before starting the loop again.
(The 6502 is little endian, so we do +2 and +5 instead of +1 and +4)
As low-level as it gets, hardcore, and slightly dangerous. Realizing you could do this really drove home the point that, when coding this close to the metal, anything goes.
This tiny batch script allowed for a poor man’s touch on Windows, which I used extensively from Windows NT to Windows 7. I typed touch filename.txt in the Total Commander mini-shell to quickly generate new, empty files. Couldn’t live without it.