This is the first of three little LC-3 programming assignments that will be due April 10, 17, and 24. There will also be a small non-programming assignment due on April 24.
This assignment must be submitted as a single file for Assignment 4 of the CSCI 255/ECE 109 section on UNCA moodle by 5:00 PM on Friday, 10 April.
In Assignment 2 the following encoding was used for transforming seven-bit inputs into a three-bit encoding.
Binary inputs | ASCII character input | ||
---|---|---|---|
0 | 0 | 0 | Character '0' |
0 | 0 | 1 | Characters '1' to '7' |
0 | 1 | 0 | Characters '8' or '9' |
0 | 1 | 1 | Characters 'A' to 'F' or 'a' to 'f' |
1 | 0 | 0 | Characters 'u' or 'U' |
1 | 0 | 1 | Characters 'l' or 'L' |
1 | 1 | 0 | Characters 'x' or 'X' |
1 | 1 | 1 | Any character not covered by the above cases |
Your assignment is to write a LC-3 program to perform this encoding. Here are a few more rules:
.ORIG x3400
.
R0
.
R7
.R0
and then call the RET
instruction
(which I know we have yet to cover in class).
The program DecodeLong.asm is an example of a program that solve most of this problem. Don't try to use it as a starting point for a solution as it doesn't follow the official flowcart and it is really very inefficient in its use of address space.
The program
TestAssign4.asm
can be used to test your program on many samples.
To use TestAssign4.asm you must
first load your program into the LC-3 simulator and then load
TestAssign4.asm. When you run
the two loaded programs, you should see a table of outputs
appearing from memory locations x3FF8
to x40FF
.