## Machine Code

All instructions are stored as binary numbers. Code written like this is machine code.

A computer can easily understand machine code, but it is hard for people to interpret.

$$\begin{array}{l|l} \text{Not Machine Code}&\text{ADD R6 R8 R2}\\ \text{Machine Code}&0100011010000010 \end{array}$$

## Assembly Code

Low-level programming language, known as Assembly Language, is a set of more readable ways to display machine code.

• This language maps one-to-one to machine code.
• It has symbolic ways to display our opcodes, our instructions and data and pseudo-ops for data generation and more.
• An address is still just a number but we could use labels like $X$, $Y$ or $Z$ where each label corresponds to a number.
• Because instructions and data are stored in the same memory, we can also label instruction addresses with labels.
• It is common to refer to registers as $\text{Rx}$ where $\text{x}$ is a number greater than $0$.

The advantages of assembly language would be:

• Clarity, readability, and maintainablity
• Can be placed as different locations in memory

### Notation

There is some basic notation for computer instructions.

$$\begin{array}{r | l} \text{CON(A)}&\text{Contents of memory cell A}\\ \text{A}\rightarrow\text{B}&\text{Send value in register A to register B}\\ \text{FETCH}&\text{Initiate a memory fetch operation}\\ \text{STORE}&\text{Initiate a memory store operation}\\ \text{ADD}&\text{Instruct the ALU to select the output of the adder circuit}\\ \text{SUBTRACT}&\text{Instruct the ALU to select the output of the subtract circuit} \end{array}$$

Using this notation, we can see our Von Neumann Cycle.