What exactly is an "instruction"?
Crossbones+ - Reputation: 2112
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
Members - Reputation: 111
Posted 15 February 2011 - 09:57 AM
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?