Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Description In this lab, you are given a string in memory, and you must search through the string to find the ASCII characters HELP in

image text in transcribed
image text in transcribed
Description In this lab, you are given a string in memory, and you must search through the string to find the ASCII characters HELP" in order, though not necessarily sequentially. The address of the first time each character is found should be stored in registers r4, r5, r, and r7 (the first "H, instance in r4, the first E' instance in r5, ect). If and only if all the letters are found in order, the string is considered valid, and the address of the first instance of 'Hshould also be store should be stored in r0 instead. To make life easier for you, the string will be null terminated (will end with a 0 character). The program will terminate when the P" is found or when the null terminator is reached. whichever comes first. d in rO. If the letters are not found in order, Ox00 Example: If the searched string started at 0x800 and read: "HQEQLQPQ", Ox800 should be stored in rO at the end of the program. However, if the string read PLEHEL", nothing will be stored in r0 Code Given: For this lab, you are given an outline (that you may choose not to use) of the entire program. The program utilizes branches, which you should be familiar enough with to utilize the given code: AREA Lab4, CODE, ALIGN-2 ENTRY FindH BEQ FindE if *H' is found, branch to the E finder BNE FindH if O terminator not found keep searching for H BEQ STOP if 0 terminator found, branch to stop FindE Description In this lab, you are given a string in memory, and you must search through the string to find the ASCII characters HELP" in order, though not necessarily sequentially. The address of the first time each character is found should be stored in registers r4, r5, r, and r7 (the first "H, instance in r4, the first E' instance in r5, ect). If and only if all the letters are found in order, the string is considered valid, and the address of the first instance of 'Hshould also be store should be stored in r0 instead. To make life easier for you, the string will be null terminated (will end with a 0 character). The program will terminate when the P" is found or when the null terminator is reached. whichever comes first. d in rO. If the letters are not found in order, Ox00 Example: If the searched string started at 0x800 and read: "HQEQLQPQ", Ox800 should be stored in rO at the end of the program. However, if the string read PLEHEL", nothing will be stored in r0 Code Given: For this lab, you are given an outline (that you may choose not to use) of the entire program. The program utilizes branches, which you should be familiar enough with to utilize the given code: AREA Lab4, CODE, ALIGN-2 ENTRY FindH BEQ FindE if *H' is found, branch to the E finder BNE FindH if O terminator not found keep searching for H BEQ STOP if 0 terminator found, branch to stop FindE

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

More Books

Students also viewed these Databases questions