Simple CPU Assembly Language
Assembly Language is a type of programming language used to directly interact with a certain CPU model. We are going to look at an assembly language for a very simple (and fictional) CPU.
This CPU will have 16 storage locations, known as registers, labelled r0 through r15. It will also have an Arithmetic Logic Unit, which is responsible for processing each instruction. You can visualize this as follows:

The assembly language for this CPU has four commands:
set destination, value
Assigns a value to the specified destination register.
Example
sets the value ofr1 to 7.
add destination, source1, source2
Adds the values of two registers, and stores the result in the specified destination register.
Example
adds the values inr2 and r3 and puts the result into r1.
sub destination, source1, source2
Subtracts the values of two registers, and stores the result in the specified destination register.
Example
subtractr2 - r3 and puts the result into r1.
mul destination, source1, source2
Multiplies the values of two registers, and stores the result in the specified destination register.
Example
multiplies the values inr2 and r3 and puts the result into r1.