

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


temp = v[k]; v[k] = v[k+1]; v[k+1] = temp;
lw $15, 0($2) lw $16, 4($2) sw $16, 0($2) sw $15, 4($2)
0000 1001 1100 0110 1010 1111 0101 1000 1010 1111 0101 1000 0000 1001 1100 0110 1100 0110 1010 1111 0101 1000 0000 1001 0101 1000 0000 1001 1100 0110 1010 1111
ALUOP[0:3] <= InstReg[9:11] & MASK
High Level Language Program
Assembly Language Program
Machine Language Program
Control Signal Specification
Compiler
Assembler
Machine Interpretation
° °
Machine language programming is very useful for small programs. but requires the programmer/digital designer to have an in-depth
Example : 1001 0000 0101 0011 Load Register1 into ACC 0101 1100 1010 0010 Decrement value in Register
Therefore, the programmer/digital designer is forced to memorise each machine instruction. -- or continuously refer to the manual !!
ADD add ANDI AND immediate MUL multiply JMP jump/goto CMP compare
Each instruction takes 0, 1, 2 or 3 operands (rarely more than 3).
Usually we can consider an operand to be one of the following:
For each line of assembly language a LABEL is optional.
Hence the following would be converted as, ANDI TEN : ANDI # CMP #THRESHOLD : CMP #$
2. Program Code Location and DATA Memory Location
$
$
MEMORY
$
$
Program Memory
Data Memory
Data Memory
MEMORY