![]() Mov r9, #7 LSB position in output repeated division by 2 2 asciz function to convert given value into a binary save the link register asciz "Enter a positive value (0-255) > " * Converts a decimal number to binary and outputs to screen */ ![]() I reckon there should be a better way of declaring the string to hold the output and how the string is built from the LSB (using R9) /* dectobin2.s */ I'm "playing" with ARM assembly on a Raspberry Pi, reading various tutorials and posts to help - no, it's not a college assignment, I'm too old for college! I'm pleased with getting the following code to take a decimal value (between 0 and 255) and output the binary string equivalent to the screen using scanf() and printf() but curious to know though whether those more experienced would consider this a "naive" solution? Are there any "gotchas"? Any better ways of tackling the problem?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |