1

I need an explanation about the term "opcode". I have found this :

An opcode is binary or hex value of the machine instruction in the cpu instruction set.

If I understand correctly the definition, for instance :

6A 03  push 3

6A is the opcode et 03 the operand. But in several posts on different forums, people talk about 03 as if it was an opcode (for instance this

Here, 3 is an immediate because it's included directly as part of the opcode (in the second byte).

).

Does 03 is an opcode and an operand?

  • 1
    An instruction is composed of many parts which are not necessarily byte sized. – 0xec Dec 24 '18 at 14:17
  • To reduce confusion, it's better to refer 6A 03 as the instruction with opcode and operand being 6A and 03 respectively. The mnemonic would be push 3. – 0xec Dec 24 '18 at 14:48
  • Compare 0xCC INT 3 – an opcode and its operand, in a single byte. – usr2564301 Dec 24 '18 at 22:01
1

Regarding this specific push and according to the Intel SDM (Page can be identified by searching Vol. 2B 4-507) 03 is both a part of the opcode and the "argument". The full opcode of "push 03" is "6A 03"

As far as I know Intel SDM consistently uses the term opcode as "all the content of the assembly command, including operands". Table of possible PUSH opcodes in the SDM

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.