Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Online Market Research Cost Effective Searching Of The Internet And Online Databases

Authors: John F. Lescher

1st Edition

0201489295, 978-0201489293

More Books

Students also viewed these Databases questions