1_Language of the Computer
1_Language of the Computer
Architecture
Instructions: Language of the Computer
Slide no: 01
Reference book
4 100
3 10
Memory
2 21
1 32
67
0
Processo Address data
r
Compiling an assignment when an
operand is in Memory
g= h + A[8]
assign g-> $s1, h-> $s2 , base of A-> $s3
lw $t0 , 8($s3)
# address of array element = base of the array + number to select
element 8.
add $s1 , $s2 , $t0
A[12]=h+A[8]
lw $t0 , 32($s3)
# temporary register $t0 gets A[8]
add $t0 , $s2 , $t0
# temporary register $t0 gets h+A[8]
sw $t0 , 48($s3)
# stores h+A[8] back into A[12]
Representing instructions in the
computer
MIPS R-Format Instructions
MIPS I-Format Instructions
chart to remember
valus are provided in the table are in decimal.
reg—0 t0 31
address – 16 bit address
Instructio forma op rs rt rd sham func address
n t t t
op rs rt rd address/ funct
shamt
10 011 01 001 01 000 0000 0100 1011 0000
000 000 10 010 01 000 01 000 00 000 100 000
10 011 01 001 01 000 0000 0100 1011 0000
Logical operations
Shift operation
Continue…