Jump to content
xRazor

ARM assembley division/multiplication

Recommended Posts

Hello,

 

I'm studying programming in ARM assembly and i'm stuck with my homework. I have to write a program, that calculates the sum of arithmetic progression from 1 to n, step is 1.

 

Task seems to be quite easy, but i'm really stuck at the division/multiplication part. I can't use the multiplication instructions, so i guess i have to do it using shift (Kong gave me a hint to go for that one), but i'm failing to do the division part. Could anyone please give me an example with some comments how to do the division/multiplication in ARM assembly? Would appreciate, thank you.

Share this post


Link to post
Share on other sites

Sorry, I didn't see that.you can't use that.

One thing you could do for multiplication is a loop and add. For example if you want to do 3 * 3 you would loop 3 times and add 3 each loop. For division it's similar but you subtract.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...