X86 Assembly Short Jump

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've having a problem using gcc's inline assembly on a Pentium 3 running
redhat linux:

I'm working inside a __asm__("."); block and I'd like to execute a short
(near relative) jump instruction.  It doesn't seem to work.  Instead, I
get a near jump to an absolute position, so I figure that I'm doing
something wrong.  If anyone could help, I'd appreciate it..

When the instruction is executed, eip is set to 0x02, instead of being
set to eip+2.  I looked at the disassembly in gdb and the op-code I
should be getting according to the Intel IA32 Instruction Set Reference
is "EB" but instead I'm instead getting "E9".

Again, any help would be appreciated.  Perhaps there's a better way to
jump to a relative position within an assembly block.

		-kris


__asm__("
	.
	JMP 0x02	# Should add 0x02 to eip, but instead, it sets
eip to 0x02.
	.
");




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux