SPO-600 64-bit Assembly Language Lab4-part2
In our previous part we had run the loop for 10 times. So, we only needed a single digit. However in the next task we will work with the aarch64 system to write a code that will loop to 30. So we have 2 digits to work with for which I will use 2 registers. Quotient was calculated by udiv which was my first digit. On the other hand remainder was calculated by the msub which was stored in the second digit. Once calculated I stored both of them registered in their specific locations on the string by using the strb.
You can see all my codes from my github repo:
Below is the output of my code with the leading zero:
In this task I have to edit the code in such a way that it will remove the unnecessary leading zero of the first 10 numbers.
I accomplished it by using a label. A label has been added before the second writing the second digit so that the first digit can be skipped. cmp command used to compare the register that holds loop counter with register having value 10 and another command b.lt is used to branch to the label when the counter value is less than 10 as it is a single digit. Also I edited the msg string a bit to make it work. Below is the output of my final code.
I could not proceed to the task 6 which need to work with x86_64 system as I could not manage enough time so far to troubleshoot the issues that I am facing to make it work on that. I will post another blog once I can make it work on that architechture.