[Spotlight] assembly language programming

I gave an impromptu talk on assembly language programming. Here are some of my notes:

Thoughts on assembly language

  • programming language
  • very close to the machine
  • plain text, unstructured
  • low productivity for the programmer
  • verbose, awkward, difficult, exacting, unhelpful (so why do we do it?)
  • high performance code
  • precise control over what happens when

What does close to the machine mean?

  • see the Compiler Explorer to relate C to assembly
  • use the programmer-visible registers
  • use the available opcodes
  • use the available status flags and branches
  • arrange your own calling convention
  • do your own register allocation and liveness analysis
  • do your own software pipelining

Interesting links:

As a teaser for another subject or two, I showed a disassembly of a ROM and a complex ad-hoc one-liner to produce a binary file from this text.

See also Resources to start programming (coding)