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 5 characters and stores it in memory location from address$1000 to$1004.

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. Write an assembly program which asks user to enter a character from

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!