Logical and Shift and Rotate Instructions 8086 8086 Microprocessor by Ravinder Nath Rajotiya - December 14, 2020May 10, 20210 LOGICAL Group of Instructions. Bit manipulation instruction Bit Manipulation instructions : The instruction in this category operate on bits. The instruction can set, reset or even can test a particular bit. These instructions include : Logical instructions: NOT, AND, OR, XOR and Test. FORMAT Example Comments Flags Affected NOT Source (R/M) MOV BL, 35h NOT BL BL=00110101 BL= 11001010 AND (R/M), Imm./ R/M MOV AL, 35h AND AL, 0Fh AL=00110101 AL=AL.0Fh= 00000101 CF=OF=0, AF=? PF, SF, ZF updated OR (R/M), Imm./ R/M MOV BL, 22h MOV CL, FFh OR BL, CL BL=00010110 CL=11111111 BL=BL+CL=11111111 CF=OF=0, AF=? PF, SF, ZF updated XOR (R/M), Imm./ R/M MOV AL, 55h XOR AL, FAh AL=01010101 AL xor FAh=10100111 CF=OF=0, AF=? PF, SF, ZF updated TEST R?M, Imme/R/M MOV AL, 51h TEST AL, 80h AL=01010001 Test AL,80 test if the MSB is 0 or not; if msb is zer0 Z flag will be set. CF=OF=0, AF=? PF, SF, ZF updated 2. Shift and Rotate operation These instructions are
Arithmetic Instruction (8086) 8086 Microprocessor by Ravinder Nath Rajotiya - October 15, 2020October 23, 20200 Arithmetic Instructions The instruction in this group include ADD, ADC, INC, AAA, DAA, SUB, SBB, DEC, NEG, CMP, AAS, DAS, MUL, IMUL, AAM, DIV, IDIV, AAD, CBW, BWD. These instruction require two operands which act as destination and the source. Almost all the instructions affect the flags. Instruction Format Flags affected Description Processing ADD ADD Dst, Src AF, CF, OF, PF, SF,ZF Add Dst and Src with result in Dst Dst = Dst+Src ADC ADC Dst, Src AF, CF, OF, PF, SF,ZF Add Dst and Src and the carry with result in Dst Dst = Dst+Src + Cy AAA AAA Affects AF and CF all others PF, ZF, SF, OF are unaffected This instruction follows the addition of unpacked BCD operands. Adjust ASCII addition result, result in AX. The result in AL is changed to unpacked BCD, AL(7-4) cleared, CF is
Data Transfer Instruction 8086 8086 Microprocessor by Ravinder Nath Rajotiya - October 14, 2020October 14, 20200 Data Transfer Instructions These instructions are used to transfer the data from one operand to another. The source operand could be a literal, in a register, memory, or even an i/o port, as the case may be. Examples of data transfer instructions are: MOV, XCHG, XLAT, LEA, LDS, LES, PUSH, POP, IN and OUT. These instructions are described in the following paragraphs. MOV : Move byte or word to register or memory location. The source can be a register, memory location or an immediate number, the destination can be a register or memory location. But bot the source and destination cannot be memory locations. General syntax format : MOV Destination, Source Examples: MOV CX, 023Bh ; move an immediate 16-bit number in register CX MOV AX,
Instruction Set 8086 8086 Microprocessor by Ravinder Nath Rajotiya - October 14, 2020April 28, 20210 Platforms for writing 8086 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++ 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
8086 Addressing Modes 8086 Microprocessor by Ravinder Nath Rajotiya - September 30, 20200 Addressing Modes of 8086 As we are aware that the 8086 operates on the operands that is to be fetched from memory, i/o, registers or by some other means such as an immediate number etc. The way or the technique in which the operand is specified is called an addressing mode. The addressing mode help us in identifying the source of the operand or calculate the offset of the operands if it is in memory. The addressing mode of 8086 is divided in two categories: Data related addressing modes : It is used for data access from /to different source and destinations. Branch related addressing modes: It is used to branch to different location within same or different segment. Data related addressing