GAS syntax parsing error
Reported by Pierre Muller | July 5th, 2011 @ 01:55 PM
I am part of core team of Free Pascal compiler.
We do support several assemblers (nams, tasm, GNU as) and I tried to add yasm support using the GNU parser.
Doing so, I found out one parsing bug with
e:\pas\trunk\fpcsrc\compiler\debug>yasm --version
yasm 1.1.0.2352
Compiled on Aug 7 2010.
Copyright (c) 2001-2010 Peter Johnson and other Yasm
developers.
Run yasm --license for licensing overview and summary.
movzwl 0x30(%eax),%eax is wrongly computed as
1e: 0f b6 40 30 movzbl 0x30(%eax),%eax instead of:
1e: 0f b7 40 30 movzwl 0x30(%eax),%eax (correct assembling by GNU
as).
Pierre Muller
Comments and changes to this ticket
-

Pierre Muller July 5th, 2011 @ 02:39 PM
This simple code show the problem:
File test.c .section .text.1 .globl main main:
movzbl 0x30(%eax),%eax movzwl 0x30(%eax),%eaxEnd of file test.c
e:\pas\trunk\fpcsrc\compiler\debug>yasm -f win32 -p gas -o test.o test.s
e:\pas\trunk\fpcsrc\compiler\debug>objdump -D test.o
test.o: file format pe-i386
Disassembly of section .text.1:
00000000 <_main>:
0: 0f b6 40 30 movzbl 0x30(%eax),%eax 4: 0f b6 40 30 movzbl 0x30(%eax),%eax -

-

Peter Johnson July 9th, 2011 @ 07:24 AM
- → Assigned user set to Peter Johnson
- → State changed from new to resolved
Closing since it's ok on HEAD.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
The Yasm Modular Assembler Project