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

  Implementation of algorithms for process management

The Shortest Job Next (SJN) algorithm queues processes in a way that the ones that use the shortest CPU cycle will be selected for running rst.

  Develop a user mode command interpreter

Develop a user mode command interpreter which support list-short.

  Memory allocation in operating system

Analysis and implementation of algorithms for memory allocation in operating system, Explain First- t and best- t methods are used in memory allocation in operating systems.

  Stand alone child process

Forking the child process

  Write a multi-threaded program

Write a multi-threaded program to solve producer and consumer problem

  Marginal and average cost curves

n a competitive market place (pure competition) is it possible to continually sell your product at a price above the average cost of production.

  Simulating operating systems scheduling

Simulate the long-term scheduler, the short-term scheduler and the I/O scheduler of the computer using the First-Come-First-Serve algorithm.

  Issues with trusted platform module

Research paper discussing the issues with Trusted Platform Module (TPM)

  Threads

Explain a complication that concurrent processing adds to an operating system.

  Design and programming

Use the semaphore methods to control the concurrency of the solution

  Virtual machines

Virtual machines supported by a host operating system

  Discuss an application that benefits barrier synchronization

Discuss an application that would benefit from the use of barrier synchronization

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