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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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