Question: Task 3 ( 3 0 pts ) : Converting String to Integer In this task, you ll write an assembly code to convert a string
Task pts: Converting String to Integer
In this task, youll write an assembly code to convert a string to an integer. For example, say a string is declared
in the data segment:
data
numstr: string
number: quad
Then your program will convert the string into an integer and store it to number You dont need to
consider negative numbers.
Just a refresher: if the string is the number can be calculated by
Be Careful...
The characters in a string are stored as their ASCII values, not the real digit;
When loading a character, or a byte, into a register, the command is LDRB or LDRSB and the destination
register is Wt not Xt
Requirements
You must use loops or recursion. If you want to use recursion, you must follow calling conventions and
manage stack frames;
You must not assume the length of the string numstr so you must not declare and hardcode any variable
representing string length in data and text ;
You must store the converted integer into variable number ;
You must not use any external libraries and functions;
You must use system call to print, not printf ;
Write your name and pledge at the top of the code.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
