Visit Jeremy's Blog.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 08-29-2004, 02:59 PM   #1
Registered: Aug 2004
Posts: 33

Rep: Reputation: 15
Jumping in asm

Is it possible without labels to jump over 1 or more instructions?

Thanks in advance!
Old 08-29-2004, 03:28 PM   #2
Registered: Jul 2004
Location: Czech Republic - Roudnice nad Labem
Distribution: Debian
Posts: 253

Rep: Reputation: 34
I don't think it's possible. You cannot know how compiler (nasm, gas, ...) do binary elf format. That means one instruction could be replaced with 2 others. So label are needed.

Maybe you can predicate this behavior and increase your IP register somehow to skip some instruction.
Old 08-29-2004, 03:58 PM   #3
Registered: Aug 2004
Posts: 33

Original Poster
Rep: Reputation: 15
Thanks for the details! I alway's thought that each line (not empty) is one instruction.
Old 08-31-2004, 07:27 PM   #4
Registered: Aug 2004
Posts: 33

Original Poster
Rep: Reputation: 15
From NASM Documents
JMP jumps to a given address. The address may be specified as an absolute segment and offset, or as a relative jump within the current segment.
Yepi, relative jumps are possible .

From what I have been testing, each instruction becomes 5 instructions thus to do a relative jump its 5*n where n is the number of instructiosn to jump.

Are all instructions come out as 5 instructions when compiled?

I didn't test all instructions but the ones I have tested become 5 instructions when compiled.

Thanks in advance!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Jumping mouse jumico Linux - Newbie 3 04-24-2005 02:15 PM
monitor jumping around? powerlifter450 SUSE / openSUSE 2 02-24-2005 06:24 PM
DVD JUmping Boffy Linux - Hardware 3 03-31-2004 06:21 AM
NASM, Jumping, and I'm new to this... KneeLess Programming 4 02-18-2004 02:18 AM
Jumping in Head first dvlmn666 Linux - Newbie 4 12-18-2003 01:17 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:35 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration