Flag manipulation and processor control instructions , Assembly Language

Flag Manipulation and Processor Control Instructions

These instructions control the functioning of available hardware inside the processor chip. These are categorized into these types; (a) machine control instructions and (b) flag manipulation instructions. The flag manipulation instructions are directly modify some of the flags of 8086. The machine control instructions can control the usage and execution of the bus. The flag manipulation instructions and their functions are following:

CLC -   Clear carry flag

CMC -   Complement carry flag

STC -   Set carry flag

CLD -   Clear direction flag STD:-Set direction flag CLI - Clear interrupt flag STI - Set interrupt flag

These instructions modify directly the direction (DF), carry (CF) and interrupt (IF) flags. The DF and IF flag, which can be modified by using the flag manipulation instructions, further control the processor operation; like the auto increment or auto decrement and the interrupt responses modes. Thus the respective instructions may also be called as processor or machine control instructions. The other flags may be modified by using POPF  and SAHF instructions, which are termed as the data transfer instructions. No direct instructions are available for modifying the status flags except the carry flag.

The machine control instructions supported by the 8086 and 8088 are listed along with their functions below. These machine control instructions do not need any operand.

 

WAIT   -   Wait for Test input pin to go low

HLT      -   Halt the processor

NOP     -   No operation

ESC      -   Escape to external device like NDP (numeric co-processor)

LOCK   -   Bus lock instruction prefix.

After execution of the HLT instruction, the processor goes to the halt state, as explained in first Chapter. The two ways to pull it out of the halt state are to reset processor or interrupt it. When instruction NOP is executed, the processor does not execute any operation until the 4 clock cycles, except incrementing the IP by one. Then it continues with further execution after the 4 clock cycles. When executed ESC instruction, frees the bus for an external master like a peripheral or coprocessor devices.  The LOCK prefix may seem with another instruction.  When it is executed, the bus access is not endorsed for another master until the lock prefixed   instruction is executed fully. This instruction is utilized in the case of programming for multiprocessor systems. The instruction WAIT when executed holds the operation of processor with the current status until the logic level on the TEST pin set low. The processor goes on inserting WAIT states in the instruction cycle, until the TEST pin set low. Once the TEST pin set low, it continues with further execution.

 

Posted Date: 10/12/2012 5:19:36 AM | Location : United States







Related Discussions:- Flag manipulation and processor control instructions , Assignment Help, Ask Question on Flag manipulation and processor control instructions , Get Answer, Expert's Help, Flag manipulation and processor control instructions Discussions

Write discussion on Flag manipulation and processor control instructions
Your posts are moderated
Related Questions
a- Trace the following program fragment and find out the content of ax after the          the execution of the program.         X db   5,7  -3,-9,4,-7,9               Mov

) What is the difference between re-locatable program and re-locatable data?

ROR : Rotate Right without Carry: This instruction rotates the contents of destination operand to the bit-wise right either by one or by the count specified in register CL, exclud

errorlevel -302 ;prevents error code for this chipset __config 0x373A ;chip config PIC spec page 146 processor 16F877A ;chipset reset code

Data copy/transfer Instructions MOV: This data transfer instruction transfers data from one register or memory location to another register or memory location. The source can

Using the windows32 framework, write a complete 80x86 program for Programming Exercises 4.3 number 3, on pages 130-131 of the textbook. Follow all coding conventions mentioned in

Write a MIPS/SPIM assembly language program that prints the smallest and largest values found in a non-empty table of N word-sized integers. The address of the first entry in your

Programming with an assembler The procedure of hand-coding 8086 programs is somewhat tiresome; hence generally a programmer may find it hard to get a correct listing of the mac

Display control 8279  provides  a  16  byte  display  memory  and  refresh  logic.  Every address in the display memory corresponds to a display unit with address zero represen

Flag Register : 8086 has a 16-bit flag register which is divided into 2 parts, viz. (a)machine control flagsand (b)condition code or status flags. The condition code flag regi