Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Comp Org Implementation of Binary Search in the MARIE assembly language program as follows: Write the MARIE assembly language program that corresponds to the attached

Comp Org Implementation of Binary Search in the MARIE assembly language program as follows:

Write the MARIE assembly language program that corresponds to the attached C++ program (binary search) as follows:

Begin with the provide template (tp1BinarySearch.mas) and rename it as instructed below.

o The ordered data for the binary search is defined between Data_B and Data_E

o The actual address of Data_B is stored at BAddr as 0003

o The actual address of Data_E is stored at EAddr as 001A (hex)

o Modify the given template from the line with start, Do NOT modify the lines above start,

The program behavior o The user enters a number (hexadecimal).

o Using the binary search algorithm, the program locates the number at addresses between Data_B and Data_E

o If the number is found, display (output) the address of the number (NOT actual number).

o If the number is not found, display FFFF (hexadecimal) Comments requirements in the source program: For every two or three MARIE instructions, add the equivalent C++ statement as comments. Execution Time Requirements: The program should complete within 1 minute. The Template for the search is as follows

ORG 0

JUMP start BADDR, hex 0003 / Date_B = 0003 EADDR, hex 001A / Date_E = 001A / data section begins Data_B, hex 0102 / data begin address hex 0105 hex 0106 hex 0108 hex 011A hex 0120 hex 0225 hex 0230 hex 0231 hex 0238 hex 0339 hex 0350 hex 0459 hex 055F hex 066A hex 0790 hex 08AB hex 09AF hex 0AB9 hex 0BBD hex 0CC1 hex 0DCA hex 0EFE Data_E, hex 0FFE / data end address Count, dec 24 / the number of data / / do not modify the code above / add/modify code and data below / start, input / read the search key from the keyboard

/ halt

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

Optimizing Data Collection In Warzones

Authors: Aaget Aamber

1st Edition

B0CQRRFP5F, 979-8869065902

More Books

Students also viewed these Databases questions

Question

Write Hund's rule?

Answered: 1 week ago