gcc « assembly « C Q&A

Home
C Q&A
1.assembly
2.buffer
3.Card
4.Cast
5.compile
6.console
7.const
8.constructor
9.database
10.Date
11.Debug
12.Design
13.Development
14.DLL
15.encrypt
16.enum
17.eof
18.Event
19.fork
20.Format
21.gcc
22.gdb
23.graph
24.graphics
25.gui
26.Holiday Event
27.image
28.IP
29.iterator
30.macro
31.makefile
32.malloc
33.Menu
34.mysql
35.network
36.openssl
37.operator
38.password
39.pipe
40.preprocessor
41.printf
42.pthread
43.Regular expression
44.scanf
45.semaphore
46.SerialPort
47.server
48.Socket
49.sql
50.SQLserver
51.sscanf
52.std
53.stdin
54.stdout
55.stl
56.strcmp
57.stream
58.switch
59.Template
60.thread
61.timer
62.unix
63.video
64.Virtual
65.visualstudio
66.winapi
67.windows
68.xml
C Q&A » assembly » gcc 

1. Is GCC broken when taking the address of an argument on ARM7TDMI?    stackoverflow.com

My C code snippet takes the address of an argument and stores it in a volatile memory location (preprocessed code):

void foo(unsigned int x) {
    *(volatile unsigned int*)(0x4000000 + ...

2. How do I know if gcc agrees that something is volatile?    stackoverflow.com

Consider the following:

volatile uint32_t i;
How do I know if gcc did or did not treat i as volatile? It would be declared as such because no nearby code is going to ...

3. Trouble understanding gcc's assembly output    stackoverflow.com

While writing some C code, I decided to compile it to assembly and read it--I just sort of, do this from time to time--sort of an exercise to keep me thinking ...

4. How to fetch the end address of my code    stackoverflow.com

I'm writing a real-time operation system from scratch for a course project. I want to know the end address of my code after I download it to the chip, because I ...

5. Using GCC to produce readable assembly?    stackoverflow.com

I was wondering how to use GCC on my C source file to dump a mnemonic version of the machine code so I could see what my code was ...

6. GCC generated assembly equivalent to continue statement in C    stackoverflow.com

When a continue statement is used inside a loop in C code, GCC creates a new label with a nop instruction right before the end of the loop block and jumps ...

7. Decoding equivalent assembly code of C code    stackoverflow.com

Wanting to see the output of the compiler (in assembly) for some C code, I wrote a simple program in C and generated its assembly file using gcc. The code is this: ...

8. DPPS on older version GCC    stackoverflow.com

Hei! I need to optimize some matrix multiplication code in c, and I'm doing it using SSE vector instructions. I also found that there exists SSE4.1 that already has instruction for dot-product, ...

9. GCC hotpatching?    stackoverflow.com

When I compile this piece of code

unsigned char A[] = {1, 2, 3, 4};

unsigned int
f (unsigned int x)
{
  return A[x];
}
gcc outputs
mov edi, edi
movzx  eax, BYTE PTR A[rdi]
ret
on a x86_64 ...

10. Differences in dis-assembled C code of GCC and Borland?    stackoverflow.com

Recently I have gotten interested into dis-assembling C code (very simple C code) and followed a tutorial that used Borland C++ Compiler v 5.5 (compiles C code just fine) and everything ...

11. Why does LLVM add two extra instructions for the same program?    stackoverflow.com

I am compiling this C program and comparing the generated assembly code:

int main(){ return 0; }
GCC gives this main function (cc hello.c -S):
_main:
LFB2:
    pushq   ...

12. Integrating Intel's icc with gcc    stackoverflow.com

okey i am stuck at a problem. Been using gcc to compiler/assemble my C codes for a while and got used to using Intel assembly syntax. used the "-masm=intel" flag when ...

13. GCC adds weird temporal variables    stackoverflow.com

I have created this code:

#include <stdio.h>

typedef unsigned int uint;
uint in[2]={1,2},out[2]={3,4};

int main() {

    in[0]=out[0]/10;
}
and compiled it with GCC (v4.4.5,no optimizations) on Linux, the resulting assembly is:
0000000000400474 <main>:
400474:   ...

14. disassembling simple code in C on LLVM GCC 4.2    stackoverflow.com

when I disassembled following simple program in C:

int main ()
{
 int a = 'a';
return 0;
}
I got this:
Dump of assembler code for function main:
0x0000000100000f20 <main+0>:    push   rbp
0x0000000100000f21 ...

15. SIGSEGV in optimized version of code    stackoverflow.com

My knowledge of the intel instruction set is a bit rusty. Can you tell me why I might be getting a segmentation fault in the optimized version of my function ...

16. GCC option to get assembly code AND C code    cboard.cprogramming.com

17. Understading assembly code created by gcc    cboard.cprogramming.com

I'm supposed to get the assembly code from some C file with -S switch and then perform some tasks with that code, saying where is the start and end of a function including comments on the asm file, identify the records or memory cells where the variables where saved, presente the structure and content of the stack an some other things... ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.