How do I add binary numbers using ARM Assembly?

泪湿孤枕 提交于 2020-03-04 19:35:49

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!