Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me solve this question, I attached an example for which assembly code to follow 100 Due date 13 /3/2019 Question. Using the assembly

image text in transcribed
image text in transcribed
Please help me solve this question, I attached an example for which assembly code to follow
100 Due date 13 /3/2019 Question. Using the assembly language of the simple processor in Sections 3.1 assembly code segments that add the numbers from 1 to location SUM and 3.2, Write an 100, and store the result in the memory Example 2: write an assembly program to perform the multiplication operation: zes. Y, where X, Y, and Z are memory locations The assembly of the simple CPU does not have a multiplication operation. Compute the product by applying the add operation multiple times. In order to add Y to itself X times, we will use N as a counter that is initialized to X and decremented by one after each addition step The BZ instruction will be used to test for the case when N reaches 0. Assume that X 5 and Y 15. o o o o o BZ is a conditional branch that jumps to the specified instruction address if AC0. LD X ST N LDN BZ EXIT LD ONE 1 Load X in AC I Store AC (X original value) in N LOOP \Goto EXIT if AC = 0 (Nreached 0) DRAC AC-N 1 subtract 1 from N Istore decrements N LD N SUB ST N LD Y MOVAC LD Z ADD ST Z BRA LOOP STOP AC-Z (partial product) Add Y to Z I store the new value of z EXIT I reserve a word initialized to 5 reserve a word initialized to 15 reserve a word initialized to o 1 reserve a word initialized to 1 reserve a word initialized to o 15 ONE We will use a memory location to store N N should be loa ded into AC before BZ executes A memory location ONE is used to store the constant value 1. - The memory location Z will have the partial products and then the final result

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