Answered step by step
Verified Expert Solution
Question
1 Approved Answer
[ 3 0 ] < 2 . 9 > Write a program in LEGv 8 assembly to convert an ASCII string containing a positive or
Write a program in LEGv assembly to convert an ASCII string containing a positive or negative integer decimal string to an integer. Your program should expect register X to hold the address of a nullterminated string containing an optional or followed by some combination of the digits through Your program should compute the integer value equivalent to this string of digits, then place the number in register X If a nondigit character appears anywhere in the string, your program should stop with the value in register X For example, if register X points to a sequence of three bytes ten, ten, ten the nullterminated string then when the program stops, register X should contain the value ten. The ARMv MUL instruction takes two registers as input. There is no MULI instruction. Thus, just store the constant in a register.
Do not give the whole implementation. Just the LEGv code, like:
LOOP:
SUBIS X X #
BLE DONE
ADDI X X #
B LOOPDONE:
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