Answer by Weigel Gram for executing assembly code in c
void function(void){ void *sp __asm__ volatile("movl $0x2d, %%eax;""movl $0, %%ebx;""int $0x80" :"=a"(sp) : :"%ebx" ); fprintf(stderr, "system break: %p\n",sp); }This is my answer :)
View ArticleAnswer by Frank Kotler for executing assembly code in c
You really need to "put" asm source in Nasm syntax "in" your C source program? Fergedit. lcc maybe... If you want to "execute" your asm program from your C program... global getbrk section .text...
View ArticleAnswer by Aki Suihkonen for executing assembly code in c
Another method if e.g. using gcc, is to first compile some very trivial function without optimizations:int foo(int a, int b) { return a+(b<<3);}with gcc -S foo.cand use the foo.s as template. One...
View ArticleAnswer by user529758 for executing assembly code in c
Some compilers implement the __asm__ or asm keywords as an extension to the C language:__asm__("mov eax, 0x2d\n""mov ebx, 0\n""int 0x80\n");The code in parentheses will be copied verbatim to the input...
View ArticleAnswer by user4815162342 for executing assembly code in c
The ability to do this is compiler-specific. Gcc allows this using its asm keyword extension, while Visual studio implements a different extension.Note that, beside the obvious problem with...
View Articleexecuting assembly code in c
I want to know if there is a way of calling in a .c assembly code?I want to put this code in my .c fileThe assembly code i want to execute in .c file to return the address1. mov eax, 0x2d2. mov ebx,...
View Article
More Pages to Explore .....