Arm/decstr1

From ASMBits

arm/7seg8Previous

Write a function that reads an ASCII null-terminated string containing decimal digits, and returns the value of the number. The number is guaranteed to fit within an unsigned 32-bit number.

Sample Input

"1234"

Sample Output

r0=1234 (or 0x4d2)

Write your solution here

x
 
1
// A test case to test your function with
2
.data
3
Str: .string "1234"
4
5
.text
6
.global _start
7
_start:
8
    ldr r0, =Str    
9
    bl decstr
10
    b _start        // End of testing code
11
12
// Parse a decimal string
13
decstr:
14
    
15
    
Upload a source file...