Question
----------------------------------------------------------------------------------- / * -- HelloWorld -- */ .global _start _start: mov r0, #1 ldr r1, =string1 mov r2, #13 mov r7, #4 swi 0 mov
-----------------------------------------------------------------------------------
/ * -- HelloWorld -- */
.global _start
_start:
mov r0, #1
ldr r1, =string1
mov r2, #13
mov r7, #4
swi 0
mov r7, #1
swi 0
.data
string1:
.ascii "Hello World! "
------------------------------------------------------------------------------
Modify theHello World program above so that it asks the user for their first initial (e.g. T) and then responds with Hi _! (e.g. Hi T!). The Linux system call to read is Syscall 3, just as with the other calls you put 3 into R7 to indicate the system call number. When you use this call, the system looks for the device to read from in R0 (0 = keyboard), looks to R2 for the number of characters to read (in this case 1) and places the characters into memory starting with the address in R1
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