I have a short snippet of code, with some inline assembly that prints argv[0] properly in O0, but does not print anything in O2 (when using Clang. GCC, on the other hand, prints the string stored in envp[0] when printing argv[0]). This problem is also restricted to only argv (the other two function parameters can be used as expected with
Tag: inline-assembly
Calling Assembly code from C++
I’m trying to write my own I/O library, so the first step is just being able to output a character. So far, this only needs to work on Linux. I wrote what I believe to be a solid _putc: label in x86 (with Intel syntax), and I put it in “io.h”, then called it from my main file, “test.cpp”. Here’s
Vector Sum using AVX Inline Assembly on XeonPhi
I am new to use XeonPhi Intel co-processor. I want to write code for a simple Vector sum using AVX 512 bit instructions. I use k1om-mpss-linux-gcc as a compiler and want to write inline assembly. Here it is my code: However when I run the program, I’ve got segmentation fault from the asm part. Can somebody help me with that???
What does the GCC error message, “Error: unsupported for `mov'”, mean?
I am just trying to compile some simple example code I typed in from a book, and GCC gives me the above error. Here’s my code: The code is supposed to invoke the syslog() system call to read the last 128 bytes from the kernel printk() ring buffer. Here is some information about my OS and system configuration: uname -a: