CHAPTER-6
ASSEMBLY LANGUAGE PROGRAMMING
Machine code Instructions
The only language that the CPU recognises is machine code.
Machine code consists of a sequence of instructions.
An instruction contains an opcode.
An instruction may not have an operand but up to three operands are possible.
Different processors have different instruction sets associated with them.
Different processors will have comparable instructions for the same operations, but the
coding of the instructions will be different.
For a particular processor, the following must be defined for each individual machine
code instruction:
• the total number of bits or bytes for the whole instruction
• the number of bits that define the opcode
• the number of operands that are defined in the remaining bits
• whether the opcode occupies the most significant or the least significant bits.
Opcode and Operand
Opcode defines the action associated with the instruction.
Operand defines any data needed by the instruction.
Machine code instruction is a binary code with a defined number of bits that comprises
an opcode and, most often, one operand.
For example, ADD 234 is a machine code instruction, where ADD is the opcode
Past question papers with answers