Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

DAY 1 : Write assembly code for arm . Use the template for the purpose .

The template contains three assembly files boot.s ,crt.s and app.s . -> boot.s file is used to set up the ector table , !o need to modify this file . -> crt.s file is used to initiali"e the stac# of each mode ,!o need to modify this file -> app.s file is used to $rite do$n the application code . step 1 : %reate a separate directory usin& command m#dir test step ' : copy boot.s , crt.s and app.s from templete folder to test folder step ( : )pen app.s file usin& i or any other editor and $rite some arm instructions step * : compilin& the code -> compile boot.s usin& follo$in& instruction arm-elf-as -D -ahlms --&stabs -mcpu+arm,tdmi -o boot.o boot.s >t After this step $e $ill &et boot.o ob-ect file step . : compile crt.s usin& the follo$in& instruction arm-elf-as -D -ahlms --&stabs -mcpu+arm,tdmi -o crt.o crt.s >t After this step $e $ill &et crt.o ob-ect file step / :compile crt.s usin& the follo$in& instruction arm-elf-as -D -ahlms --&stabs -mcpu+arm,tdmi -o app.o app.s >t After this step $e $ill &et app.o ob-ect file step ,:!o$ $e need to lin# all the three ob-ect file and produce the final e0ecutable .1or this $e $ill use the lin#er arm-elf-ld -o result boot.o crt.o app.o -Tte0t+2 After this $e $ill &et a final e0ecutable $ith the name of result step 3: !o$ $e can simulate the pro&ram by $ritin& the instruction arm-elf-insi&ht result 40ercise: %omplete each of these e0ercises to practice usin& A56 data processin& instructions and to learn ho$ to use the barrel shifter, multiplier, and condition code fla&s 7 unsi&ned addition 7 6ultiplication 7 5e&ister-s$ap al&orithm 7 Absolute 7 Di ision 8ints: Register-swap algorithm: The 4)5 instruction is a fast $ay to s$ap the contents of t$o re&isters $ithout usin& an intermediate stora&e location such as a memory location or another re&ister. 9uppose

t$o alues a and b are to be e0chan&ed. The follo$in& al&orithm could be used: a+ab b+ab a+ab Write the A56 code to implement the abo e al&orithm, and test it $ith the alues of a + 201/(12'*% and b + 201,.(:A;D. 9ho$ your instructor the contents before and after runnin& the pro&ram. Absolute value: Write A56 assembly to perform the function of absolute alue. 5e&ister r2 contains he initial alue, and r1 contains the absolute alue.

You might also like