Bug 13573 - jmp is misassembled in Intel syntax.
Summary: jmp is misassembled in Intel syntax.
Status: RESOLVED INVALID
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: 2.21
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-07 10:34 UTC by 0x6f67db
Modified: 2013-07-08 18:15 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description 0x6f67db 2012-01-07 10:34:12 UTC
What I tell looks like to '10740 Intel syntax far jumps broken'.
But it is about the case that jmp's operand is integer.
My report is about that is memory and registers.
I wrote the following in a file whose extension is S.

.text
.code32
ljmp *4(%esp)
.intel_syntax noprefix
jmp far[esp+4]

I think both jmp commands have same meaning.
But they were assembled into the different machine code.

'jmp far[esp+4]' -> 'FF A4 24 0A FF 00 00'
'ljmp *4(%esp)' -> 'FF 6C 24 04'

 'FF A4 24 0A FF 00 00' is wrong machine code to work as I thought.
Comment 1 H.J. Lu 2013-07-08 18:15:47 UTC
"far" without "ptr" is treated as a number, 0xff06.
You can use

jmp far ptr[esp+4]

to get indirect far jmp.