Hacker News new | ask | show | jobs
by t1m 4750 days ago
This is a great walkthrough, and a real trip back to the good old days. I learned programming on the Apple ][ and, like many started in Basic then moved to 6502 assembly.

I am not sure how other teenagers made this awkward transition, but I did it by writing a tiny assembler in Basic. It was fairly easy because Basic had PEEK (get contents of address), POKE (set contents) and CALL (jump to address) that everyone was used to using to get anything useful done. I think I just got tired of hand assembling programs into POKE calls.

I remember getting a thin wire-bound book with a detailed disassembly (with comments!) of the ROMs and DOS as a birthday present. I think one of the thing that inspired programmers on the Apple ][ was the amazing system code that Woz had written. He set a very high bar for assembly language programmers. His code was economical, fast, smart, and tiny. He demonstrated how to squeeze the most out of limited resources.

1 comments

I learned to program 6502 on the BBC Micro. It had a built-in assembler as part of its BASIC. Very useful! Assembly language instructions got written to memory according to the value of a specific variable, and there was a somewhat neat mechanism for doing 2 passes (to fix up forward references). It was quite flexible, and gave you all the power of the inbuilt BASIC - which was of course awful, though excellent by the standards of the day - for writing macros.

More programming languages should have included something like this, I think. Maybe by now we'd have runtime code generation as a common primitive, something like LuaJIT's dynasm (http://luajit.org/dynasm.html), only with GC, so you could generate custom little routines at runtime.

(As it is, what do we get? gcc-style inline assembly language. Progress? My arse.)