Classification of instructions
8086 instructions may be classified as:
- Classification based on size of the instruction: As discussed in topic on instruction format 8086 instruction can be from 1 to 6 byte long. The first two bytes indicate the OPCODE and the addressing
- Classification based on the addressing modes: The addressing mode affect the size of the instruction. addressing mode specify how the data byte is to be accessed. The addressing mode bits are specified in the 2nd byte (bit7-6) of the instruction format.
- Classification based on the function performed by the instructions: This form of classification is based on the function performed by the instruction. This is described in the following paragraph.
Instruction Set of 8086 based on the function performed
In the beginning era microprocessors were programmed using a language of 0’s and 1’s by manually putting certain switches ON and OFF. This language of 0’s and 1’s was called the machine language. Soon engineers came up with the symbolic language in which the binary operation codes were assigned symbols called mnemonic. The set of different mnemonics used for programming the microprocessor are called the instruction set, and the language using the mnemonics is called assembly language. The instruction set of the 8086 fall under the following groups according to their functionality.
- Data Transfer Instructions: MOV, XCHG, XLAT, LEA, LDS, LES, PUSH, POP, IN and OUT
- Arithmetic Instructions : ADD, ADC, INC, AAA, DAA, SUB, SBB, DEC, NEG, CMP, AAS, DAS, MUL, IMUL, AAM, DIV, IDIV, AAD, CBW, BWD
- Logical Instructions/ Bit Manipulation Instruction : AND, OR, XOR, NOT, SAL, SHL, SAR, SHR, ROR, RCR, ROL, RCL
- Program Execution Transfer Instructions : JMP, CALL, RET, JA, JAE, JB, JBE, JCJCXR, JE, JG, JGE, JL, JLE, JNA, JNAE, JNB, JNBE, JNC, JNE, JNG, JNGE, JNL, JNLE, JNO, JNP, JNS, JNZ, JO, JP, JPE, JPO, JS, JZ
- String Instructions : MOVS/ MOVSB / MOVSW, COMPS/ CMPSB / CMPSW, SCAS/ SCASB / SCASW, LODS/ LODSB / LODSW, STOS / STOSB / STOSW
- Processor Control Instructions : HLT, WAIT, ESC, LOCK, NOP, STC, CLC, CMC, STD, CLD, STI, CLI
Platforms for writing assembly programs.
Assembly level language program for the 8086 processors can be written in the following platforms.
- Directly as hex codes fed into the RAM and executed on a trainer kit
- DOS debug utility of windows
- Writing the text file in notepad or gedit and then assembling using the MASM, TASM, NASM assemblers etc.
- We can also write and run the program in the IDE of C or C++