Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

What exactly is an "instruction"?

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 nuclear123   Members   

119
Like
0Likes
Like

Posted 14 February 2011 - 05:58 PM

so what exactly is an instruction?
1.) is an opcode considered an instruction?
2.) is an operand also considered an instruction?

3.) is a combination of an opcode & operand makeup a legal "definition" of an instruction?



#2 nobodynews   Members   

3093
Like
2Likes
Like

Posted 14 February 2011 - 06:46 PM

so what exactly is an instruction?
1.) is an opcode considered an instruction?
2.) is an operand also considered an instruction?
3.) is a combination of an opcode & operand makeup a legal "definition" of an instruction?


I believe you'll find good answers to your questions here: http://en.wikipedia.org/wiki/Instruction_(computer_science)#Parts_of_an_instruction

C++: A Dialog | C++0x Features: Part1 (lambdas, auto, static_assert) , Part 2 (rvalue references) , Part 3 (decltype) | Write Games | Fix Your Timestep!


#3 arasmussen   Members   

111
Like
0Likes
Like

Posted 15 February 2011 - 09:57 AM

Opcode: This specifies which command is being given.

Operand: This specifies which values are being operated on.

For example, if you're adding two registers, $1 and $2, then "ADD $1, $2" would be the instruction, "ADD" is the opcode, and $1, $2 are both operands.

Just because you have an operand and an opcode, that doesn't necessarily give you a full instruction. For example, if you have "ADD $1", you're specifying an opcode and an operand, but this isn't a full instruction (what do you want to add $1 with?) However the full "ADD $1, $2" is an instruction, which is a combination of opcodes and operands. I believe certain opcodes do not even require operands.

We're talking assembly right? :)




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.