research-writing-services
4.8
research-writing-services
4.9
research-writing-services
4.7

Programming standards

Can you program this homework assignment with the following requirements?
[[email protected] ~]$ g++ version
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
/* this is the version of c++ so it must be compatible*/
Also, follow the programming standards page.
Write an interpreter C++ for a very simple pseudo-code. The instructions on a one-accumulator virtual machine are as follows:
Format Meaning
1XXX Load accumulator with contents of XXX
2XXX Store accumulator into location XXX
3XXX Add contents of XXX to accumulator
4XXX Subtract contents of XXX from accumulator
5XXX Multiply contents of XXX to accumulator
6XXX Divide contents of XXX by accumulator
7XXX Branch to instruction XXX if accumulator is positive
8XXX Branch to instruction XXX if accumulator is negative
9XXX Stop (except 9999)
The format of a pseudo-code program is as follows:
Initial Data Values
9999
Pseudo code program consists of the above instructions
9999
The memory unit of our virtual machine is 2000 words and each word holds an integer less than or equal to +9999. The first half of the memory is used for storing data and the second half is for storing program instructions. The initial data values should be read into the beginning of the data area of the memory unit in that order. The validity of the values in the memory should always be checked. The pseudo code instructions should be read into the program instruction area of the memory unit before the program execution cycles start.
You will have to implement your program, say, interpreter.c, on our Unix system on empress.csusm.edu. You are supposed to prepare a pseudo code test program as the input to your pseudo-code interpreter. The output of your interpreter has to demonstrate that at least one instruction of each format in your test program is executed for at least once and both possibilities of the branch instruction are tested. A shell command script file compiling and running your program should also be prepared. The files of source program, input, output, and shell script must be submitted as one zipped file.
The documentation, implementation and testing of your program should be done according to the Standards of Programming Assignments.
A sample input file (PseudoCodeTestProgram) to your program is as follows:
1
2
3
4
5
9999
1000
2001
3004
4001
5002
6004
7004
8003
9000
9999
The content of a sample shell script file, say, interpreter.sh, consisting Unix commands is as follows:
gcc o interpreter.out interpreter.c
interpreter.out < PseudoCodeTestProgram > OutputDisplay
Its sample output file (OutputDisplay) could have the following content:
ACC = 0 PC = 0 Next Instruction = 1000
Initialized Memory = 0:1, 1:2, 2:3, 3:4, 4:5
ACC = 1 PC = 1 Next Instruction = 2001
Initialized Memory = 0:1, 1:2, 2:3, 3:4, 4:5
ACC = 1 PC = 2 Next Instruction = 3004
Initialized Memory = 0:1, 1:1, 2:3, 3:4, 4:5
ACC = 6 PC = 3 Next Instruction = 4001
Initialized Memory = 0:1, 1:1, 2:3, 3:4, 4:5
ACC = 5 PC = 4 Next Instruction = 5002
Initialized Memory = 0:1, 1:1, 2:3, 3:4, 4:5
ACC = 15 PC = 5 Next Instruction = 6004
Initialized Memory = 0:1, 1:1, 2:3, 3:4, 4:5
ACC = 3 PC = 6 Next Instruction = 7004
Initialized Memory = 0:1, 1:1, 2:3, 3:4, 4:5
ACC = 3 PC = 4 Next Instruction = 5002
Initialized Memory = 0:1, 1:1, 2:3, 3:4, 4:5
ACC = 9 PC = 5 Next Instruction = 6004
Initialized Memory = 0:1, 1:1, 2:3, 3:4, 4:5
ACC = 1 PC = 6 Next Instruction = 7004
Initialized Memory = 0:1, 1:1, 2:3, 3:4, 4:5
ACC = 1 PC = 4 Next Instruction = 5002
Initialized Memory = 0:1, 1:1, 2:3, 3:4, 4:5
ACC = 3 PC = 5 Next Instruction = 6004
Initialized Memory = 0:1, 1:1, 2:3, 3:4, 4:5
ACC = 0 PC = 6 Next Instruction = 7004
Initialized Memory = 0:1, 1:1, 2:3, 3:4, 4:5
ACC = 0 PC = 7 Next Instruction = 8003
Initialized Memory = 0:1, 1:1, 2:3, 3:4, 4:5
ACC = 0 PC = 8 Next Instruction = 9000
Initialized Memory = 0:1, 1:1, 2:3, 3:4, 4:5

Related Posts

Quality Writing Features

Price Start $10
  • 24/7 Customer Support
  • All Subject Areas
  • Money-Back Guarantee
  • Timely Delivery
  • Originality report
  • Confidentiality guaranteed

Ordering Homework Writing Service

You can get our ideal online homework help services with four easy steps. All you have to do is inform us of your requirements. Immediately we will match with a specialist in your academic discipline. After that, we will track your order, review it to ensure it meets your requirements, and submit it to your email.

research-writing-services

Submit Requirements

Fill in your assignment instructions on the order form

research-writing-services

Writer match

Immediately you contact us for homework help; we will assign your assignment to an academic expert.

research-writing-services

Quality review

We have a team of editors, who will thoroughly review your assignment, ensuring there are no errors before submission

research-writing-services

Get Your Completed Paper

Once we have completed the assignment, we will deliver it to your account. Additionally, we will send a notification to your email.

ordernow

Affordable

Budget-friendly writing services

ordernow

Privacy

We don’t share our client’s information with a third party

ordernow

Unique

We write every assignment from scratch

Amazing Homework Writing Features

Once you consult us for homework help online services, you will attest to why we are among the USA's best essay writing services.

Read on and find out some of the features that make our services superlative.

Free Homework Writing Services

Free plagiarism checker

You can confirm that the content you get is original for free using our plagiarism checker.

Free samples

We offer unlimited access to our essay homework samples.

Free title page and bibliography

Once you place an order, we format it accordingly without demanding additional charges.

Free unlimited revisions

We offer free unlimited revisions until your assignment is of your desired quality..

Free editing and proofreading

We have a team of specialized editors who review your assignment before submission.

Free customer support

You can track the progress of your homework for free.

Request for Homework Writing Service Today!

We have over 500 homework writing experts, ready and waiting to help you improve your writing skills