• Advertisement
Sign in to follow this  

Two asm questions

This topic is 4429 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

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
Advertisement
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
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
Sign in to follow this  

  • Advertisement