View more random threads:
- cs610 5th assignment solution for sale.......!!!!!!!
- MTH601 Operations Research Assignment No. 01 Solution and...
- FIN630 Investment Analysis and Portfolio Management...
- Assignment No. 4 SEMESTER Spring 2013 CS301- Data Structures
- CS 101 Introduction to Computing Assignment # 02 May5, 2010
- CS602 Computer Graphics Assignment No. 02 December 2014
- PSY101 Introduction to Psychology Solution & Discussion...
- PSY404 Abnormal Psychology Assignment No. 2 Solution Fall...
- All Past Assignments with Solutions Of MGT201 Financial...
- PSY407 Sport Psychology Assignment No. 1 Fall Semester 2012
CS501 Advance Computer Architecture Assignment 1 solution Fall 3rd November 2012
Q1. Write an SRC assembly language program to evaluate the following expression:
f = 4(k+32) + 16(g-h)
Note that your code should not change the source operands and also keep in mind that the SRC does not have a multiply instruction
Part b: 5 marks
Draw memory map table for the above program using the following scenario and assume that SRC uses 16-bit memory in this case.
.ORG 300 ; start the next line at address 300
k: .DW 1 ;
g: .DW 1 ;
h: .DW 1 ;
f: .DW 1 ;
;
.ORG 400 ; start the code at address 400
The code starts at address 400 and each instruction takes 16-bits in the memory.
Solution:
Write an SRC assembly language program to evaluate the following expression:
f = 4(k+32) + 16(g-h)
Note that your code should not change the source operands and also keep in mind that the SRC does not have a multiply instruction
Solution
ld R1,g
ld R3,h
sub R5,R3,R1
shl R4,R5,4
addi R7,R6,32
shl R8,R7,2
add R9,R8,R4
st R9,f
Part b: 5 marks
Draw memory map table for the above program using the following scenario and assume that SRC uses 16-bit memory in this case.
.ORG 300 ; start the next line at address 300
k: .DW 1 ;
g: .DW 1 ;
Sponsored Links
h: .DW 1 ;
f: .DW 1 ;
;
.ORG 400 ; start the code at address 400
The code starts at address 400 and each instruction takes 16-bits in the memory.
Solution
Memory Map
Memory Address
Memory Contents
300
unknown
304
unknown
308
unknown
312
unknown
…..
400
ld R1,g
402
ld R3,h
404
sub R4,R3,R1
406
shl R4,R5,4
408
addi R7,R6,32
410
shl R8,R7,2
412
add R9,R8,R4
414
st R9f
There are currently 1 users browsing this thread. (0 members and 1 guests)