Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write the following subroutine, which captures a user - entered string at run - time, storing it as a null - terminated character array (

Write the following subroutine, which captures a user-entered string at run-time, storing it as a null-terminated character array (just like the .STRINGZ pseudo-op, with the big difference that .STRINGZ requires a hard-coded character array at compile-time). ;------------------------------------------------------------------------ ; Subroutine: SUB_GET_STRING ; Parameter (R1): The starting address of the character array ; Postcondition: The subroutine has prompted the user to input a string, ; terminated by the [ENTER] key (the "sentinel"), and has stored ; the received characters in an array of characters starting at (R1). ; the array is NULL-terminated; the sentinel character is NOT stored. ; Return Value (R5): The number of non-sentinel chars read from the user. ; R1 contains the starting address of the array unchanged. ;------------------------------------------------------------------------- This subroutine should prompt the user to enter in a string of text, ending with the [ENTER] key. The string of text will be stored starting at whatever address is specified by (R1) and will be NULL-terminated (i.e. the subroutine will store zero (x0000= #0='\0') as a sentinel at the end of the array).

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

More Books

Students also viewed these Databases questions

Question

=+d. Purchaser: buys the item.

Answered: 1 week ago