Introduction to Computing: Program 5 (Coding Sequence of mRNA) Solved
Objective The purpose of this assignment is to program keyboard interrupts in LC-3 assembly language. The application detects the coding sequence (CDS) of a messenger RNA.
Starter Code
You can find the starter code on Canvas.
Details This assignment will be written in two parts:
● the main program at x3000
● the interrupt service routine (ISR) at x2600
Background
Messenger RNA (mRNA) is a large family of RNA molecules that convey genetic information from DNA to the ribosome, where they specify the amino acid sequence of the protein products of gene expression. The mRNA genetic information is in the form of a sequence of nucleotides which are arranged into codons consisting of 3 bases each. Valid bases that make up codons are A (Adenine), C (Cytosine), G (Guanine), and U (Uracil). As the picture shows, the “coding sequence” of an mRNA starts with a START codon and ends with a STOP codon. A START codon is always an AUG sequence, and the STOP codon can be one of three possible sequences, UAG, UAA , or UGA.
Interrupt Service Routine (ISR)
In this assignment, we will use the keyboard as the input device for interrupting the main program. The ISR will start at x2600. The ISR simply reads the character typed and accepts only the symbols ‘A’, ‘C’, ‘G’, or ‘U’. Any other symbol will be ignored. Once it detects a valid symbol, it places it at location x3600. Note, any value other than 0 at this location indicates a valid input character as the ISR only writes valid characters. Also, the ISR does not echo the character to the console. It is considered bad programming to perform time-consuming tasks like I/O inside Interrupt Service Routines.
Main Program
The main program will constantly check the location x3600 to see if there is an input character there and writes a 0 to the location when it processes it. Processing an input character follows a simple algorithm which can be described by the above incomplete finite state machine (FSM). It is incomplete in that, it does not account for all inputs in all states but only presents some of the relevant inputs. You are welcome to solve the problem without the FSM as long as you implement the expected functionality.
The Main program will start at x3000 and will write to the screen the character it reads from x3600, making sure it does this only once for each input entered. Also, it checks to see if a START codon (AUG) is detected. If so, it prints the pipe symbol ‘|’. After this point, it looks for a STOP codon (UAG, UAA, or UGA) so the program can terminate. (Note that for this program, the coding sequence itself does not need to be aligned in groups of 3 bases per codon. This is unlike real mRNA.)
VERY IMPORTANT: You are not allowed to use any TRAP instructions in your interrupt service routine. To read a character that the user entered, you may not call TRAP x20 (GETC) or TRAP x23 (IN), or use any of the other TRAP routines. If you use TRAP in the interrupt service, your program is not correct and will fail our testing even though it may appear to work when you test it. You are free to use TRAPs in the main program. Do not forget to save and restore any registers that you use in the interrupt service routine.
Here is a screenshot as an example of how the console should look when you run the program. The first three cases show an empty coding sequence. Also, note that the user could have typed other invalid characters (including lowercase ‘a’, ‘c’, ‘g’, and ‘u’) which are filtered by the ISR and therefore not displayed by the main.
Submission Instructions ● You will work as a team of two to do the programming assignment but each of you will make an individual submission (can be the same). You are permitted to get help from ONLY the TAs and the instructor.
● The 2 files you submit should be :
○ A LC-3 assembly language file named Program5.asm . A starter version of this file is provided for you.
○ A screenshot of your LC3 Console showing the exact sequence of runs as shown above.
● Once you finish your program 5 solution, upload your solution as a single zip file with the 2 files in it, on Canvas.