Questions tagged [gnu-assembler]

The GNU Assembler (GAS). Use for GAS macros, machine dependent syntax, linkage and file format issues. Do use for generic assembler questions about how the machine works; the CPU tags are meant for this.

'gas' or the GNU assembler is used by GCC to process assembler files. It is included in the binutils suite of tools.

Relevant topics include gas macros, machine dependent GAS syntax, linkage and output formats (usually ELF sections). There isn't any need to tag generic assembler question just because 'gas' is being used. Use the CPU tag such as , , , etc. instead.

(For x86, is the syntax used by default by GAS, GCC, and other GNU tools. Its operands are in reverse order from Intel's documentation.)

A manual is hosted online at sourceware.org as well as a possible locally installed version matching the GAS in use.


This tag was formerly called [gas], renamed because lots of Google Apps Script questions were getting mistagged as gas.

1024 questions
-3
votes
1 answer

Why does this give me a segfault

I'm trying to write a hello world program but it doesn't work - why? .data str: .ascii "Hello World\12\0" .text .globl main .extern printf main: pushq %rbp movq %rsp,%rbp movq str,%rdi callq…
nyyyap
  • 11
  • 4
-3
votes
1 answer

What is the purpose of a TEST instruction that has the same register for both operands?

testl %esi, %esi jle .L7 I mean I understand that test actually ANDs the operands, but what is it doing in this case here?
-4
votes
1 answer

How to declare local variables in macro asm of gas like decalaring it in macro asm with %local in macro asm of nasm or local in macro asm of masm?

the way to declare local variables in macro asm of nasm is like:%local old_ax:word,and the way to declare local variables in macro asm of masm is like:local old_ax:WORD,so what's the way to declare local variables in macro asm of gas?
linkerrors
  • 39
  • 6
-4
votes
1 answer

Procedures from C in assembly

I have to write a short program in Assembly but my version not works. It should print ASCII char, next change it to the integer value by atoi function and print out this value. Important is using for that, procedures from C: puts() and atoi().…
1 2 3
68
69