0% found this document useful (0 votes)
9 views

Introduction of Computer Architecture Sheet 3

Uploaded by

hlaomr980
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Introduction of Computer Architecture Sheet 3

Uploaded by

hlaomr980
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Introduction of computer architecture

Sheet 3

Review questions:
1. Explain why, in MARIE, the MAR is only 12 bits wide while the AC is 16 bits wide?
2. Explain the difference between byte addressable and word addressable?
3. Explain the function of all MARIE registers

Exercise:

1. List the hexadecimal code for the following program (hand assemble it).
Label Hex Address Instruction
100 Load A
101 Add One
102 Jump S1
S2, 103 Add One
104 Store A
105 Halt
S1, 106 Add A
107 Jump S2
A, 108 HEX 0023
One, 109 HEX 0001

2. What are the contents of the symbol table for the preceding program?
3. Given the instruction set for MARIE in this chapter:
a. Decipher the following MARIE machine language instructions (write the assembly
language equivalent)
i. 0010000000000111
ii. 1001000000001011
iii. 0011000000001001
b. Write the following code segment in MARIE's assembly language:
if X > 1 then
Y := X + X;
X := 0;
endif;
Y := Y + 1;

4. Write the following code segment in MARIE assembly language:


X := 1;

while X < 10 do

X := X + 1;

endwhile;

5.
Write a MARIE program to evaluate the expression A x B + C x D. Ans. Note: The
line numbers as shown in the book are NOT necessary. They are included in the
book to help students see the correlation between the assembly language
instructions and the MARIE instructions

6. Write the following code segment in MARIE assembly language:

Sum := 0;
for X := 1 to 10 do
Sum := Sum + X;
7. Write a MARIE program using a loop that multiplies two positive numbers by using
repeated addition. For example, to multiple 3 x 6, the program would add 3 six
times, or 3+3+3+3+3+3.

You might also like