A one-digit calculator

The problem

Write a program that reads two digits and an operator (+, -, * or /), and prints the result, so that it uses input, comparisons and jumps, and the arithmetic instructions.

Requirements

Technologies

Step by step

  1. Write the frame and read three keys, keeping them in three registers.
  2. Subtract '0' from the digits, and compare the operator with each of the four characters.
  3. Write one block of code for each operation, ending with a jump to a shared printing block.
  4. Write the printing block with AAM, skipping a tens digit of 0.
  5. Test with at least ten inputs, including 0, 9, subtraction below 0 and a division by 0.

Expected result

A program that prints the right answer for every pair of digits and operator, and a clear message for division by zero.

How it is evaluated

Ways to improve it