Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


What exactly is an "instruction"?


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   -  Reputation: 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?



Sponsor:

#2 nobodynews   Crossbones+   -  Reputation: 2112

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   -  Reputation: 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.



PARTNERS