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

  • SEARCH
  • Home
  • 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 6368271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:39:15+00:00 2026-05-25T00:39:15+00:00

I am learning High Level Assembly language at the moment and have been going

  • 0

I am learning High Level Assembly language at the moment and have been going over the concept of the stack. I think I understand it fairly well, however in practice I have some questions.

The stack grows down, with the ESP register always pointing to the top of the stack..an address in low memory. If something is pushed onto the stack, then ESP should be decremented.

EBP is useds as a frame pointer and as to my understanding, should always be more than ESP.

Yet, with the following program:

stdout.put(esp, nl);
stdout.put(ebp, nl);
push(ike);
stdout.put(esp, nl);
stdout.put(ebp, nl);
push(ike);
stdout.put(esp, nl);
stdout.put(ebp, nl);
pop(eax);
pop(eax);
pop(eax);
pop(eax);
stdout.put(esp, nl);
stdout.put(ebp, nl);

This does not seem to be the case. Looking at the output:

0018FF6C
0018FF70

0018FF68
0018FF70

0018FF64
0018FF70

0018FF74
0018FF70

EBP is always the same, ESP is decremented by 4 bytes for the first push, then another 4 bytes for the second push.

It is after this I am confused. After my first 2 pops, ESP should be back to where it started. How can I then do a further two pops if I have not pushed anything on to the stack? What am I popping?

Further popping and printing out of EAX shows some numbers, and then 0’s and then further numbers. So, I am definitely popping something…but what? What part of my program memory does it belong to, and why is nothing being affected?

Why is EBP not being affected at all?

Also, why is ESP being decremented by 4 bytes, and not by 8?

If someone could help me to understand this, I would be most grateful.

  • 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-25T00:39:16+00:00Added an answer on May 25, 2026 at 12:39 am

    EBP doesn’t get modified by push/pop instructions, it’s setup manually, so unless you change it yourself it will just stay the same.

    The pushes of IKE are resulting in 4-byte changes, so apparently you’re in 32-bit mode here.

    The 4 pops of EAX (32-bit) will result in a 16-byte (10h) change, just like they do.

    Not sure what the problem is here. Seems to be working as I expect?

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

Sidebar

Related Questions

I've been learning python here recently....mainly for scripting purposes....since apparently it's supposed to be
I've been learning Android and Phonegap development from mainly these two sources: http://news.softpedia.com/news/How-to-Run-Android-Applications-on-Ubuntu-115152.shtml http://wiki.phonegap.com/w/page/30862722/phonegap-android-eclipse-quickstart
Currently I am in the midst of learning x86 assembly for fun, I'm love
So C obviously has a pretty dominant low level programming stronghold.....but is anything coming
While I consider myself a reasonably competent programmer, I have no experience with even
I've been writing code for a few years now and our backup strategy has
I am learning computer arithmetic. The book I use(Patterson and Hennessey) lists the below
I am a pretty experienced Ruby, Objective C, and Java programmer and I was
The idea is to utilize AOP for designing applications/tools to debug/view execution flow of
I'll be embarking on converting one of our old, legacy apps from VB6 to

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.