[SOLVED] cmpe230 - Systems Programming - Homework 2 

30.00 $

Category:

Description

5/5 - (2 votes)

In this project, you will implement an A86 assembly language program that will input postfix expression involving hexadecimal quantities and evaluate it. After evaluation, the result should be output.  Here are some example inputs to the program and the outputs generated:

input output
2 3 + 4 5 + * 2 / 0016
A B C + 2 + * 00FA
1 2 4 + + FFFF ^ FFF8

The following  operations will be supported.

operation symbol meaning
+ addition
* multiplication
/ integer division
^ bitwise xor
& bitwise and
| bitwise or

You can make the following assumptions:

  • The input tokens are separated by a blank character.
  • The postfix expression given is syntactically correct.
  • All values and results of operations will be 16 bit values.

 

Testing

Your code will be graded automatically in the virtual machine you can find here. Specifically, we will execute the following commands to check the output of your program.

Step Command Explanation
1 a86 postfix_evaluator.asm Compiles your code and produces the executable
2 postfix_evaluator Runs the executable which takes postfix expression and outputs its result

You can also use the debugger with the following command: d86 postfix_evaluator