News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Basic register usage

Started by Lonewolff, March 16, 2016, 09:09:01 AM

Previous topic - Next topic

Lonewolff

Hi Guys,

Is there a list of what registers are available and what their general usage is?

I have worked out that EAX generally holds the return value of an 'invoke' call and EBX and EDX seem to work for general purpose use.

But I have found that if I attempt to use ECX for general use I get crashy behaviour going on.

Any advice is greatly appreciated :)

Siekmanski

Download: http://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html

Preserve ecx,

Push ecx

use ecx and do your stuff here.

pop ecx
Creative coders use backward thinking techniques as a strategy.

Lonewolff


jj2007

My tips page has a section on register usage. See in particular also the .if eax<0 part ;-)

Lonewolff

Good read JJ. I'm learning a massive amount today.

(so much so, that I even started a little gamepad API and got my XBox 360 controller detected in MASM - I'll finish that one off tomorrow  8))