From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32538 invoked by alias); 9 Jul 2005 21:23:11 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 32521 invoked by uid 22791); 9 Jul 2005 21:23:09 -0000 Received: from fmmailgate07.web.de (HELO fmmailgate07.web.de) (217.72.192.248) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sat, 09 Jul 2005 21:23:09 +0000 Received: by fmmailgate07.web.de (8.12.10/8.12.10/webde Linux 0.7) with SMTP id j69LLPcf030962 for ; Sat, 9 Jul 2005 23:23:06 +0200 Received: from [84.153.218.46] by freemailng5601.web.de with HTTP; Sat, 09 Jul 2005 23:23:05 +0200 Date: Sat, 09 Jul 2005 21:23:00 -0000 Message-Id: <285526835@web.de> MIME-Version: 1.0 From: Florian Michel To: gcc-help@gcc.gnu.org Subject: AMD 64 Problem with assembling Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2005-07/txt/msg00104.txt.bz2 Hello, I have a question concerning successfully assembling and linking the following assembly program on a linux AMD 64 machine: #cpuid2.s View the CPUID Vendor ID string using C library calls .section .datatext output: .asciz "The processor Vendor ID is '%s'\n" .section .bss .lcomm buffer, 12 .section .text .globl main main: movl $0, %eax cpuid movl $buffer, %edi movl %ebx, (%edi) movl %edx, 4(%edi) movl %ecx, 8(%edi) push $buffer push $output call printf addl $8, %esp push $0 call exit This part of a book on assembly programming I am reading. Compile and Link: gcc -o cpuid2 cpuid2.s When running cpuid2 it crashes with a segmentation fault. Which switches do I have to add to call gcc? Thanks a lot! Greetings, Florian