23-05-2014, 02:51 PM
Branch group of instructions or Control Transfer Instructions
Branch group of instructions.pptx (Size: 150.49 KB / Downloads: 16)
Loop Instructions
These instructions are used to repeat a set of instructions several times.
Format: LOOP Short-Label
Operation: (CX) (CX)-1
Jump is initialized to location defined by short label if CX≠0. otherwise, execute next sequential instruction.
Instruction LOOP works w.r.t contents of CX. CX must be preloaded with a count that represents the number of times the loop is to be repeat.
Whenever the loop is executed, contents at CX are first decremented then checked to determine if they are equal to zero.
If CX=0, loop is complete and the instruction following loop is executed.
If CX ≠ 0, content return to the instruction at the label specified in the loop instruction.
RETURN
Every subroutine must end by executing an instruction that returns control to the main program. This is the return (RET) instruction.
By execution the value of IP or IP and CS that were saved in the stack to be returned back to their corresponding regs. (this time (SP) (SP)+2 )
Processor Control Instructions
STC, CLC, CMC Set, clear, complement carry flag
S T D , C L D Set, clear direction flag
S T I, C L I Set, clear interrupt enable flag
LAHF, SAHF Load AH from flags, store AH into flags
PUSHF, POPF Push flags onto stack, pop flags off stack
E S C Escape to external processor interface
LOCK Lock bus during next instruction
NOP No operation (do nothing)
WAIT Wait for signal on TEST input
H L T Halt processor
Machine control instructions
HLT instruction – HALT processing
the HLT instruction will cause the 8086 to stop fetching and executing instructions. The 8086 will enter a halt state. The only way to get the processor out of the halt state are with an interrupt signal on the INTR pin or an interrupt signal on NMI pin or a reset signal on the RESET input.
NOP instruction
this instruction simply takes up three clock cycles and does no processing. After this, it will execute the next instruction. This instruction is normally used to provide delays in between instructions.
ESC instruction
whenever this instruction executes, the microprocessor does NOP or access a data from memory for coprocessor. This instruction passes the information to 8087 math processor. Six bits of ESC instruction provide the op-code to coprocessor.
when 8086 fetches instruction bytes, co-processor also picks up these bytes and puts in its queue. The co-processor will treat normal 8086 instructions as NOP. Floating point instructions are executed by 8087 and during this 8086 will be in WAIT.