gas

What's the output object file format of GNU assembler as?

I have checked the assembler options of GNU assembler as and I didn't find an option to specify the output object file format. If I am using the following command as -o foobar.o foobar.s What object file format will I get? The as manual says that "The GNU as can be configured to produce several alternative object file formats." But h...

*-Operator in gas

Hi, can anyone explain what the * in the gnu assembler does? Example: jmp *0x804a004 This is an entry in a procedure linkage table (plt), maybe someone can clarify what this instruction does and what the * stands for. ...

Interrupt On GAS

I'm trying to convert my simple program from Intel syntax to the AT&T(to compile it with GAS). I've successfully converted a big part of my application, but I'm still getting an error with the int(the interrupts). My function is like this: printf: mov $0x0e, %ah mov $0x07, %bl nextchar: lodsb or %al, %al ...

i386 assembly question: why do I need to meddle with the stack pointer?

Hello everyone, I decided it would be fun to learn x86 assembly during the summer break. So I started with a very simple hello world program, borrowing on free examples gcc -S could give me. I ended up with this: HELLO: .ascii "Hello, world!\12\0" .text .globl _main _main: pushl %ebp # 1. puts the base stack addre...

Dynamically create labels in gas macros?

Hi everyone, I would like to dynamically create a set of labels in an assembly function using a gas macro. I would like to do something like this: .macro set_up_jumptab_entry prefix, from=0, to=10 .quad \prefix_\item .if \to-\from set_up_jumptab_entry \prefix,"(\from+1)",\to .endif .endm set_up_jumptab_entry my...

Macros Using GAS

I'm building a program for ARM Linux using GAS, but I want to do some macros to make my development some more smart. Then I want to know: How could I do a macro for this: (x+y*240)*2, were x and y are int, that will be used like this: mov r0, MACRO_SHOULD_BE_CALLED_HERE And how could I do a macro that should be called like this: JUS...

Documentation about inline gas

Hi When reading the linux 0.01 kernel I pass throw some inline gas which is hard for me to decode: __asm__("movl $0x3ff000,%%eax\n\t" "movl %%eax,%%db0\n\t" "movl $0x000d0303,%%eax\n\t" "movl %%eax,%%db7" :::"ax") or __asm__("push %%fs;mov %%ax,%%fs;movl %%fs:%2,%%eax;pop %%fs" \ ...

Can GAS (GNU Assembler) compile to iPhone/iTouch?

Hello. I am programming some applications for the iDevice market using the unofficial Open SDK, but am having difficulty installing the open toolchain on Windows, rather than Linux (I would use Linux, but I cannot on my work computer), so I am programming it in GNU Assembler (GAS). Is it possible for GAS to target an iDevice as a format...

linking a gas assembly file as a c program without using gcc

Hey, as an exercise to learn more precisely how c programs work and what minimum level of content must exist for a program to be able to use libc, ive taken it upon myself to attempt to program primarily in x86 assembly using gas and ld. As a fun little challenge, I've successfully assembled and linked several programs linked to differen...

GNU assembler for MIPS: how to emit sync_* instructions?

MIPS32 ISA defines the following format for the sync instruction: SYNC (stype = 0 implied) SYNC stype here, stype may be SYNC_WMB (SYNC 4), SYNC_MB (SYNC 16), etc. In inline assembler, I may use default sync: __asm__ volatile ("sync" ::);. But, if I write something like __asm__ volatile ("sync 0x10" ::), it doesn't compile: Error: ...

32-bit Linux Assembly - Linking files together (gas and ld)

I wrote a function called strlen: .section .text .global strlen .type strlen, @function strlen: ... code ... I assembled this like so: as --32 strlen.asm -o strlen.o Then I wrote a program in asm to print argv which I want to link with this. I assembled that the same way. Now I want to link them together so that the actual program ...