[Label:] Mnemonic [Operand, Operand] [; Comments] |
Here: MOV R5,#25H ;load 25H into R5 |
ADD | Add |
SUB | Subtract |
MPY | Multiply |
DIV | Divide |
LOAD | Load data from memory |
STOR | Store data to memory |
Operation mnemonic | Name | Number of bits transferred | Description |
L | Load | 32 | Transfer from memory in register |
LH | Load half-word | 16 | Transler from memory to register |
ST | Store | 32 | Transfer from register to memory |
STH | Store half-word | 16 | Transfer from register to memory |
(R1) - 10100101 (R2) - 00001111 then (R1) AND (R2) – 00000101 |
PUSH | A | TOP = A |
PUSH | B | TOP = B |
ADD |
| TOP = A+B |
PUSH | C | TOP = C |
PUSH | D | TOP = D |
ADD |
| TOP = C+D |
MUL |
| TOP = (C+D)*(A+B) |
POP | X | M[X] = TOP
|
LOAD | A | AC = M[A] |
ADD | B | AC = AC + M[B] |
STORE | T | M[T] = AC |
LOAD | C | AC = M[C] |
ADD | D | AC = AC + M[D] |
MUL | T | AC = AC * M[T] |
STORE | X | M[X] = AC |
Here destination address can also contain operand.Expression: X = (A+B)*(C+D)R1, R2 are registersM[] is any memory location
MOV | R1, A | R1 = M[A] |
ADD | R1, B | R1 = R1 + M[B] |
MOV | R2, C | R2 = C |
ADD | R2, D | R2 = R2 + D |
MUL | R1, R2 | R1 = R1 * R2 |
MOV | X, R1 | M[X] = R1 |
ADD | R1, A, B | R1 = M[A] + M[B] |
ADD | R2, C, D | R2 = M[C] + M[D] |
MUL | X, R1, R2 | M[X] = R1 * R2 |