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

Assignment Help Computer Engineering
Reference no: EM1333930

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: EM1333930

Questions Cloud

Aspects of judgments in the advice : Critically analyze Dan's friend's advice. Point out the relevant aspects as well as any judgments in the advice.
Trends and challenges paper and presentation : Prepare paper discussing existing trends and challenges in HR management and show how a complete performance management system differs from the use of annual performance appraisals
Vision and strategy of the organization : How does Coca Cola customer service perspective relate to the mission, vision and strategy of the organization?
Inflation and interest rates : What is the difference between systematic and unsystematic risk? How is the beta coefficient used to assess risk? Is it better to maximize return or minimize risk? Why?
Write down 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)
Elucidate how an increase in your nominal income : Elucidate how an increase in your nominal income and a decrease in your real income might occur simultaneously.
Analyze the business strategy of kodak and wal-mart blockbus : Analyze the business strategy of Kodak, Wal-Mart and Blockbuster.
How is employment-at-will applied in your organization : How is employment-at-will applied in your organization or in one with which you are familiar and what extent do the exceptions to employment-at-will limit its application in the organization
Addressing the confidentiality of medical records : What interests are served by maintaining confidentiality of medical records?

Reviews

Write a Review

Computer Engineering Questions & Answers

  How to change the employee class

design a program, employe_data.cpp, with the Employee class that has two employees; sets their age, yearsOfService, and salary (rounded to the nearest thousands of dollars; and prints their values.

  Write down a javascript function to validate a text field

Write down a JavaScript function to validate a text field on a form for holding a positive integer value, without using any inbuilt functions like IsNaN and so forth. If the text field contains a valid number then the JavaScript function would ret..

  Make a phonebook application using c++

make a Phonebook application using C++ STL (standard template library). Use the telephone number as the key and the name as the value.

  Which type of network devices would be supported

You have been asked to generate a paper that compares and contrasts guided versus wireless media for inclusion in your company's knowledge database.

  Handling the asset and threat

Propose the reasonable values for the items in risk register for this asset and threat, and offer justifications for your choices.

  Risk linked with using public infrastructure like internet

Describe in detail some probable difficulties and risk associated with utilizing a public infrastructure like the Internet, as part of the private business solution.

  Define the way for creating work breakdown structure

Define the way for creating work breakdown structure Use a hypothetical project to illustrate your understanding of the WBS.

  Write down four logic functions that are true

Implement the four functions using a ROM.Assume that X consists of 3 bits, x2 x1 x0

  Explain benefits of using the public variable version

Add a constructor to your preferred version, that takes 2 String parameters and initializes first and last.explain benefits of using the public variable version.

  A program that would calculate and print the parking charges

A parking garage charges a atleast fee of $2.00 to park for up to 3 hours. The garage charges an additional $0.50 per hour for each hour or part thereof in excess of 3 hours.

  Define the limitations of vb-script

OOP is not about programming as much as it is about thinking in a specific way. When you think of an object, you should see it as a set of properties and processes. Properties are the data, and methods are what you do to the data.

  What frustrations with computer capabilities today

What frustrations do you have with computer capabilities today.

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