Day of disassembly

I spent a happy couple of hours today disassembling program code as part of an article I’m writing for Hackspace magazine. I love seeing the individual instructions that are actually going to be obeyed by the hardware. As an example, consider this statement:

  i = i + 1;

This adds 1 to the contents of a variable called i. This is the assembler that is produced for an ESP32 device.

assembler.png

The statements fetch the value, perform the addition and then put the value back in memory. Folks, this is what computers do. There is another layer underneath this called “microcode” which takes the value “881b” and works out that this means “add 1 to the value in A8”. The best description that I’ve ever found of how this works can be found in the book “Soul of a New Machine”, which is a fantastic read whether you are computer person or not.