flat assembler
Message board for the users of flat assembler.

Index > Main > point of nop?

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
ishkabible



Joined: 13 Sep 2010
Posts: 54
ishkabible
well i think my subject explains it fairly well. what is the point of nop? there must be a reason for it or else it wouldn't be there right.
Post 15 Nov 2010, 22:05
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
In the original machine, one byte nop is simply different name for "xchg ax, ax" instruction. Similar to "mov ax, ax", etc. If it wasn't there, there would have to be some specific handling for this particular opcode.
Post 15 Nov 2010, 23:41
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
mindcooler



Joined: 01 Dec 2009
Posts: 423
Location: Västerås, Sweden
mindcooler
1. to take up space
2. to eat up cpu time
Post 16 Nov 2010, 07:37
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2915
Location: [RSP+8*5]
bitRAKE
It simplified an orthogonal instruction layout within the processor circuitry.
Post 16 Nov 2010, 10:16
View user's profile Send private message Visit poster's website Reply with quote
sinsi



Joined: 10 Aug 2007
Posts: 693
Location: Adelaide
sinsi
Well there was a cpu (pdp-10) that had "jump always" and "jump never" instructions. It's all about symmetry...

edit: http://en.wikipedia.org/wiki/PDP-10#Instructions
Post 16 Nov 2010, 10:28
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7725
Location: Kraków, Poland
Tomasz Grysztar
Note that in modern x86 processors we have not only the "90" NOP, but also "0F 1F /0".
Sometimes new purposes emerge over time for something that initially was not so useful.
Post 16 Nov 2010, 10:39
View user's profile Send private message Visit poster's website Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 975
Location: Czechoslovakia
MazeGen
Does anyone know when the XCHG eAX, eAX became real architectural NOP (i.e. when the Intel CPU stopped to touch eAX)? I'd say it was either 386 or 486, but I found no clear evidence.
Post 16 Nov 2010, 11:08
View user's profile Send private message Visit poster's website Reply with quote
asmhack



Joined: 01 Feb 2008
Posts: 431
asmhack
patching maybe ? Laughing
Post 16 Nov 2010, 12:23
View user's profile Send private message Reply with quote
ctl3d32



Joined: 30 Dec 2009
Posts: 204
Location: Brazil
ctl3d32
asmhack wrote:
patching maybe ? Laughing


yes!!!!!! Laughing
Post 16 Nov 2010, 20:46
View user's profile Send private message Reply with quote
ishkabible



Joined: 13 Sep 2010
Posts: 54
ishkabible
symmetry makes sense. i read some where that there was a logical way to get the different instructions values by just knowing some base value. i didn't look any further into it. it makes sense that in creating a logical intuitive way to derive the values of the instructions that some useless ones would occur. so dose the processor actually move ax to ax? or dose it just disregard things of this nature?
Post 16 Nov 2010, 21:40
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
ishkabible,

Until speculative execution has been introduced (P6), that has no real effect. Keyword is dependency.
Post 16 Nov 2010, 22:03
View user's profile Send private message Reply with quote
b1528932



Joined: 21 May 2010
Posts: 287
b1528932
i think they introduced real nop in long mode.
In 32bit mode it was just xchg eax, eax.
Post 17 Nov 2010, 23:24
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
b1528932,

You think wrong. nop r/m instruction is present since later P4; it works perfectly even in real-address mode.

Why do we need manuals? We can just have opinions. Wink
Post 18 Nov 2010, 06:52
View user's profile Send private message Reply with quote
luke77



Joined: 14 May 2010
Posts: 18
luke77
Nops are pretty interesting.

They also get used as "fillers" and as one byte instructions.

Microsoft worked in conjunction with Intel to develop it.

It means No Other Plan. Smile

Have a great day,
Andy

http://intouch.org/magazine/daily-devotional
http://www.happynews.com

[/b]
Post 18 Nov 2010, 11:30
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2915
Location: [RSP+8*5]
bitRAKE
"No Other Plan" that's very funny, luke77. Very Happy FYI: NOPs existed before Microsoft did, nor was Intel the first to document NOP as an instruction. (PDP-8, The Small Computer Handbook (1966 Edition), Sections 1 and 2 (top of page 63), probably earlier references exist; but Intel was founded in 1968 and Microsoft in 1975.)
Quote:
NO OPERATION (NOP)

Octal Code: 7000

Indicators: OPR, FETCH, EXECUTE, END

Execution Time: 28 microseconds

Parity Test: instruction

Operation: This command causes a 1 instruction delay in the program (28 microseconds) and then the next sequential instruction is initiated. This command is used to add execution time to a program, such as to synchronize subroutine or loop timing with peripheral equipment timing.

Symbol: None
Post 19 Nov 2010, 03:35
View user's profile Send private message Visit poster's website Reply with quote
luke77



Joined: 14 May 2010
Posts: 18
luke77
Thanks bitRAKE.

I was a class clown in my Catholic High School.

I still haven't grown up.

Andy Laughing
Post 19 Nov 2010, 04:07
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
luke77: Was it Roman Catholic or Greek Catholic?
Post 19 Nov 2010, 10:37
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
luke77



Joined: 14 May 2010
Posts: 18
luke77
vid wrote:
luke77: Was it Roman Catholic or Greek Catholic?


Roman Catholic.

What are the differences?

I am a non-denominational Christian now.
Post 19 Nov 2010, 12:27
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17287
Location: In your JS exploiting you and your system
revolution
MazeGen wrote:
Does anyone know when the XCHG eAX, eAX became real architectural NOP (i.e. when the Intel CPU stopped to touch eAX)? I'd say it was either 386 or 486, but I found no clear evidence.
I think it would be the introduction of RAX that forced the decoding of nop to be "real".
Post 23 Nov 2010, 14:54
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
revolution: I think sooner, during or early after pipelining was introduced, so that "xchg eax, eax" doesn't mark EAX as modified. But I never cared too much about optimization stuff, maybe generic xchg pipeline-optimization handling is smart enough not to cause problems with this?
Post 24 Nov 2010, 00:04
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.