logo Projects Docs Learn Embed
Star on github
AI Chat

M68K assembly

Getting started with M68K
Data and address registers
Memory, big endian and sizes
Bytes, words and longs
The M68K instruction set
Addressing modes
The condition code register
org, equ, dc and ds
Compare and branch
Loops and dbra
Arithmetic, logic and bits
Arrays, strings and (a0)+
The stack, -(sp) and movem
bsr, rts, link and unlk
trap #15 and its tasks
The screen, keyboard and mouse through traps
Exceptions and the vector table
Moving values around
Variables in memory and constants
The bigger of two numbers
Fill an array with the numbers from 1 to 10
Sum of an array
The largest element
Length of a string
Reverse a string in place
Multiply and divide, with the remainder
Even or odd, count the set bits, multiply by shifting
A subroutine with its arguments in registers
Stack arguments and a stack frame
Recursion: factorial and Fibonacci
Bubble sort
A jump table
Binary search
A 2D array
Print a string
Read two numbers and print their sum
Print a number in any base without help
Drawing shapes on the screen
A bouncing ball
Move a square with the keyboard
The snake game
Flappy bird
Donate
Create your first project

M68K assembly

This course is about the Motorola 68000, and about writing programs for it.

If you have never written assembly before, read Assembly basics first. It goes through registers, memory, branching and the stack quickly. This course takes all of that for granted and covers the same ground again, slowly, on the 68000.

Getting started with M68K
Data and address registers
Memory, big endian and sizes
Bytes, words and longs
The M68K instruction set
Addressing modes
The condition code register
org, equ, dc and ds
Compare and branch
Loops and dbra
Arithmetic, logic and bits
Arrays, strings and (a0)+
The stack, -(sp) and movem
bsr, rts, link and unlk
trap #15 and its tasks
The screen, keyboard and mouse through traps
Exceptions and the vector table
Moving values around
Variables in memory and constants
The bigger of two numbers
Fill an array with the numbers from 1 to 10
Sum of an array
The largest element
Length of a string
Reverse a string in place
Multiply and divide, with the remainder
Even or odd, count the set bits, multiply by shifting
A subroutine with its arguments in registers
Stack arguments and a stack frame
Recursion: factorial and Fibonacci
Bubble sort
A jump table
Binary search
A 2D array
Print a string
Read two numbers and print their sum
Print a number in any base without help
Drawing shapes on the screen
A bouncing ball
Move a square with the keyboard
The snake game
Flappy bird