This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
different results on using intel syntax and at&t syntax
- From: nix noob <nixnoob1618 at yahoo dot com>
- To: binutils at sources dot redhat dot com
- Date: Sun, 1 Jan 2006 09:17:14 -0800 (PST)
- Subject: different results on using intel syntax and at&t syntax
there appears to be a problem i am not aware how i can
get rid of that
i use .intel_syntax no prefix
in my sample simpwind.s
i first did
.equ NEWT_KEY_UP,0x8001
.equ NEWT_KEY_DOWN,0x8002 etc
and tried to use them instead of hardcoding them on
compare
cmp eax, NEWT_KEY_UP
it gets assembled to
cmp eax,ds:0x8001
and then segfaults
just to see if it segfaults on at&t syntax too
i just over rid one single line with .att_syntax
keyup:
.att_syntax <--- over rode here
cmp $NEWT_KEY_UP,%eax
.intel_syntax noprefix <-- reset back
jne keydown
dec dword ptr ds:[upkey]
invoke move_window
jmp loop_start
keydown:
cmp eax,NEWT_KEY_DOWN
jne keyleft
inc dword ptr ds:[upkey]
invoke move_window
jmp loop_start
and att syntax doesnt do that ds:0x8001
the disassembly is as follows
0x8048466 <newtInit+98>: lea esp,[esp*1+12]
0x804846a <newtInit+102>: call 0x80483a4
<newtRefresh>
0x804846f <newtInit+107>: lea esp,[esp*1]
0x8048473 <newtInit+111>: call 0x80483d4
<newtGetKey>
0x8048478 <newtInit+116>: lea esp,[esp*1]
0x804847c <newtInit+120>: cmp eax,0x8001
<------
0x8048481 <newtInit+125>: jne 0x8048494
<newtInit+144>
0x8048483 <newtInit+127>: dec ds:0x8049660
0x8048489 <newtInit+133>: call 0x80484fb
<newtInit+247>
0x804848e <newtInit+138>: lea esp,[esp*1]
0x8048492 <newtInit+142>: jmp 0x8048473
<newtInit+111>
0x8048494 <newtInit+144>: cmp eax,ds:0x8002
<-------
0x804849a <newtInit+150>: jne 0x80484ad
<newtInit+169>
0x804849c <newtInit+152>: inc ds:0x8049660
0x80484a2 <newtInit+158>: call 0x80484fb
<newtInit+247>
can some one explain how i can eliminate this problem
thanks and regards
__________________________________
Yahoo! for Good - Make a difference this year.
http://brand.yahoo.com/cybergivingweek2005/