Flag and Machine Control Instructions 8085 8085 Microprocessor by Ravinder Nath Rajotiya - December 14, 2020May 10, 20210 Flag Manipulation and a Processor Control Instructions These instructions control the functioning of the available hardware inside the processor chip. These instructions are categorized into two types: Flag Manipulation instructions. Machine Control instructions. 1. Flag Manipulation instructions The Flag manipulation instructions directly modify the carry flag. These are STC - Set the carry Flag CMC - Complement the carry Flag 2. Machine Control instructions The Machine control instructions control the bus usage and execution HLT – Halt the process. NOP – No operation. DI - Disable Interrupt EI - Enable Interrupt
Processor Control Instruction 8086 8086 Microprocessor by Ravinder Nath Rajotiya - December 14, 2020May 10, 20210 Processor Control Instructions There are certain instructions in 8086 that control the processor flags, i.e. the flags can be set or reset by use of these instructions. Processor control instructions Description Comments/ example FLAG CONTROLS STC Set carry Flag ( CF=1) CLC Clear carry (CF=0) CMC Complement carry flag STD Set Direction flag, thus reverse traverSIng the string, i.e. SI or DI now point at the end of string, In each traverse SI/DI will be decremented Data segment Name db “MyString” Revrse_name db 8 dup(‘ ‘) Data ends Code segment Assume DS:data CS:code MOV AX, data MOV DS,AX CLD LEA SI,Name LEA DI, Reverse_name MOV CX, 08 REP MOVSB; Code ends CLD Clear Direction flag so that string traverse is from beginning, SI/DI will point to beginning of string STI Set interrupt enable flag to 1(enable interrupts) CLI DIsalee interrupts External Synchronization HLT HALT(do nothing) until interrupts WAIT Wait till SIgnal on TEST pin is low ESC Escape to external
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
Experiment Number 1 8086 Programming by Ravinder Nath Rajotiya - April 19, 2019May 25, 20220 AIM :Write a program to add and subtract two 16-bit numbers with/ without carry using 8086 Objective: To understand working of 8086 Based System. To draw flowchart of the 16-bit Addition To develop and execute program, To verify the result of two 16-bit long number. System Requirement : 8086 Trainer Kit with Key Board Setting up the Trainer Kit: Ensure that standard IBM PC/AT system keyboard is connected System is Powered ON Student has a handy opcode table for programming Use data Address as : For Program Code segment address : 1000 Offset address : 0200 For Data segment address 0000 offset address : 1300 Flowchart to Add two 16-bit numbers: Algorithm: Start Initialize the BX, and SI Registers Read the contents of the memory