Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

.ORIG x3000 ; Starting address of the program BEGIN GETC ; Read a character from input BRzp METHOD ; Branch to METHOD if character is

.ORIG x3000 ; Starting address of the program

BEGIN GETC ; Read a character from input

BRzp METHOD ; Branch to METHOD if character is positive or zero

ADD R2, R2, #1 ; Increment R2 if character is negative

METHOD LD R1, VALUE ; Load the value stored at memory location VALUE into R1

ADD R1, R0, R1 ; Add the input character to R1

BRz SUCCESS ; Branch to SUCCESS if the result is zero

BRnp EXIT ; Branch to EXIT if the result is negative

SUCCESS LEA R0, CORRECT ; Load effective address of CORRECT into R0

PUTS ; Output the string stored at CORRECT

EXIT HALT ; Halt the program

VALUE .FILL #FFC0 ; Define a constant value #FFC0

CORRECT .STRINGZ "CORRECT BUTTON PRESSED" ; Define a null-terminated string

.END ; End of the program

Which keyboard key should the user press to print out "CORRECT BUTTON PRESSED" when the program below is executed? c, k, !, @

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_2

Step: 3

blur-text-image_3

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

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions