Question: .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

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!