Sign in to follow this  
Unfadable

Two asm questions

Recommended Posts

Unfadable    140
1) Can anyone tell me what the instruction npad 6 does? I see it in my generated asm output. I have a feeling it just does nothing for 6 clock cycles? 2)
int jj = ceil(RightX);
int hh = ceil(RightX);
int rr = ceil(RightX);
int aa = ceil(RightX);
This block of code actually generates the assembly code to call ceil 4 times in my asm output (/Fa), even though I don't use those variables anywhere. I was under the impression that compilation removed unused variables. I tried this under "Maximum Speed" and "Minimum Size" settings. Is there another option to remove this? Maybe I'm missing something?

Share this post


Link to post
Share on other sites
LessBread    1415
NPAD is not an intel instruction. My guess is that it's a Microsoft assembler macro that directs the assembler to insert a specified number of nop instructions where indicated.

Your second question is compiler specific and you haven't mentioned what compiler you're using.

Share this post


Link to post
Share on other sites
darookie    1441
Quote:
Original post by LessBread
Your second question is compiler specific and you haven't mentioned what compiler you're using.

The "/Fa" switch lets me quess he's using the Microsoft compiler that ships with VC++ [smile]

NPAD stands for Non-Program Associated Data and is used for padding code segments. Itäs nothing to worry about as it will expand to data (as the name implies) and not instructions.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this