Assembly - Mnemonic (instruction class)

> Procedural Languages > Language - Assembly (asm)

1 - About

A mnemonic is a name that groups different opcode that have the same purpose.

Precisely, a mnemonic is a reserved name for a class of instruction opcodes which have the same function.

Advertising

3 - Example

Below is the jmp (jump) mnemonic of the Intel CPU where each row corresponds to an instruction.

The two letters in the first column are the opcode. You can see that for each row, they are all different but they are implementing the same function, a jump to another location.

More instruction jmp example

4 - Type

4.1 - Extended

Extended mnemonics specify a combination of:

  • an opcode
  • with a specific operand

E.g. from the System/360 assemblers :

  • B = BC with a mask of 15
  • NOP (“NO OPeration” – do nothing for one step) = BC with a mask of 0.

4.2 - Pseudo

5 - Management

5.1 - List

The mnemonic are given in the isa documentation reference and are a part of the instruction documentation.

See instruction list

Advertising

6 - Example

6.1 - Inc

  • Increment the memory variable COUNT
inc.asm
INC COUNT

6.2 - Mov

  • Transfer the value 48 in the memory variable TOTAL
inc.asm
MOV TOTAL, 48    
  • Transfer the value 10 to the AL register
inc.asm
MOV AL, 10       

6.3 - Add

  • Add the content of the BH register into the AH register
inc.asm
ADD AH, BH
  • Add 10 to the variable MARKS
inc.asm
ADD MARKS, 10  
Advertising

6.4 - And

  • Perform AND operation on the variable MASK1 and 128
inc.asm
AND MASK1, 128