Question 1
How many bits are required to address a 4M 16 main memory if
Question 2
A digital computer has a memory unit with 32 bits per word. The instruction set consists of 110 different operations. All instructions have an operation code part (opcode) and two address fields: one for a memory address and one for a register address. This particular system includes eight general-purpose, user-addressable registers. Registers may be loaded directly from memory, and memory may be updated directly from the registers. Direct memory-to-memory data movement operations are not supported. Each instruction is stored in one word of memory.
Question 3
Given the instruction set for MARIE in this chapter, do the following. Decipher the following MARIE machine language instructions (write the assembly language equivalent):
Question 4
Write the following code segment in MARIEs assembly language:
if X > 1 then Y = X + X:
X = 0
end if;
Y = Y + 1
Question 5
What are the potential problems (perhaps more than one) with the following assembly language code fragment (implementing a subroutine) written to run on MARIE? The subroutine assumes the parameter to be passed is in the AC and should double this value. The Main part of the program includes a sample call to the subroutine. You can assume this fragment is part of a larger program.
Main, Load X
Jump Sub1
Sret, Store X
. . .
Sub1, Add X
Jump Sret
Question 6
Write the following code segment in MARIE assembly language:
X = 1;
While X < 10 do
X = X + 1;
Endwhile;