Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

push/pop in x86_64

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming
View previous topic :: View next topic  
Author Message
JanPihlgren



Joined: Wed Mar 05, 2008 5:09 am
Posts: 5
Location: Marsta, Sweden

PostPosted: Tue Apr 10, 2012 6:51 am    Post subject: push/pop in x86_64 Reply with quote

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.
Back to top
View user's profile Send private message
Xelous



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

PostPosted: Tue Apr 24, 2012 4:41 pm    Post subject: Reply with quote

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.

http://www.swansontec.com/sregisters.html

Hope that helps


Xel
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast