Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Name: Jared Student Number: 101329282 Content Of Lab: Other tasks: 1-2-3-4-5-Summarizethemaingoalonthecodeyouwroteinstep2intwosentences(max30words,min15words).Includeyourcodeforstep2asatext(NoimageandNoappendix)Summarizetheideaofthealgorithmyouusedinstep4inshortparagraph(max60words,min30words)IncludeyourcodeforstepAasatext(NoimageandNoappendix)Includeascreenshotfortwosampleresultswithyourstudentnumberandnameasateststring Algorithm: I. Copy a value from x to r1 (e.g. ldr r1,=x, define x
Name: Jared
Student Number: 101329282
Content Of Lab:
Other tasks: 1-2-3-4-5-Summarizethemaingoalonthecodeyouwroteinstep2intwosentences(max30words,min15words).Includeyourcodeforstep2asatext(NoimageandNoappendix)Summarizetheideaofthealgorithmyouusedinstep4inshortparagraph(max60words,min30words)IncludeyourcodeforstepAasatext(NoimageandNoappendix)Includeascreenshotfortwosampleresultswithyourstudentnumberandnameasateststring Algorithm: I. Copy a value from x to r1 (e.g. ldr r1,=x, define x first) II. Make an 'and' between r1 and 1 , result in r2 (hint and x,y,#1 ) III. Shift the bits of r1 to the right by 1 IV. Repeat step II and III using registers r3,r4,r5,r6 instead of r2 V. add r2 to r1 VI. shift r1 to the left by 1 and repeat step IV and V with registers r3,r4,r5,r6 instead of r2 (use lsl or mov with as1) VII. Store the result in y 3-Write an assembly code to print the following message: Welcome to ARM assembly (see chapter 5 slides, just copy and paste!!) 4-Write an assembly code to read a string then print each half of it in a separate line: Example 1: Input: *Welcome to ARM assembly Output: *Welcome to ARM assembly Example 2: Input: 123456 Output: 423 Algorithm: See echo code in lecture 5 slides and use the following hints: - The actual size of the read characters will be stored in ro after first svc, store this is r5, for example - Use the print out part of the echo three times o One time as is but with half of the number stored in r5 (lsr by 1 ) o One time for another message (say message2: .asciz " " with size 1 ) one time for the original message but add r5 to rl where the address of the message is stored So the general layout Read the string and store it in message Print the first half of message Print message2 Print the second half of message
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started