Answered step by step
Verified Expert Solution
Question
1 Approved Answer
arm assembler programming Description: In this lab, you are given a string in memory, and you must search through the string to find the ASCII
arm assembler programming
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, r6, and r7 (the first 'H' instance in r4, the first 'E' instance in r5, etc.). If and only if all the letters are found in order, the string is considered valid, and the address of the first instance of 'H' should also be stored in ro. If the letters are not found in order, Ox00 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. Example: If the searched string started at 0x800 and read: "HQEQLQPQ", 0x800 should be stored in ro at the end of the program. However, if the string read "PLEHEL", nothing will be stored in ro. 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 BEO STOP ;if O terminator not found, keep searching for H ;if O terminator found, branch to stop FindE BEQ Findl ;if 'E' is found, branch to the L finder BNE Finde BEQ STOP FindL ;if O terminator not found, keep searching for E ;if O terminator found, branch to stop BEQ FindP ; if 'L' is found, branch to the P finder BNE Findl BEQ STOP ;if O terminator not found, keep searching for L ;if O terminator found, branch to stop FindP BEQ STOP ;if 'P' is found, branch to the stop BNE FindP BEQ STOP ;if O terminator not found, keep searching for P ;if O terminator found, branch to stop STOP B STOP AREA asm_data, DATA, READONLY TEST_DATA DCB "psdfnOLHHNOHDP[[HELkhjxvcphelHELLPPPHELP",0 END You have completed this lab when: Demonstrate your program to the laboratory instructor and show the instructor that your program correctly stores the appropriate addresses in the appropriate registers for several strings. 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, r6, and r7 (the first 'H' instance in r4, the first 'E' instance in r5, etc.). If and only if all the letters are found in order, the string is considered valid, and the address of the first instance of 'H' should also be stored in ro. If the letters are not found in order, Ox00 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. Example: If the searched string started at 0x800 and read: "HQEQLQPQ", 0x800 should be stored in ro at the end of the program. However, if the string read "PLEHEL", nothing will be stored in ro. 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 BEO STOP ;if O terminator not found, keep searching for H ;if O terminator found, branch to stop FindE BEQ Findl ;if 'E' is found, branch to the L finder BNE Finde BEQ STOP FindL ;if O terminator not found, keep searching for E ;if O terminator found, branch to stop BEQ FindP ; if 'L' is found, branch to the P finder BNE Findl BEQ STOP ;if O terminator not found, keep searching for L ;if O terminator found, branch to stop FindP BEQ STOP ;if 'P' is found, branch to the stop BNE FindP BEQ STOP ;if O terminator not found, keep searching for P ;if O terminator found, branch to stop STOP B STOP AREA asm_data, DATA, READONLY TEST_DATA DCB "psdfnOLHHNOHDP[[HELkhjxvcphelHELLPPPHELP",0 END You have completed this lab when: Demonstrate your program to the laboratory instructor and show the instructor that your program correctly stores the appropriate addresses in the appropriate registers for several stringsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started