Computer science

Complete the following tasks to signify your successful completion of Unit 9. It should be the case that the only instructions you need to complete the programs assigned here are the ones I’ve described so far. Click here links to an external site. to see an HLA Programmer’s Reference Guide for the instructions we’ve learned so far. http://homepage.smc.edu/stahl_howard/cs17/FileManager/referenceguides/referenceguideiv.htm

Following the Electronic Submission Guidelines, please send me a copy of the .hla file you created for this assignment.

Write an HLA Assembly language program that calculates student enrollment fees at Santa Monica College. (Since we only know how to deal with integer arithmetic, our program will be slightly inaccurate). As of Spring 2020, the enrollment fee is $46/unit for residents and $370/unit for all others. The student services fee is $50 for Winter or Summer and $53 for Fall or Spring. The ID card is optional which saves $13 when its purchase is declined.

The enrollment fee will be entered based on a single 8-bit value entered by the user. The fee will have the format: sseeeeri, where ss is a two-bit value corresponding to the semester (00 for Fall, 01 for Winter, 10 for Spring or 11 for Summer), eeee is a four-bit value corresponding to the number of enrolled units, r is a single bit corresponding to whether the student is a California resident or not and i is a single bit corresponding to whether the ID Card Fee is being paid. The format of this bit field is diagrammed below:

BitField.jpg
Since just 8 bits are being entered, your program should expect to read 2 hexadecimal digits.

Below are some sample program dialogues that demonstrate these ideas.
(Hint: Do this in small steps, bit-by-bit. There’s a lot to it… )
(Another Hint: HLA read in hex format when you read directly into a register. So do that…)
(Further Hint: The most important part of this assignment is to work with the packed data field entered by the user to extract the sub-parts out of it. The overlapping design of the Intel registers helps you parse this kind of data field and you can shift the bits around to get the right part into BH or BL, for example… )
(Final Hint: Since we haven’t learned how to do multiplication yet, although it’s kinda painful, I was expecting that you would perform the multiplication by a looping set of addition instructions)

Feed me(2 hex digits with the bits seekers): 00
Sorry Charlie, badly formed data!

Feed me(2 hex digits with the bits seekers): C3
Sorry Charlie, badly formed data!

Feed me(2 hex digits with the bits seekers): 3E
Fall Semester
15 units
CA Resident
No ID Card
Total Fees = $ 730

Feed me(2 hex digits with the bits seekers): 3C
Fall Semester
15 units
Non-Resident
No ID Card
Total Fees = $ 5590

Feed me(2 hex digits with the bits seekers): 45
Winter Semester
1 unit
Non-Resident
ID Card
Total Fees = $ 420

Feed me(2 hex digits with the bits seekers): 47
Winter Semester
1 unit
CA Resident
ID Card

This question has been answered.

Get Answer