Question: TASK 1 : SETUP ( 1 5 PTS . ) 1 . EQU Directives - Create an EQU directive for the value 1 and label

TASK 1: SETUP (15 PTS.)
1. EQU Directives
- Create an EQU directive for the value 1 and label it MYTEST.
2. Initializing Constants
- Create constant string named TESTDATA1 and give it the value "AbWALDOcD".
- Create constant string named TESTDATA2 and give it the value "WWW".
- Create constant string named TESTDATA3 and give it the value "00W8AL0WALDOcF".
- Create constant string named TESTDATA4 and give it the value "n (empty string).
3. Creating Variables
- Create a 4-byte variable named LOCATION
TASK 2: MAIN FILE (15 PTS.)
- Write the code to load R0 with a test string depending on the value of MYTEST.
- If the value of MYTEST is in the range of 1-5:
- load the address of the corresponding test string into R0
- call the subroutine findWaldo (Write the subroutine in the main.s file, so that you can test it here first. You will move it later.)
- end the program
- If the value of MYTEST is outside of the range of 1-5:
- turn on the red LED
- end the program TASK 3: SUBROUTINE PART I (40 PTS.)
- Write a subroutine named findWaldo that looks for the case-sensitive full name "WALDO" in the string pointed to by the address in R0.
- If the full string is found:
- turn on only the green LED
- return the address of the first byte of the WALDO string (i.e., the "W") in Ro
- If the full string is NOT found:
- output the color yellow on the LEDs
- return the value 0 in R0
- IMPORTANT:
- The first line of your subroutine should be:
PUSH \{LR, R12\}
- The last 2 lines of your subroutine should be:
POP \{LR, R12\}
BX LR
- We will talk about why you need this in class.
- For all tasks writing to the LEDs, you MUST use the function call setData as we used it in previous labs. That is the ONLY way that you are allowed to write to the LEDs. CAUTION: The subroutine setData will overwrite any values in R0 and R1.
TASK 1 : SETUP ( 1 5 PTS . ) 1 . EQU Directives -

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 Programming Questions!