Question: Instructions: Complete the first program example outlined in the Chapter 1 tutorial link above, but use the linker rather than the C compiler to create

Instructions:

Complete the first program example outlined in the Chapter 1 tutorial link above, but use the linker rather than the C compiler to create your executable. Your program will look like this:

/* -- first.s */ /* This is a comment */ .global _start @ declare entry point _start: @ label for the entry point  mov r0, #2 @ Put a 2 in r0  mov r7, #1 @ setup system call to exit swi 0 @ system call to exit

Assemble and link your code with the following:

as o first.o first.s,

ld o first first.o,

run it with ./first,

look at the returned error code with echo $?

Save a screenshot of your interaction with the Raspbian shell showing how you assembled, linked, executed, and inspected the return code from your program. You can take a screenshot from the command line using the scrot command.

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