Version without JavaScript, read-only: workshops, quizzes and running code are not available here. Full version · Catalogue · Sign in

Université Paul Sabatier · Toulouse · L1 Computer Science

68000 assembly

Programming the Motorola 68000 processor as close to the machine as possible: representing numbers, handling registers and memory, writing tests, loops and subroutines.

lecture notes and exercise sheets | Easy68K syntax | runnable workshops

Five chapters and five exercise sheets, one week each. The programs are written in the syntax of the Easy68K simulator. Some of them are workshops: you edit them and run them in the page, all at once or step by step, watching the registers, the flags and the memory change. It is the best way to understand what each instruction does. Every program of the course also runs in Easy68K.

For your own programs, there is the 68000 sandbox (in the menu, under “Free”): a blank workshop that keeps your code in this browser, with a quick reference of the TRAP #15 services.

Lecture notes

  1. Representing information : Everything the processor handles is a sequence of bits. How we write numbers in it, positive or negative, characters, and how we store them in memory.
  2. The 68000 and its first instructions : The processor's registers, the shape of a program, the instructions that move and compute, and the flags that sum up each result.
  3. Addressing modes : The different ways to designate an operand, in a register, in the instruction or in memory, and how they are used to walk through an array or read a field of a structure.
  4. Tests, jumps and loops : Comparing, jumping according to the flags, and translating the if, while and for statements of a high-level language into assembly.
  5. Subroutines and the stack : Splitting a program into reusable subroutines, thanks to the stack, which remembers return addresses, registers to preserve and parameters.

Exercise sheets

  1. Representing information : Base conversions, two's complement, carry and overflow, storage in memory and ASCII codes. Chapter 1.
  2. The 68000 and its first instructions : Following execution register by register, predicting the flags, and writing first programs. Chapter 2.
  3. Addressing modes : Computing effective addresses, following address registers, and walking through arrays and structures. Chapter 3.
  4. Tests, jumps and loops : Choosing the right branch, translating if, while and for, and writing loops over arrays and strings. Chapter 4.
  5. Subroutines and the stack : Following the stack, writing subroutines that preserve registers, passing parameters, and finding what unbalances the stack. Chapter 5.