问题
The assembly language that I"m using is ARM Assembly.
Would I use the ADD instruction to do so? Would I have to start by taking in a number in decimal and then using some instruction to convert the decimal number to binary?
Let's say that I have three numbers 33, 25, and 14. I want to add them all together. Say that the three numbers are stored in an 8-bit array with binary numbers with three elements. After traversing through the array, would I have to convert the binary numbers to decimal and then add them? Or can I just add them directly using the ADD function?
What happens if I have to add two numbers that overflow the 8 bits? Say that I add 250 and 45 in which both numbers are in binary and stored in an array with its elements having 8 bits? How do I handle this?
来源:https://stackoverflow.com/questions/58849919/how-do-i-add-binary-numbers-using-arm-assembly