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
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