csci 10 :: programming challenge 8 (due wed, oct 19)
Your challenge:

Write, compile, and execute a complete HLA program that does the following:

• [10 points] contains no static or automatic (var) variables
• [10 points] has a robust getUns8 procedure that takes a string parameter representing the user prompt, min and max parameters; guarantees a user input value in the range min to max inclusive; returns the input value in al; @forward declare the procedure
• [10 points] has a procedure showBits that has a single byte parameter and displays the value of the byte parameter in binary, preceded by % and with an underscore between each nibble
• main loop (give the user the option to repeat):
1. [60 points] display "PART ONE: ror,rol,shr,shl" and do the following:
• use getUns8 to get a user input
• display the user input value in decimal and binary -- ("input [decimal]:") and binary ("input [binary]:")
• rotate the user input value right one bit (ror) -- display the resultant value in decimal ("rotate right one [decimal]:") and binary ("rotate right one [binary]:")
• rotate the user input value left one bit (rol) -- display the resultant value in decimal ("rotate left one [decimal]:") and binary ("rotate left one [binary]:")
• shift the user input value right one bit (shr) -- display the resultant value in decimal ("shift right one [decimal]:") and binary ("shift right one [binary]:")
• shift the user input value left one bit (shl) -- display the resultant value in decimal ("shift left one [decimal]:") and binary ("shift left one [binary]:")
2. [60 points] display "PART TWO: add" and do the following:
• use getUns8 to get a user input
• display the first user input value in decimal and binary -- ("first input [decimal]:") and binary ("first input [binary]:")
• use getUns8 to get another user input
• display the second user input value in decimal and binary -- ("second input [decimal]:") and binary ("second input [binary]:")
• add the two values together
• check the carry bit (@c) after the add instruction and display "CARRY BIT SET/OVERFLOW" if the carry bit is set
• display the sum of the values in decimal and binary -- ("sum [decimal]:") and binary ("sum [binary]:")
Submitting your work:

Email your .hla file only (do NOT send the .exe) to me at jboydt@foobt.net.

Total points for this challenge:

150 points