Hi all!
Please, help to understand how could I pass string from C program into GNU Assembler one and operate it in GNU Assembler. Where could I read about it detailed explanation?
Thank you.
Hi all!
Please, help to understand how could I pass string from C program into GNU Assembler one and operate it in GNU Assembler. Where could I read about it detailed explanation?
Thank you.
The assembler is going to read input from a file, or from stdin.
So either
- write your string to a temporary file, then invoke the assembler with your temp file as a command line parameter.
- connect to the assembler using popen(), such that the assembler will read from stdin, then write your program string to the opened pipe.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Sorry, I'm afraid that I gave weak explanation. What if my assembler program asm.s and c program my.c compiled as a solid output using command gcc -shared -fpic -o lib.so my.c asm.s?
What about it?
You should be able to string together .c, .s, .o and .a files on the command line to gcc, and it will pass the relevant files onto the appropriate compilation step.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.