Be sure to modify the variables with YOUR First and Last names!
This is a take-home Lab. You should be able to do this with your RaspberryPi as discussed. However, you may also use the IoT Lab in ERB to connect to your Pi and do this assignment.
This is an individual assignment.
You will be required to provide READABLE screen captures in a PDF file.
You will be using the gdb debugger to pause your program at specific places in your program. We have discussed how to do this in class multiple times.
You will use my c code below to create a function in ARM assembly that will concatenate your first name and last name into a single string based on the definition of the external function ‘strCat’.
// CSE 2312 Computer Org and Assembly Language Programming// strings concatenate// YOUR NAME#include
- You will place a breakpoint where strCat is called.
- You will ‘step’ into the assembly function.
- You will need to list your assembly function to find the BX LR line.
- You will place a breakpoint at the BX LR line.
- DO NOT Continue Yet!
- You must use the debugger to display the memory location of the string “first”
- the command is:x/64cb $r#
- Replace the # with the correct register number, note the first address printed, you will need this later.
- Now ‘continue’ the program.
- When it pauses at BX LR, you will need to display the memory as before, but replace ‘$r#’ with the address noted earlier.
- Now ‘continue’ again.
- The program should now be complete and c should have printed the full name.
- Take a screenshot of the window showing all the debugger output.
- You may have to repeat the process flawlessly to get all the data on one screen
- You will also provide a screenshot of the assembly code. Your name must be in a comment at the top of the file.
This is a take-home Lab. You should be able to do this with your RaspberryPi as discussed. However,
you may also use the IoT Lab in ERB to connect to your Pi and do this assignment.
This is an individual assignment.
You will be required to provide READABLE screen captures in a PDF file.
You will be using the gdb debugger to pause your program at specific places in your program. We have
discussed how to do this in class multiple times.
You will use my c code below to create a function in ARM assembly that will concatenate your first
name and last name into a single string based on the definition of the external function ‘strCat’.
#// CSE 2312 Computer Org and Assembly Language Programming
// strings concatenate
// YOUR NAME
#include
// EXIT_ macro
#include
// printf
#include // PRI macro
#include
// C99 uintX_t and intX_t types
extern void strCat(const char first[], const char last[]);
int main(void)
{
char last[] = “Lastname”;
char str[] = “Hello World!”;
char first[30] = “Firstname “; // with a ‘space’ at the end
strCat(first, last);
printf(“Full Name = %s\n”, first);
return EXIT_SUCCESS;
}
1.
2.
3.
4.
5.
6.
7.
8.
9.
You will place a breakpoint where strCat is called.
You will ‘step’ into the assembly function.
You will need to list your assembly function to find the BX LR line.
You will place a breakpoint at the BX LR line.
DO NOT Continue Yet!
You must use the debugger to display the memory location of the string “first”
the command is:
x/64cb $r#
Replace the # with the correct register number, note the first address printed, you will need this
later.
10. Now ‘continue’ the program.
11. When it pauses at BX LR, you will need to display the memory as before, but replace ‘$r#’ with
the address noted earlier.
12. Now ‘continue’ again.
13. The program should now be complete and c should have printed the full name.
14. Take a screenshot of the window showing all the debugger output.
15. You may have to repeat the process flawlessly to get all the data on one screen
16. You will also provide a screenshot of the assembly code. Your name must be in a comment at
the top of the file.