Question: Write a program in ARM assembly language (which can be executed on ARMSim simulator) to convert an ASCII string containing positive or negative integer decimal
Write a program in ARM assembly language (which can be executed on ARMSim simulator) to convert an ASCII string containing positive or negative integer decimal string to an integer. Input is given as null-terminated string stored at location given by the label value. The string can containing an optional '+' or '' followed by some combination of the digits 0 through 9. Your program should compute the integer value equivalent to this string of digits, then place the number in register R1. If a non-digit character appears anywhere in the string, your program should stop with the value 1 in register R1. For example, if input is "24" (or in ASCII 0x32, 0x34, 0x00) then register R1 should contain the value 24ten. (Hint: The ARM MUL instruction takes two registers as input. There is no "MULI" instruction. Thus, just store the constant 10 in a register.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
