Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write an LMC program (one program) that reads in two numbers, stores them in memory locations 40 and 41, finds the larger of the two

Write an LMC program (one program) that reads in two numbers, stores them in memory locations 40 and 41, finds the larger of the two numbers, stores the larger number in memory location 42, and outputs the larger number. (Note that the program will be similar, not the same, to the one that finds the positive difference of two numbers that we discussed in the lecture notes for Chapter 6 recorded on Panopto. Note that the LMC instructions start at address 00. You may trace in your memory or on paper the program execution for the two scenarios below:

scenario 1: you enter 5 and 7; and

scenario 2: you enter 7 and 5.

In both cases, your program should output 7.

Does your program

Memory locations returns 7? Circle Yes or No!

Address Instruction 40 41 42

00 Scenario 1 5 7 7 Yes/No

01 Scenario 2 7 5 7 Yes/No

02

03

Address

40 DAT

41 DAT

42 DAT

What range of addresses represents the program area?

What range of the addresses represents the data area?

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_2

Step: 3

blur-text-image_3

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

Medical Image Databases

Authors: Stephen T.C. Wong

1st Edition

1461375398, 978-1461375395

More Books

Students also viewed these Databases questions

Question

3. How do you get past Robins defensiveness?

Answered: 1 week ago

Question

Define the term Working Capital Gap.

Answered: 1 week ago