Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Modify the program to allow the user to exit once a key other than 0-6 is entered .ORIG x3000 RESTART LEA R0, PROMPT PUTS GETC

Modify the program to allow the user to exit once a key other than 0-6 is entered

 .ORIG x3000 RESTART LEA R0, PROMPT PUTS GETC ; place ascii value of input character into r0 ADD R4, R0, x0 ; copy r0 into r3 ADD R4, R4, #-16 ; subtracts 48, the ascii value of 0 ADD R4, R4, #-16 ; ADD R4, R4, #-16 ; r4 now contains the value LEA R0, DAYS ; Loads address of days into R0 ADD R4, R4, x0 LOOP BRz DISPLAY ADD R0, R0, #10 ; go to next day ADD R4, R4, #-1 ; decrement loop variable BR LOOP DISPLAY PUTS BR RESTART INVALID HALT PROMPT .STRINGZ "Please enter number:" DAYS .STRINGZ "Sunday " .STRINGZ "Monday " .STRINGZ "Tuesday " .STRINGZ "Wednesday" .STRINGZ "Thursday " .STRINGZ "Friday " .STRINGZ "Saturday " .END

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2008 Comprehensive Concepts And Techniques

Authors: Gary B. Shelly, Corinne Hoisington

1st Edition

1423927168, 978-1423927167

More Books

Students also viewed these Databases questions

Question

4. I can tell when team members dont mean what they say.

Answered: 1 week ago