















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!
















Example: Reverse assemble the following SRC machine language instructions: 68C2003A h E1C60004 h 61885000 h 724E8000 h 1A4000D4 h 084000D0 h
Solution:
Given machine language instruction
Equivalent assembly language instruction
Given instruction
E1C60004 h 1110 0001 1100 0110 0000 0000 0000 0100 b
61885000 h 0110 0001 1000 1000 0101 0000 0000 0000 b
724E8000 h 0111 0010 0100 1110 1000 0000 0000 0000 b
1A4000D4 h 0001 1010 0100 0000 0000 0000 1101 0100 b
084000D0 h 0000 1000 0100 0000 0000 0000 1101 0000 b
We can do it a bit faster now!
Given instruction in hexadeximal
E1C60004 h shl
61885000 h add
724E8000 h sub
1A4000D4 h st
084000D0 h ld
Given instruction in hexadeximal
E1C60004 h shl
61885000 h add
724E8000 h sub
1A4000D4 h st
084000D0 h ld
remaining fields will depend on the instruction type (i.e., the instruction format)
Given machine language instruction
Equivalent assembly language instruction
Fields in the SRC instruction
op 〈 4..0 〉 := IR 〈 31..27 〉 : operation code field ra 〈 4..0 〉 := IR 〈 26..22 〉 : target register field rb 〈 4..0 〉 := IR 〈 21..17 〉 : operand, address index, or branch target register rc 〈 4..0 〉 := IR 〈 16..12 〉 : second operand, conditional test, or shift count register c1 〈 21..0 〉 := IR 〈 21..0 〉 : long displacement field c2 〈 16..0 〉 := IR 〈 16..0 〉 : short displacement or immediate field c3 〈 11..0 〉 := IR 〈 11..0 〉 : count or modifier field
RTL naming operator
Processor state PC 〈 31..0 〉 : program counter (memory addr. of next inst.) IR 〈 31..0 〉 : instruction register Run: one bit run/halt indicator Strt: start signal R[0..31] 〈 31..0 〉 : general purpose registers
Using RTL to describe the
dynamic properties of the SRC
(op=14) : R[ra] ← R[rb] - R[rc];
IF condition (^) THEN perform this action
; is an RTL termination operator
RTL assignment operator
The , indicates that the two statements will be executed simultaneously
Two disjoint conditions imply that only one action will be performed at one time Remember: register R0 cannot be added to displacement rb = 0 just means don’t use the R[rb] field
Instruction Fetch Operation
instruction_Fetch := ( !Run & Strt : Run ← 1, Run : (IR ← M[PC], PC ← PC + 4; instruction_execution) );
Logical NOT
Logical AND
Transfer from memory to the IR
Sequential statements are separated by a ; concurrent statements are separated by a ,
Set the RUN bit to a 1
Naming operator
Instruction Execution
ie := ( (op<4..0>= 1) : R[ra] ← M[disp], (op<4..0>= 2) : R[ra] ← M[rel],
... ...
(op<4..0>=31) : Run ← 0,); ii );
Op code for ld
Op code for ldr
Op code for other^ Op code for stop instructions Docsity.com