CSE 111, Fall 00, P88 Assembly Language

CSE 111, Fall 2000

#### P88 ASSEMBLY LANGUAGE

Last Update: 27 November 2000, 1:00 p.m. Note: material is highlighted

memloc is a memory register
constant is any constant (usually an integer)
`AX` is the CPU's accumulator (or computing register)
`IP` is the CPU's instruction-pointer register
`CF` is the CPU's condition-flag register
"`B`" & "`NB`" are possible contents of the `CF`
(think of them as strings)
"label" is a label on a line of instruction
(i.e., a name given to an instruction)

Syntax | Semantics
--- | ---
`COPY` memloc, `AX` | memloc := `AX`
`COPY AX`, memloc/constant | `AX` := memloc/constant
`ADD AX`, memloc/constant | `AX` := `AX +` memloc/constant
`SUB AX`, memloc/constant | `AX` := `AX -` memloc/constant
`MUL AX`, memloc/constant | `AX` := `AX *` memloc/constant
`DIV AX`, memloc/constant | `AX` := `AX div` memloc/constant
`CMP AX`, memloc/constant | if `AX` < memloc/constant then `CF` := `B` else `CF` := `NB`
`JMP` label | `IP` := instruction with that label
`JNB` label | if `CF` = `NB` then `IP` := instruction with that label
`JB` label | if `CF` = `B` then `IP` := instruction with that label
memloc constant | memloc := constant (used only for initializing memloc)
`IN AX` | readln(`AX`)
`OUT AX` | writeln(`AX`)
`HALT` | `IP` := -1