From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28808 invoked by alias); 15 Aug 2003 13:44:18 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 28573 invoked from network); 15 Aug 2003 13:44:13 -0000 Received: from unknown (HELO artax.karlin.mff.cuni.cz) (195.113.31.125) by sources.redhat.com with SMTP; 15 Aug 2003 13:44:13 -0000 Received: by artax.karlin.mff.cuni.cz (Postfix, from userid 17421) id 30E1B3FA4; Fri, 15 Aug 2003 15:44:13 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by artax.karlin.mff.cuni.cz (Postfix) with ESMTP id 2EF1E2FBD9; Fri, 15 Aug 2003 15:44:13 +0200 (CEST) Date: Fri, 15 Aug 2003 13:44:00 -0000 From: Mikulas Patocka To: binutils@sources.redhat.com, Subject: 16-bit code in GAS Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2003-08/txt/msg00255.txt.bz2 Hi When I upgraded gas to 2.14, i found that it can't generate 32-bit addresses in 16-bit mode (.code16) directive. $ as .code16 movl $0x12345678, 0xabcdef01 {standard input}: Assembler messages: {standard input}:2: Warning: -1412567295 shortened to 61185 $ objdump --disassemble a.out: file format elf32-i386 Disassembly of section .text: 00000000 <.text>: 0: 66 c7 06 01 ef movw $0xef01,(%esi) 5: 78 56 js 0x5d 7: 34 12 xor $0x12,%al A The resulting instruction should have prefixes 66 and 67 and should have 32-bit address. Info page says, the the function of instructions in 16-bit mode is exacltly the same as in 32-bit mode, but it's not true. Older versions of gas generated both address and instruction prefixes and generated 32-bit address. How can I write 32-bit code that runs in a segment with default operand size 16 (without 'D' bit set)? Mikulas