MyLearningSpace- Coding Assignment

Added on - Sep 2019

Trusted by 2+ million users,
1000+ happy students everyday
Showing pages 1 to 3 of 6 pages
Submit assignments using MyLearningSpace following theassignment and codingspecifications.YouCANNOTuse the structured control commands (If - Then - Else - Endif; If - Then- Endif) as described in the EASy68K > Assembler Commands > Structured Control.Forallprograms:Input any required values from the keyboard.When prompting the user for input, be user friendly and state the input range indecimal for the user; don't assume the user understands phrases like "unsigned8-bit number".Output results to the screen.Run the program with multiple sets of data to prove your program works andhandles all of the appropriate cases.1.Background: Use Easy68K Text I/O task 5 to read one ASCII character fromthe keyboard.Write a program to prompt the user for one character from the keyboard. Forthe character entered, classify the character as a number, a letter, or other if it isnot a number or a letter.oLoop until the user enters an * (asterisk).oOutput must be of the formcharacter is classification, e.g. 5 is anumber, V is a letter, $ is other.oFor example,> prompt for one character> user enters5> you output5 is a number> .... loop until * entered2.Background: Use Easy68K Text I/O task 4 - "Read a number from thekeyboard into D1.L". Task 4 takes the decimal number you enter and convertsit from ASCII into an equivalent numeric value. For example, when you enterthe characters '12' on the keyboard, you are actually entering the ASCII string$3132. Easy68K I/O Task 4 will take $3132 hexadecimal and convert it to$0000000C or decimal 12.
Write a program to:oprompt the user for the number of items in the data list> valid range will be from 0 up to a maximum of 10 numbers> if the number of items is out of range, indicate the number is out ofrange and prompt the user for the number of items againoprompt the user for the data which will be unsigned 8-bit numbersentered individually> if the data is out of range, indicate the number is out of range andprompt the user for another number.Note: keep prompting for data until you get the correct number of'good'numbers.oFind the smallest number and output this number to the screen (indecimal) and the LEDs (in binary).oFor example,oprompt userouser enters3to indicate the number of items,oprompt userouser enters15,oprompt userouser enters500then ask for another number as entry is out of range,ouser enters255,oprompt userouser enters5oput out minimum ->Minimum: 5to screen and00000101to LEDsoBackground: Use Text I/O task 2 "Read string from keyboard and storeat (A1), NULL (0) terminated, length returned in D1.W (max 80) " Notethat A1 should be correctly initialized to point to the storage location forthe data.Write a program to prompt the user for a series of two character wordsfrom the keyboard and then display them on the monitor in reverseorder. The list of words will be terminated with a carriage return.For example,> prompt the user for a list of two character words; terminate list ofwords by pressing the <Enter> or <CR> key
> assume data entered correctly (no error checking)> user entersto<CR>be<CR>in<CR>as<CR><CR>> you output the words in reverse orderasinbeto> ask if there is another list of data. If the user enters Y ... repeat; if theuser enters N, then quit.HINT: I chose 2 character words so that each word would fit in a wordsized memory location. This would make the list easy to handle. Declarethe list at the end of your data area.oBackground: Many of the EASy68K I/O tasks execute additional code toconvert from the data entered on the keyboard to the expected data type.On a real system, when you enter a character from the keyboard itisnotautomatically echoed to the screen. The software receiving thecharacter determines whether it is appropriate to display the character onthe screen and handles the echo itself. Easy68K uses I/O Task 12"Keyboard Echo" to turn the keyboard echo on/off; by default, Easy68Kturns keyboard echo 'on' to simplify I/O for the beginning programmer.Using I/O task 12 with keyboard echo 'off' (youare now responsible fordoing the character echo to the screen) and I/O task 5 to read in singlecharacters, write a program to implement the I/O for a portion of a chipcredit card transaction:Input/Output:oprompt the user to "ENTER PIN + OK"> PIN will be four numbers> use the <Enter> key on the keyboard as the OK key> since the keypad is numeric, there is no need to check if data entered isa number
Desklib Logo
You are reading a preview
Upload your documents to download or

Become a Desklib member to get access