Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7826413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T09:24:08+00:00 2026-06-02T09:24:08+00:00

I am stuck as to why this function repeatedly calls it self when it

  • 0

I am stuck as to why this function repeatedly calls it self when it should return.

Initialize:
    stmfd sp!, {R0-R4,lr}
    mov R4, #0  @used for storing 0
    mov R0, #2
    mov R5, #0
    ldr R1, =sieve
    ldr R1, [R1]
    ldr R2, =primes
    ldr R2, [R2]
    str R4, [R1], #4    @intialize first and second elements in sieve to 0
    str R4, [R1]
    mov R4, #1  @used for storing 1
setToOne:
    str R4, [R1], #4
    add R0, R0, #1
    cmp R0, #MAX
    blt setToOne
    ldmfd sp!, {R0-R4,pc}   @For somereason Initialize repeats as if lr points back to its begining (instead of where it's called from)

Ok I can’t post the entire program because it says “Your post does not have much context to explain the code sections; please explain your scenario more clearly.”

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T09:24:14+00:00Added an answer on June 2, 2026 at 9:24 am

    You are overwriting R5 without saving it first. I can´t see why it should make the function call itself, but it will probably give some kind of strange results.

    As a side note, if you are calling this function from C, R0-R3 do not need to be saved since they are scratch registers. If you are calling it from assembly, you can of course create your own calling convention which might make it necessary to save them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am stuck in this code: reload: function() { var self = this; $.when(self.unload()).then(function()
I'm currently stuck on this problem. I've hooked into the method_missing function in a
I'm stuck with this. I'm self studying assenbler and translating some basics instructions. But
Take this function getting time as a double using clock_gettime: // return current time
Im assembling a form validation script and Im pretty stuck on this: $(*).live('click', function(){
My code got stuck on this function call: feedparser.parse(http://...) This worked before. The url
I hope to find help here, I am stuck. I use this function to
Please help me understand this recursive function... var stack = Array; function power(base, exponent){
Symbian has a stack limit of 8kB. Does this also apply to the function
I've come a bit stuck this afternoon with a bug in my web application

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.