Jump to content
  • Advertisement
Sign in to follow this  
h3ro

Question about assembly registers

This topic is 3794 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have been looking at assembly lately, but there are a few things that I find confusing. Every source I looked at says that there is 8 general purpose registers, but that they also have highly specific jobs as well. Where can I find out about the different things they do? Is it safe to use all 8 for everything? Is it ok to use say xmm registers for storing 'normal' data if you have run out of normal registers, or is that a bad thing? If you are working in on a loop and you variables that you need then you have registers, how do you decide which one to push into the stack? The last question is not about registers, but about the SSE command punpcklwd. I am not sure I understand in which order it does thing. If I have 2 xmm registers with two differnt shorts in them, how do I add them after each other in a new xmm register? Thank you very much for you time, Ole

Share this post


Link to post
Share on other sites
Advertisement
If you are learning assembly, I would suggest looking at The Art of Assembly. I haven't read all of it, but the parts that I did read were very well written. This part should address your second problem.

As for your first question, here is a wikipedia entry. Basically the registers can be used for anything, but they all have special uses in which they make much more sense to use. For example, you probably aren't going to be using eip to add numbers together.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!