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 5986985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:45:00+00:00 2026-05-22T22:45:00+00:00

im trying to implement the recursive Ackermann-Peter-Function in x86 NASM-Assembly. The Function is defined

  • 0

im trying to implement the recursive Ackermann-Peter-Function in x86 NASM-Assembly. The Function is defined as follows:

*a(0;m) = m + 1

*a(n + 1; 0) = a(n; 1)

*a(n + 1;m + 1)) = a(n; a(n + 1;m))

My Problem is i can’t even imagine how to start properly. By now i only implemented an “power of x” Function recursively in Assembly.

Here is what i have so far:
http://pastebin.com/rsWALyCq (The german prompts just ask for n and m)

Im thankfull for every bit of help i can get with this one.

—

SO i made the push/pop Statements Symetric now, but still get an Segmentation fault. I tried to debug the whole thing and placed a Debug-Message inside the firstcase. I compiled the Program and tried it with n=0 and m=0 and hes not printing the Debug-Message, so he isnt even entering the firstcase. I can’t seem to manage to find out why hes not doing it.

Heres my current try:
http://pastebin.com/D4jg7JGV

  • 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-05-22T22:45:01+00:00Added an answer on May 22, 2026 at 10:45 pm

    SOLUTION:

    Ok I found the problem:

    I didn’t manage the ebp and esp right. So, I now used the ENTER and LEAVE Macros in every function call and now the whole thing works properly.
    Here is the Solution. Thank you for your time:

    asm_main:
        ENTER 0,0               ;setup Routine
        PUSHA
        MOV eax, prompt1        ;ask for n
    

    Full Code:
    http://pastebin.com/ZpPucpcs

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

Sidebar

Related Questions

Hi I am trying to write a recursive function which calculates the length of
Hi I am trying to implement Selection Sort in vb.net using recursion. Problem is
My question is related to this other discussion . I'm trying to implement that
I've tried to make an iterative/tail-recursive version of a function to compute the n
I'm trying to implement a program that changes a prefix expression to a postfix
I'm currently trying to implement an AVL tree in C++, so far I've done
I am trying to work out a multiple if-else loop for my code. My
In Java, I'm trying to retrieve a HashMap<String, Object> that has the Object which
Have a look at the following code: class A(object): defaults = {'a': 1} def
I'm having trouble with functions that are n-ary, for example, =, <, etc. I'm

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.