push/pop in x86_64

Code junkies hangout here

Moderators: ChrisThornett, LXF moderators

push/pop in x86_64

Postby JanPihlgren » Tue Apr 10, 2012 5:51 am

I'm trying to follow "Assembly language" in LXF and in issue 155 I get in problem.
I wish to use 64-bit version of Mageia 1 to do my programming lessons.
When I try to use push and pop (push ecx and pop ecx) i discover that these commands are invalid in x86_64.
It would be helpfull if the author will give som hints about this things that does not works in a 65bit system.
I'm not the one that could find out how to solve this problem.
Thanksful for help.
Posts: 5
Joined: Wed Mar 05, 2008 5:09 am
Location: Marsta, Sweden

Postby Xelous » Tue Apr 24, 2012 3:41 pm

I'm not an expert in assembly, so forgive me if I am wrong here but... You can't (usually) push or pop into the ECX register, its the counting register, used for LOOP and other counting actions.

So, the assembler is correct to push or pop that register is invalid, you can however mov the value out of ECX into another register and inspect it.

Check this for an interesting coverage of use of most registers.


Hope that helps

Posts: 16
Joined: Thu Apr 19, 2012 2:46 pm

Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests