You are here

Processor Control Instruction 8086

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 processor such as coprocessor
LOCK Used as a prefix, to prevent another processor from taking bus while adjacent instruction executes.

NO OPERATION

NOP No action except fetch and decode.

 

Leave a Reply

Top
error: Content is protected !!