• Advertisement
Sign in to follow this  

What exactly is an "instruction"?

This topic is 2530 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
[quote name='nuclear123' timestamp='1297727938' post='4774295']
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?
[/quote]

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

Share this post


Link to post
Share on other sites
[b]Opcode[/b]: This specifies which command is being given.

[b]Operand[/b]: 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? :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement