Lecture 17 - Toolchain

Published

March 18, 2026

Goals

  • Learn about the development toolchain
  • Learn about similarities between while and for

example

How would you translate this block of assembly?

mov r2, #20
mov r0, #0
mov r1, #0
b #2
add r0, r1, r0
add r1, r1, #1
cmp r1, r2
blt #-4
int count = 20;
int sum = 0;
int i = 0;
while (i < count){
    sum = sum + i;
    i++;
}

OR

int count = 20;
int sum = 0;
for (int i = 0; i < count; i++){
    sum = sum + i;
}

for loops and while loops are the same thing at the assembly level

for loops are what we call syntactic sugar - constructs in programming languages that allow us to express our ideas more clearly, but don’t add any new functionality to the language

To prove to you that this is the case, lets look at what our tools actually produce

Tools

Before we get to that, lets review and formalize what we know about development tools

  • compiler - produces assembly code from a program written in a high-level language (we will use gcc)
  • assembler - translates assembly code to machine code (gcc again)
  • disassembler - translates machine code to assembly (objdump)

These tools are part of a collection of programs that fall under the broad heading of toolchain, which include some other programs that we will get to, including a linker, a debugger, and a memory analysis tools

As I have mentioned before, we also have the interpreter, which sits to one side of the compiler, linker, assembler chain. Alternatively, we could say that it is built on top of the chain. interpreters are programs that can parse high-level code in real time and rather than producing a low-level representation, they directly carry out the instructions.

At this point, you will probably have had experience with an integrated development environment or IDE. This includes tools like Thonny and Eclipse. These tools try to be the one stop shop for development. They include an editor and access to the toolchain, so you can click a button and your code will be compiled, linked, assembled, and then run in a debugger all in one step.

You may have also encountered a tool like VSCode, Atom, or if you are feeling old school, emacs or vim. These are programmers text editors. They focus on providing a general purpose editor with some conveniences for programmers. In truth, many of these start looking a lot like an IDE as they mature and incorporate more features.

Mechanical level

vocabulary syntactic sugar

Skills