8088 Instruction Set
8088 Instruction Set
8088 Instruction Set
MOV PUSH, POP IN, OUT XCHG XLAT PUSHF, POPF LAHF, SAHF
CBW - convert byte to word CWD - convert word to double-word LDS - load pointer using DS LES - load pointer using ES
Format: MOV D,S D=destination S=source PUSH, POP IN, OUT IN 100 OUT 110
LEA - load effective address ARITHMETIC ADD, SUB ADD, SUB MUL, DIV 1. Reg/Mem with Register IMUL, IDIV - integer division and 2. Immediate to Reg/Mem multiplication 3. Immediate to AX/AL CMP
ADC,SBB - using carry (or borrow) LOGICAL AND, OR, NOT, XOR AND, OR, NOT, XOR 1. Reg/Mem with Register TEST 2. Immediate to Reg/Mem 3. Immediate to AX/AL SAR,SAL SHL, SHR ROL, ROR ROL, ROR RCR, RCL STRING MOVS, LODS, STOS CMPS SCAS PROGRAM CONTROL CALL, RET CALL, RET INT, IRET, INTO INT JMP JMP JZ JNZ JCXZ - jump when register cx is zero JB
JC, JNC - jumping based on carry flag JA JS, JNS - jumping based on sign flag LOOP JO, JNO - jumping based on overflow flag JP(JPE), JNP(JPO) - jumping based on parity flag JZ(JE), JNZ(JNE) - jumping based on zero flag JL(JNGE) - jumps if sign flag not equal to overflow flag JNL(JGE) - jumps if sign flag equals overflow flag JLE(JNG) - jumps if sign flag not equal to overflow flag OR zero flag is one JNLE(JG) - jumps if sign flag equals overflow flag OR zero flag is zero JAE(JNB) - jumps if carry flag is zero JB(JNAE) - jumps if carry flag is one JA(JNBE) - jumps if carry flag and zero flag are both zero JBE(JNA) - jumps if carry flag OR
zero flag are one LOOP, LOOPE(LOOPZ), LOOPNE(LOOPNZ) REP, REPNE(REPNZ), REPE(REPZ) NOP, HLT, WAIT, ESC, LOCK FLAGS - setting and clearing STC, CLC - carry flag CMC complement carry flag STD, CLD - direction flag STI, CLI - interupt enable flag START: MOV AX, 20h MOV BX, 34h ADD AX,BX JMP NEXT NEXT: MOV BX,AX JMP START CMP {destination}, {source} ; destination source (set flags) They take the form:-
CMP {<register> | <memory>}, {<register> | <memory> | <immediate>} ROL Instruction ROL (rotate) shifts each bit to the left The highest bit is copied into both the Carry flag and into the lowest bit No bits are lost
MOV Al,11110000b ROL Al,1 ; AL = 11100001b MOV Dl,3Fh ROL Dl,4 ; DL = F3h ROR Instruction ROR (rotate right) shifts each bit to the right The lowest bit is copied into both the Carry flag and into the highest bit No bits are lost
MOV AL,11110000b ROR AL,1 ; AL = 01111000b MOV DL,3Fh ROR DL,4 ; DL = F3h