Write an ARM assembly language program that scans a string terminated by the null byte 0x00 and copies the string from a source location pointed at by r0 to a destination pointed at by r1.
What will be an ideal response?
AREA scan, CODE, READWRITE
Entry
ADR r0,String1 ;r0 points to the source string
ADR r1,String2 ;r1 points to the dest string
Copy LDRB r2,[r0],#1 ;read a byte and update pointer
STRB r2,[r1],#1 ;copy the byte and update ptr
CMP r2,#0x00 ;test for terminator
BNE Copy ;repeat until terminator found
SVC #0x123456 ;stop
String1 DCB "this is a string", 0x00 ;dummy string
String2 SPACE 20 ;reserve 20 bytes for copy
END
Computer Science & Information Technology
You might also like to view...
What is the purpose of the reverse operator in C++?
A. There is no reverse operator in C++. B. To return the hexadecimal address of a variable. C. To report the system backup rate. D. To allow the variables to be switched during program execution.
Computer Science & Information Technology
An XML document can be edited in Notepad
Indicate whether the statement is true or false
Computer Science & Information Technology
How text flows, or ________, around a graphic is controlled in the Picture Tools tab
Fill in the blank(s) with correct word
Computer Science & Information Technology
In conventional practice, data is stored or transmitted in a form called "____________________."
Fill in the blank(s) with the appropriate word(s).
Computer Science & Information Technology