CS 61 - Computer Organization & Assembly Language
Assignment 2 - due via electronic turnin by Saturday August 6,
2005 11pm
This program should be written in LC-3 assembly.
Read in two one-digit decimal numbers from the user and
subtract the first from the second, and output the answer as
a decimal number and as an 8-bit binary number.
In order to accomplish this, your program must:
- Read both numbers from the console using TRAP instructions
- Convert both numbers into a binary representation
- Negate the first number and add them together
- Output the result as a binary number, determining the value
of each bit and outputting either a '0' or a '1'
- Convert the number (including the sign) into a printable
decimal number and output the result.
What to turnin
Turn in your source code (the .asm file) making sure that your
name, id, and all relevant information is located in a block of
comments at the top of the file.