Comprehensive Analysis and Solutions for MARIE Programming Assignment

Verified

Added on  2021/06/15

|10
|409
|98
Homework Assignment
AI Summary
This document presents a comprehensive solution to a MARIE programming assignment. The assignment explores concepts of assembly language, instruction sets, and addressing modes. The solution includes an analysis of the Fibonacci sequence within the context of MARIE programming, along with the identification of the threshold value. The document also examines different addressing modes, providing examples of 3-addressing, 2-addressing, and 1-addressing code, as well as 0-addressing code. The student provides the code for calculating the expression A = (B+C)*(D-E) using different addressing modes. Finally, a bibliography of relevant sources is included. This resource is designed to aid students in understanding and solving MARIE programming assignments effectively. The document is contributed to Desklib, a platform providing AI-based study tools for students.
Document Page
Running head: MARIE PROGRAMMING
Assembly Language:
Marie Programming
Name of the Student:
Name of the University:
Author Note
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
1
MARIE PROGRAMMING
Answer to question number 1
a. The following output are obtained from the Marie simulator:
Input: 1
Output: 1
Input: 15
Document Page
2
MARIE PROGRAMMING
Output: 610
Input: 21
Document Page
3
MARIE PROGRAMMING
Output: 10946
b.
Input: 22
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
4
MARIE PROGRAMMING
Output:17711
Input: 23
Document Page
5
MARIE PROGRAMMING
Output:28657
Input: 24
Document Page
6
MARIE PROGRAMMING
Output: -19168
A negative value id provided by the machine the value 24 is entered by the user. The
highest value is obtained when the number 23 is entered by the user. Hence, from this result it
can be easily inferred that the threshold value of the Marie simulator is 28567 which is in the
Fibonacci series and hence the maximum value of n is 23
Answer to question number 2
2^11=2048 number of instructions are possible.
It is given that the size of the address field is 4.
Number of 1-addressing instruction = 30×2^4 =480
Number of 2-addressing instruction = 6×2^4 ×2^4 =1536
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
7
MARIE PROGRAMMING
Hence, 2048 – 2016 = 32 number of accommodation would be available.
Answer to question number 3
Given expression, A = (B+C)*(D-E)
3 addressing code for the expression is
ADD R1, B, C
SUB R2, D, E
MUL A, R1, R2
2 addressing code for the expression is
LOAD R1, B
ADD R1, C
LOAD R2, D
SUB R2, E
MUL R2, R1
STORE A, R2
1 addressing code for the expression is
LOAD B
ADD C
STORE T
Load D
Document Page
8
MARIE PROGRAMMING
SUB E
MUL T
STORE A
0 addressing code for the expression is
PUSH B
PUSH C
ADD
PUSH D
PUSH E
SUB
MUL
Store A
Document Page
9
MARIE PROGRAMMING
Bibliography
Baldwin, J., Teh, A., Baniassad, E., Van Rooy, D. and Coady, Y., 2016. Requirements for tools
for comprehending highly specialized assembly language code and how to elicit these
requirements. Requirements Engineering, 21(1), pp.131-159.
Kawash, J., Kuipers, A., Manzara, L. and Collier, R., 2016, February. Undergraduate assembly
language instruction sweetened with the raspberry Pi. In Proceedings of the 47th ACM Technical
Symposium on Computing Science Education(pp. 498-503). ACM.
chevron_up_icon
1 out of 10
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]