From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24105 invoked by alias); 9 Nov 2007 16:40:40 -0000 Received: (qmail 24096 invoked by uid 22791); 9 Nov 2007 16:40:39 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 09 Nov 2007 16:40:37 +0000 Received: from zps18.corp.google.com (zps18.corp.google.com [172.25.146.18]) by smtp-out.google.com with ESMTP id lA9GeLgK027346; Fri, 9 Nov 2007 16:40:22 GMT Received: from smtp.corp.google.com (spacemonkey2.corp.google.com [192.168.120.114]) by zps18.corp.google.com with ESMTP id lA9GeKja010545 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 9 Nov 2007 08:40:21 -0800 Received: from localhost.localdomain.google.com ([192.168.17.211]) (authenticated bits=0) by smtp.corp.google.com (8.13.8/8.13.8) with ESMTP id lA9GeKTB019413 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 9 Nov 2007 08:40:20 -0800 To: Brian Beardall Cc: binutils@sourceware.org Subject: Re: labels, and values for mov instructions is gas References: <1194625564.29036.4.camel@rapsure.rapsure.net> From: Ian Lance Taylor Date: Fri, 09 Nov 2007 16:40:00 -0000 In-Reply-To: <1194625564.29036.4.camel@rapsure.rapsure.net> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2007-11/txt/msg00095.txt.bz2 Brian Beardall writes: > .arch i8086 > .code16 > > .text > foo: > mov $exit,%ax > mov $10,%cx > loop foo > exit: > int $0x80 > dumb: > .int 5,5,3,2,1,2,4,2,3,4,3,2,1,5 > again: > .word 1,2,3,4,5,6,7 > .equ help, 5 > > > With this code I need the address that is at the label exit moved into > the ax register. Right now all I get is 0x0000 moving into the ax > register. How might I go about getting the correct address into ax > without doing a as -a -o test.o test.asm , and looking at the symbol > table, and manually entering the value? You need to run the linker on the output of the assembler. Ian