lab4-5385.pdf - CSE/EE 5/7385 Microprocessor Architecture...

This preview shows page 1 out of 2 pages.

Unformatted text preview: CSE/EE 5/7385 Microprocessor Architecture and Interfacing Laboratory 4: Embedded String Search This experiment will acquaint you with using memory access and searching for embedded data. Step 1: Create the project and source files Make sure the MCBSTM32C board is connected to your computer through the ULINK-­‐ME adapter and is properly powered. 1. Create a new directory named strsearch. From the µVision menu, create a new project called strsearch and save it in the strsearch project directory. 2. Select the microcontroller from the Device Database. Vendor: STMicroelectronics, Device: STM32F107VC 3. After selecting the device, µVision prompts with a dialog, Answer NO since we use a custom startup file for this project. 4. Go to the shared directory below, download the startup file to the project directory and add the startup file to the project. 5. Create a new file (File -­‐> New) and save it as strsearch.s 6. Add strsearch.s to the project STEP 2: In strsearch.s, write an ARM assembly program that will search through memory for the characters ‘H’, ‘E’, ‘L’, and ‘P’. These characters must be found in upper case and they have other characters in between them. When your program finds the character ‘0’, it should halt processing. If the program finds all the letters, r0 should contain the offset of the first ‘H’ after the memory has been processed. Otherwise, it should contain the value 0x00. Furthermore, registers r4, r5, r6, and r7 should contain the offset address of the first occurrence of ‘H’, ‘E’, ‘L’, and ‘P’, respectively. After getting your program to work, change the content of the memory to try 04 different cases such as where one of the required characters is not present. SAMPLE CODE: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Assembly code program for ARM7 ; ; The example program searches for embedded character string ; ; ; ; M. A. Thornton ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; AREA asm_code, CODE, ALIGN=2 ENTRY STOP ; ; insert your code here ; b STOP ;infinite loop processing complete AREA TEST_DATA DCB END asm_data, DATA "psdfnOLHHNOHDP[[HELkhjxvcphelHELLpppHELP",0 1 The write-­‐up should include the laboratory steps, the idea of the experiment, and discussion of the experiment, such as what you learned, if you encountered problems with the string search, memory access and how they were rectified. Additional questions 1-­‐ What is the use for the DCB directive? 2-­‐ What is the difference between the DCB directive and the DCD directive? 3-­‐ In the following string: "psdfnOLHHNOHDP[[HELkhjxvcphelHELLpppHELP",0 what is the purpose of the 0 at the end? 2 ...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern