Question: Write an assembly program which asks user to enter a character from A to Z. If the user enters any other character, the program asks
Write an assembly program which asks user to enter a character from A to Z. If the user enters any other character, the program asks user to enter the character again. In this way the program inputs 300 characters and stores it in memory location from address $1000 to $112B. Use CPU register Y as counter.
Then modify the program so the program terminates if the user presses 'Q'.
please write the code in code warrior format. an example of how is provided below. 
LOOP YCASE LDS #ROMStart load stack pointer JSR Terminit ; needed for Simulator only LDD #PROMPT ; pass the adr of the string JSR printf print the string JSR getchar ; call getchar function -result is: character JSR putchar CMPB #Y' ; is it a Y ? BNE NCASE ; jump ahead if not JSR YFCN ; else do corresponding function for Y CMPB #'N' ; is it a N ? BNE MCASE ; jump ahead if not JSR NFCN else do corresponding function for N CMPB #'M' ; is it a M? BNE NEXT : jump ahead if not JSR MFCN ; else do corresponding function for M JMP LOOP ; loop for more input NCASE MCASE NEXT
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
