Question: 1 Task 1 : Install QEMU Emulator Recall that assembly programs are closely related to the hardware platform they are performed on , so an
Task : Install QEMU Emulator
Recall that assembly programs are closely related to the hardware platform they are performed on so an assembly program written in ARM syntax cannot be executed on any other machines. Most of the time, however, we also want to execute ARM assembly on some other machines. In this case, we can install an emulator that can
simulate the hardware execution of ARM machines on any type of machine. This is called crosscompilation. The emulator we are using is called QEMU.
To install QEMU on your virtual machine, type the following in your terminal:
$ sudo aptget install qemuuser
Once you have finished the installation, you need to write the simplest ARM assembly program the one listed in B in textbook and assemble and execute it Upon success, there should be nothing printed out no warnings or any type of output. To learn how to assemble, link, and execute an assembly program, read B in textbook.
To get credits for attendance, show your CA that you have installed QEMU, and can assemblelinkexecute the simplest ARM program. No submission needed.
Task : Write a Simple Program
One very common thing we do in programming is to print something to the screen. Although printing numerical numbers takes a bit more work, it is relatively much easier to print a string. In this task, you will learn how to declare a string, and how to invoke system call to print the string out. The code listed in B in textbook is your
starter code. Please learn how to declare data and load address by reading B in textbook before starting this task.
Unlike highlevel languages, in assembly, if we want to print a string, we have to declare it first in the data segment:
data
msg: string "Hello World!
To print this string out, we need to set several registers to correct values before invoking the system call, because the system needs to retrieve the information about this string from these registers:
Register Content
X Destination for printing, its value is
X The address of the string to be printed
X The length of the string to be printed
X System call number for printing, its value is
Once these registers are ready, we can invoke the system call by using instruction: SVC and the string will be printed out!
Lastly, to terminate the program successfully, we need the following instructions:
MOV X
MOV X
SVC
Requirements
Note your code is a complete assembly program not just a sequence of instructions It must be able to assemble, link, and execute without error and warnings. When executed, the program must finish without problems;
If your code cannot assemble, you get no credit this is the same to C programs that cannot be compiled;
You must declare the length of the string as a quadword in the data segment;
You must put comments on every instruction you wrote; no need to comment on labels and directives;
You must put your name and honor code pledge at the top of your code in comments
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
