Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.
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 NEXTStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started