From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 463343858284 for ; Tue, 30 Aug 2022 08:39:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 463343858284 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661848792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Oap7XQLB4emlNLrAQZSJM9Rkd88RUKu5wj+Px6QpuXs=; b=J83Dc5kcc6Eo4NT2IG/i57qIuPfHtLU44jePfep0U3ilsOb8Rj8izcUQHcvdQ6+idkBOvJ +W1dXXvoCY9JGWMhiu7m22QVYrgg6P8eMJ4o2jLCfl+B6/mOyWzigx82+74FD6S9sjNgRQ tzFvH5e3PR+iK4mfOpZsVOBFrvz/NFA= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-212-f8nftSmLMsiS_KnqrTMzWQ-1; Tue, 30 Aug 2022 04:39:27 -0400 X-MC-Unique: f8nftSmLMsiS_KnqrTMzWQ-1 Received: by mail-wm1-f72.google.com with SMTP id 203-20020a1c02d4000000b003a5f5bce876so9749544wmc.2 for ; Tue, 30 Aug 2022 01:39:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc; bh=Oap7XQLB4emlNLrAQZSJM9Rkd88RUKu5wj+Px6QpuXs=; b=hgb6DSRBCZjsuU/R6Qpuwq5GYn+WFUsw3nb908wBJs3tqDemrHx4YsxMB/xnlBB16n fY0eXGXynolouhzmTg07cLHI2VZjmS3rEJNmR+cF+z3+UPwpVuiVExxBsZp2lGgTpyzQ 0wlhRHtYlKWe7XPx55ldnfhZiqkkdr9fxzOIxlDmMw7Paqj1eDAt7Ak0BFe9IdrMrmHS LGMwZT2GDIvnzt3cK9ixRHW/+GhFlQ4wyz7w3rZw5GFtifwRR/0hPF5kg3Rkx4ysilJk 7PwmUq/qAv8IxsH1es3F/pQRMMqRPrZGY8gMFS7B95OyT2aY1uQPuId/Hk/t36NM9O6N Rvvg== X-Gm-Message-State: ACgBeo2Y64nJiFYz2M8eaZrIORkk23oKLQ3G0e2go0LwPR3nCl6PcPEb fI92n5Ju7cSAXqImE8MBAdhq7jN2VWSfZNapujcdIG9Oa6/B1eZLhGnlYyVeusa3PXLvQOue0du 3pN5MfeAuaEax/Ubz6g== X-Received: by 2002:a05:6000:100c:b0:226:dbfe:a881 with SMTP id a12-20020a056000100c00b00226dbfea881mr4070485wrx.266.1661848766228; Tue, 30 Aug 2022 01:39:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR5V6SFJaJ9hqpGKFm0svivbERQkKqYNimqpYOZDwmy7MFl5aPqnp1ON55kPeiMNZ3GNmNvBaQ== X-Received: by 2002:a05:6000:100c:b0:226:dbfe:a881 with SMTP id a12-20020a056000100c00b00226dbfea881mr4070470wrx.266.1661848766029; Tue, 30 Aug 2022 01:39:26 -0700 (PDT) Received: from localhost ([31.111.84.229]) by smtp.gmail.com with ESMTPSA id v18-20020a1cf712000000b003a5c7a942edsm11135648wmh.28.2022.08.30.01.39.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Aug 2022 01:39:25 -0700 (PDT) From: Andrew Burgess To: "H.J. Lu" Cc: Binutils Subject: Re: [PATCH] opcodes/i386: use '; ' as comment character for intel style disassembly In-Reply-To: References: <20220827151845.1583899-1-aburgess@redhat.com> Date: Tue, 30 Aug 2022 09:39:24 +0100 Message-ID: <87zgfmcegz.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: "H.J. Lu" writes: > On Sat, Aug 27, 2022 at 8:19 AM Andrew Burgess via Binutils > wrote: >> >> While working on a disassembly related GDB issue I was comparing the >> disassembly output for x86-64 in att mode and intel mode. >> >> I ended up trying to cut & paste some disassembly snippets from the >> disassembler, and feed the instructions back through the assembler. >> >> For the att style disassembly this worked fine, but for the intel >> style disassembly I ran into a problem as the '#' character, which is >> used for comments in i386-dis.c was not recognised by either of the >> intel style assemblers I have to handle (nasm and yasm). >> >> Searching online, every example I could find that has intel style >> assembly syntax, used ';' for the comment character, and indeed, when >> I switch '#' to ';', my same code assembled fine. > > But, ';' marks the end of instructions for GNU assembler: > > [hjl@gnu-efi-2 tmp]$ cat x.s > .intel_syntax noprefix > mov eax, edx; mov eax, edx; > [hjl@gnu-efi-2 tmp]$ gcc -c x.s > [hjl@gnu-efi-2 tmp]$ objdump -dw -Mintel x.o > > x.o: file format elf64-x86-64 > > > Disassembly of section .text: > > 0000000000000000 <.text>: > 0: 89 d0 mov eax,edx > 2: 89 d0 mov eax,edx > [hjl@gnu-efi-2 tmp]$ Thank you for pointing this out, I was not aware of this feature. I guess this patch is withdrawn then. Thanks, Andrew > >> In i386-dis.c we already have a bunch of characters that are >> customised based on the selected syntax, see open_char, close_char, >> separator_char, and scale_char. >> >> I propose to add comment_char to this list. This will be '#' for att >> syntax, and ';' for intel syntax. >> >> I've updated the gas tests to account for this change. > > > -- > H.J.