Question: Write an ARM program to read a hexadecimal string, convert it into a 32-bit 2s complement value first, and then convert it into a signed

Write an ARM program to read a hexadecimal string, convert it into a 32-bit 2s complement value first, and then convert it into a signed decimal string. in the DATA AREA, o Declare and initialize a null-terminated string with a label of HexStr and an initial value of your choice (each byte is the ASCII of a Hex symbol in this 32-bit 2s complement number). For example, the string could be A8F, 0. o declare and initialize a signed word as 0, label this word as TwosComp o reserved a chunk of zeroed memory with a length of 12 bytes, label this chunk of memory as DecStr (why a length of 12 bytes is enough?) o reserved a chunk of zeroed memory with a length of 11 bytes, label this chunk of memory as RvsDecStr (why a length of 11 bytes is enough?) o Store each one of the above four labels as a word with an address label, e.g., adrHexStr DCD HexStr for HexStr, and EXPORT each address label, e.g., EXPORT adrHexStr. in this program (in the CODE AREA), o read the ASCIIs of up to eight symbols of a Hex number (e.g., 1A2B3D4D or FFF4B3FA) symbol by symbol (character by character) from the memory at HexStr and convert this list of symbols in ASCII code into a 32-bit twos complement number (e.g., 0x1A2B3C4D or 0xFFF4B3FA). You may assume that this Hex number will be zero-extended if less than eight symbols are read, i.e., the missing leading symbols are zeros (e.g., A79 at HexStr should be converted into 0x00000A79). o store this 32-bit 2s complement number at TwosComp. o convert the 32-bit signed number at TwosComp to a NULL terminated ASCII string that represents its value in signed decimal, each byte is the ASCII of the minus sign or a decimal digit in this number. A minus sign, , needs to be placed at the beginning if this number is negative. E.g., if [TwosComp] = 0x1A2B3C4D, then it should be converted into 439041101 ; if [TwosComp] = 0xFFF4B3FA, then it should be converted into 740358.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Given the complexity of the task at hand lets break it down into more manageable parts This task involves writing an ARM assembly program that takes a ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!