Write a c++ program for little man''s computer

Assignment Help Operating System
Reference no: EM13942771

We have to write a c++ program for Little man's computer in which

Input:

A text file containing machine code (not assembly code) for little man's computer following instruction set . Instructions are in different lines (no need for semicolon at the end of each instruction)

Arithmetic 1xx ADD
2xx SUB
Data Movement 3xx STORE
5xx LOAD
BR 6xx JUMP
BRZ 7xx BRANC ON 0
BRP 8xx BRANCH ON +
Input/Output 901 INPUT
902 OUTPUT
Machine Control 000 HALT
(coffee break) COB

Output:
Any output specified in the input file by 902 will be displayed on screen

Computer specification:
· Two digits memory (mail box) address: 00-99

· Three digits instruction or data in each memory slot

· One calculator, one program counter

· The program in the input file needs to be loaded into memory first and stored in consecutive slots starting from address 00

· 901 instruction will ask user's input from keyboard, 902 displays content in calculator

Other requirements:

Your program should accept any length of input program that can be fit in little man's 100 memory slots and generate correct result and/or output on screen.

Submit the source code together with readme file with instruction to compile, build and use your program.

Example:

Input file contains following code (return positive difference):

901
310
901
311
210
808
510
211
902
000

Running of the program with this input will ask user to input 2 numbers, let's say 5 and 10, the program will output the positive difference on the screen, which is 5.

Reference no: EM13942771

Questions Cloud

Analytical tool used by organizations as marketing planning : Pestle is a key analytical tool used by organizations as part of their marketing planning. Analyze and evaluate the market entry strategies Domino's and Pizza hut used in their expansion and alternatives they could have considered.
Detail all features that cache and virtual memory have : Explain what virtual memory is and what its purpose is. Also describe when and how pages are moved between virtual memory and main memory.
How much heat per hour is extracted from the steam : Steam at 100°C is passed into a condenser at a rate of 500 kg/h and leaves as water at 60°C. If the condenser is supplied with cooling water which enters at 20°C and leaves at 40°C, calculate:- how much heat per hour is extracted from the steam.
Relationship within the organisations total group of product : a. Classify the product and discuss its relationship within the organisation's total group of products
Write a c++ program for little man''s computer : A text file containing machine code (not assembly code) for little man's computer following instruction set . Instructions are in different lines (no need for semicolon at the end of each instruction)
Promoting quality and safety through standards : In the article "Managing to Improve Quality: The Relationship Between Accreditation Standards, Safety Practices, and Patient Outcomes," the authors discuss the growing trend by medical insurance companies to eliminate reimbursement for Never Event..
Range of theoretical approaches to ihrm : Outline the range of theoretical approaches to IHRM. Critically evaluate these approaches with relevant organizational examples.
Where does each major seafloor sediment type tend : What are the different types of seafloor sediments, and what are the factors that control the distribution of each major sea sediment type? Where does each major seafloor sediment type tend to accumulate in greatest quantity?
What type of information is kept in a rom : What type of information is kept in a ROM, and how does that information originally get into the memory?

Reviews

Write a Review

Operating System Questions & Answers

  Identify and explain how to use the shell commands

Identify and explain how to use the shell commands

  Business continuity planning

Business continuity planning is important for large and small company. Explain briefly the importance of a business continuity plan under the given heads.

  Crescent manufacturing inc cmi is a luxury leader in

crescent manufacturing inc. cmi is a luxury leader in crafted and customized home furnishings. the corporate

  Use of ntfs permissions for the folders or files on network

Justify the use of NTFS permissions for the folders / files on the network and explain the top two to three (2-3) reasons this is the most reliable option at the business unit leaders' disposal

  Compare and contrast guided versus wireless media

Imagine that you have been asked to prepare a paper that compares and contrasts guided vs. wireless media for inclusion in your corporation’s knowledge database.

  How can an associative memory be implemented

As technology progresses, it may one day be possible to put thousands of identical CPUs on a chip. If all CPUs can read and write three shared registers, how can an associative memory be implemented?

  Mobile ip is emerging

Mobile IP is emerging as the next industry standard for the way in which wireless devices move from one network to another.

  Single table manipulation and table join manipulation

Explain one drawbacks and benefits of Internet enabled technology use by firms to augment information flow both within and between company departments, partners, and consumers?

  Question about throughput and capacity

Throughput and capacity are determining factors for effectiveness of a system more so than processor speed?

  Which page will lru replace

which page will NRU replace?B) which page wil FIFI replace?C) which page will LRU replace?

  Creating virtual experiences

Think back over the past year. Where were you when you learned about breaking news? How did technology impact the way that you heard, saw, or experienced the newsworthy event?

  What is the main advantage of multiprogramming

What is the main advantage of multiprogramming How does the distinction between the monitor mode and user mode function as a rudimentary form of protection (security) system What is the difference between a trap and an interrupt? What is the u..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd