Basic 80x86 Instructions

SymbolicOperationFlags AffectedOperand Types
adc srce,destadd with carry, dest=dest+srce+CF AF,CF,OF,PF,SF,ZFmem,reg; reg,mem; reg,reg; imm,reg; imm,mem
add srce,destaddition, dest=dest+srce AF,CF,OF,PF,SF,ZFmem,reg; reg,mem; reg,reg; imm,reg; imm,mem
and srce,destbitwise and, dest = dest and srce PF,SF,ZF,CF=0,OF=0mem,reg; reg,mem; reg,reg; imm,reg; imm,mem
call label save return address on SS, jump to target nonelabel
cbwconvert byte to word, extend sign of AL into AH nonenone
cdqconvert double to quad, EAX to EDX/EAX nonenone
clcclear carry flagCF=0none
cmccomplement carry flagCF = 1 - CFnone
cmp srce,desttemp = dest - srce, set flags AF,CF,OF,PF,SF,ZFmem,reg; reg,mem; reg,reg; imm,reg; imm,mem
cwdconvert word to double, extend sign of AX into DX nonenone
cwdeconvert word AX to double EAX, extend sign nonenone
dec destdecrement, dest = dest - 1 AF,OF,PF,SF,ZFmem; reg;
hltstop CPU executionnonenone
idiv srcesigned divide, AL = AX / srce, AX = DX:AX / srce, EAX = EDX:EAX / srce PF,SF,ZF,AF,CF,OFmem; reg
imul srce,destsigned multiply, dest = dest * srce PF,SF,ZF,AF,CF,OFmem,reg; reg,reg; imm,reg
inc destincrement, dest = dest + 1 AF,OF,PF,SF,ZFmem; reg;
intsave flags, call interrupt handler IF=0, TF=0none
intointerrupt on overflow, interrupt if CF=1 IF=0, TF=0none
ja labeljump if above, CF=0 and ZF=0 nonelabel
jae labeljump if above or equal, CF=0 nonelabel
jb labeljump if below, CF=1 nonelabel
jbe labeljump if below or equal, CF=1 or ZF=1 nonelabel
jc labeljump if carry, CF=1 nonelabel
jcxz labeljump if CX register is zero nonelabel
jecxz labeljump if ECX register is zero nonelabel
je labeljump if equal, ZF=1 nonelabel
jg labeljump if greater, ZF=0 and SF=OF nonelabel
jge labeljump if greater or equal, SF=OF nonelabel
jl labeljump if less, SF<>OF nonelabel
jle labeljump if less or equal, ZF=1 or SF<>OF nonelabel
jmp labelunconditonal jump to label nonelabel
jna labeljump if not above, CF=1 or ZF=1 nonelabel
jnae labeljump if not above or equal, CF=1 nonelabel
jnb labeljump if not below, CF=0 nonelabel
jnbe labeljump if not below or equal, CF=0 and ZF=0nonelabel
jnc labeljump if not carry, CF=0 nonelabel
jne labeljump if not equal, ZF=0 nonelabel
jng labeljump if not greater, ZF=1 or SF<>OF nonelabel
jnge labeljump if not greater or equal, SF<>OF nonelabel
jnl labeljump if not less, SF=OF nonelabel
jnle labeljump if not less or equal, ZF=0 and SF=OFnonelabel
jno labeljump if not overflow, OF=0 nonelabel
jnp labeljump if not parity, PF=0 nonelabel
jns labeljump if not sign, SF=0 nonelabel
jnz labeljump if not zero, ZF=0 nonelabel
jo labeljump if overflow, OF=1 nonelabel
jp labeljump if parity, PF=1 nonelabel
jpe labeljump if parity even, PF=1 nonelabel
jpo labeljump if parity odd, PF=0 nonelabel
js labeljump if sign, SF=1 nonelabel
jz labeljump if zero, ZF=1 nonelabel
lahfload flags into AH AH = SF,ZF,-,AF,-,PF,-,CFnone
lea srce,desteffective memory address loaded into reg. nonemem,reg
loop labeldecrement CX, jump if CX != 0 nonelabel
mov srce,destmove, dest = srcenone mem,reg; reg,mem; reg,reg; imm,reg; imm,mem
movsx srce,destmove s.p. to d.p, dest = srce, pad MSB with signnonemem,reg; reg,reg;
movzx srce,destmove s.p. to d.p, dest = srce, pad MSB with 0nonemem,reg; reg,reg;
neg dest2's complement negate dest AF,CF,OF,PF,SF,ZFmem; reg;
nopno operationnonenone
not destbitwise not, 1's complement dest nonemem; reg;
or srce,destbitwise or, dest = dest or srce PF,SF,ZF,CF=0,OF=0mem,reg; reg,mem; reg,reg; imm,reg; imm,mem
pop destpop from stack to dest nonemem; reg; (bytes not allowed)
popapop all AX,CX,DX,BX,SP,BP,SI,DI from stacknonenone
popadpop all EAX,ECX,EDX,EBX,ESP,EBP,ESI,EDI nonenone
popfpop word from stack to flags register allnone
push destpush dest onto stack nonemem; reg; (bytes not allowed)
pushapush all AX,CX,DX,BX,SP,BP,SI,DI onto stacknonenone
pushadpush all EAX,ECX,EDX,EBX,ESP,EBP,ESI,EDI nonenone
pushfpush flags register onto stacknonenone
rcl srce,destrotate dest left by srce bits through CF CF,OFimm,mem; imm,reg; %cl,mem; %cl,reg;
rcr srce,destrotate dest right by srce bits through CF CF,OFimm,mem; imm,reg; %cl,mem; %cl,reg;
ret ?pop return address from stack, optionally increment SPCF,OFimm
rol srce,destrotate dest left by srce bits, into CF CF,OFimm,mem; imm,reg; %cl,mem; %cl,reg;
ror srce,dest rotate dest right by srce bits, into CF CF,OFimm,mem; imm,reg; %cl,mem; %cl,reg;
sahfstore into flags SF,ZF,-,AF,-,PF,-,CF = AH SF,ZF,AF,PF,CFnone
sar srce,destshift dest right by srce bits, into CF, sign replicated CF,OF,PF,SF,ZFimm,mem; imm,reg; %cl,mem; %cl,reg;
sal/shl srce,destshift dest left by srce bits, into CF, 0 padCF,OF,PF,SF,ZFimm,mem; imm,reg; %cl,mem; %cl,reg;
shr srce,destshift dest right by srce bits, into CF, 0 padCF,OF,PF,SF,ZFimm,mem; imm,reg; %cl,mem; %cl,reg;
sbb srce,destdest = dest - srce - CF AF,CF,OF,PF,SF,ZFmem,reg; reg,mem; reg,reg; imm,reg; imm,mem
stcset carry flag, CF = 1CF=1none
sub srce,destdest = dest - srce AF,CF,OF,PF,SF,ZFmem,reg; reg,mem; reg,reg; imm,reg; imm,mem
test srce,destlogical test, flags set for (dest and srce)PF,SF,ZF,CF=0,OF=0mem,reg; reg,reg; imm,reg; imm,mem
xchg srce,destswap dest with srce nonemem,reg; reg,reg;
xor srce,destbitwise exclusive or, dest = dest xor srcePF,SF,ZF,CF=0,OF=0mem,reg; reg,mem; reg,reg; imm,reg; imm,mem


Don S. Bidulock
Department of Computer Science
University of Calgary
Calgary, Alberta
Canada T2N 1N4
Phone: 403 220-7689 Fax: 403 284-4707
email: dsb@cpsc.ucalgary.ca

University of Calgary