GCC Inline Assembly Tutorial – x86 codeblocks

Inline assembly in C.


5tarda says:

Can you explain me how to know that exactly at 8(%ebp) and 12(%ebp) are inputs val_1, val_2? I just don’t get this part.
Thank you.

DarkSpirit says:

Make a Video about Interrupt using inline assembly

Joaquim Jesus says:

i understand that these video is for Inline Assembly, but do you have a video for add a *.asm file on project?

Muck2014 says:

Must you install an assembler beside the compiler for this?

Mike Dev says:

Why do my compiler say that the sum function is not defined?

Joaquim Jesus says:

i’m trying testing your code without sucess 🙁


using namespace std;

int sum(int parameter1, int parameter2);

int main()
cout << sum(100,200); return 0; } asm( "_sum: ;" " pushl %ebp;" " movl %esp, %ebp;" " movl 8(%ebp), %eax;" " addl 12(%ebp), %eax;" " movl %ebp, %esp;" " popl %ebp;" " ret" ); i get 2 errors: "invalid instruction suffix for `push'" and the same for 'pop'. can you advice me more?

Jean Kyle says:

Does the use of inline assembly need some other installation other than code blocks?

 Write a comment


Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!