Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. (70 points) Translate the high-level language code below into assembly instructions. The variables A, B, C, D, E and F are located in the

image text in transcribed

1. (70 points) Translate the high-level language code below into assembly instructions. The variables A, B, C, D, E and F are located in the memory and can be accessed by their label (e.g., LOAD R1, A wil load A from the memory into R1). Minimize the number of instructions in the assembly code that you write F (A-C)*C/(E-D) -B Accumulator-All operations occur between a single register and a memory location * Memorv-memorv-All instruction addresses reference only memorv locations. Stack All operations occur on top of the stack. Push and pop are the only instructions that access memorv: all others remove their operands from the stack and replace them with the result. The implementation uses a hardwired stack for only the top two stack entries, which keeps the processor circuit very small and low cost. Additional stack positions are kept in memory locations, and accesses to these stack positions require memory references. Load-store All operations occur in registers, and register-to-register instructions have three register names per instruction. a) Write the code for an accumulator architecture b) Write the code for a stack architecture. Assume that the division (subtraction) operation divides (subtracts) the topmost value in the stack by the second topmost value. c) Write the code for a memory-memory architecture d) Write the code for a load-store architecture e) Compare the number of instructions and memory accesses of the different implementations in parts a, b, c and d. 1. (70 points) Translate the high-level language code below into assembly instructions. The variables A, B, C, D, E and F are located in the memory and can be accessed by their label (e.g., LOAD R1, A wil load A from the memory into R1). Minimize the number of instructions in the assembly code that you write F (A-C)*C/(E-D) -B Accumulator-All operations occur between a single register and a memory location * Memorv-memorv-All instruction addresses reference only memorv locations. Stack All operations occur on top of the stack. Push and pop are the only instructions that access memorv: all others remove their operands from the stack and replace them with the result. The implementation uses a hardwired stack for only the top two stack entries, which keeps the processor circuit very small and low cost. Additional stack positions are kept in memory locations, and accesses to these stack positions require memory references. Load-store All operations occur in registers, and register-to-register instructions have three register names per instruction. a) Write the code for an accumulator architecture b) Write the code for a stack architecture. Assume that the division (subtraction) operation divides (subtracts) the topmost value in the stack by the second topmost value. c) Write the code for a memory-memory architecture d) Write the code for a load-store architecture e) Compare the number of instructions and memory accesses of the different implementations in parts a, b, c and d

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

3. Review the concept of innovation.

Answered: 1 week ago