• 14
• 12
• 9
• 10
• 9

# ASM

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

## Recommended Posts

I was wondering if I could use ASM directly with C++. I've seen something like
__asm{
;Blah
}

but I never had any idea what it meant... The commands inside looked like assembly.. So does that mean I could use assembly directly with C++? If so, what headers do I need? Is it compiler specific? Maybe you can show me a littly C++ sample with asm inside. And if its possible, will c++ variables declared outside __asm{} be usable inside? All this baffles me... Thanks in advance. ~dudedbz1~

##### Share on other sites
Yes, you can use assembler directly within C++. It's called "inline assembler".

You shouldn't need to include any special headers. Different compilers implement inline assembler differently. They expect a different syntax and handle local variables differently too.

This might help: Inline Assembler: Microsoft Specific.