Assembly Language After this part, you should know:
The compiling process of programs The adv/disadv of using assembly language Assembly Language & Assembler Assembly Language & Assembler 4Byte Assembly Language vs. High-level Language Instruction Set After this part, you should know:
Every instruction and their usage How to write simple assembly program with IS
Useful Links: Instruction set http://vitaly_filatov.tripod.com/ng/asm/asm_000.html http://www.emu8086.com/assembly_language_tutorial_assembler_reference/8086_instruction_set.html Emulator http://www.emu8086.com/
8088/8086 Instruction Set Overview Data Transfer Data Transfer MOV (MOV d,s) PUSH, POP (PUSH/POP s) IN, OUT (IN/OUT d,s)
XCHG (Exchange data ) (XCHG d,s) XCHG AX,BX
XLAT (Table look-up translation) (XLAT) AL [DS: (BX+AL)] Assume prior to XLAT DS = 1000H BX = 2000H AL = 80H
After XLAT ? Data Transfer LEA (Load Effective Address ) (LEA d,s) dest Addr (source) LEA AX, [BP+40H] ;(BP=1000H) load 1040H into AX
LDS (Load pointer using DS ) (LDS d,s) DS (source + 2); dest (source)
LES (Load ES with pointer ) (LES d,s) ES (source+2); dest (source)
Assume DS = 1000H ES = 3000H
LDS BX, [2222H] ???
LES DI, [222H] ??? Data Transfer LAHF (Load flags into AH register ) (LAHF) AH FR lower bit
SAHF (Store AH into flags ) (SAHF) FR lower bit AH
POPF (Pop data into flags register ) (POPF) FR (SP); SP SP+2
PUSHF (Push flags onto stack ) (PUSHF) SP SP - 2; (SP) FR Arithmetic Arithmetic ADD (ADD d,s) dest dest + source SUB (SUB d,s) dest dest - source
ADC (Add with carry ) (ADC d,s) dest dest + source +CF SBB (Subtraction with borrow ) (SBB d,s) dest dest - source -CF
INC (Increment by 1 ) (INC d) dest dest +1 DEC (Decrement by 1 ) (DEC d) dest dest -1 Arithmetic MUL (MUL s) AX source * AL ; if source is a byte DX:AX source * AX; if source is a word DIV (DIV s) AX AL / source ; source is a byte AH remainder DX:AX AX / source ; source is a word DX remainder
IMUL (IMUL s) IDIV (IDIV s)
CMP (CMP d,s) Set flags according to (d-s) () NEG (NEG d) dest -dest Conversion ASCII AAA (ASCII adjust AL after addition ) (AAA)
AAS (ASCII adjust AL after subtraction ) (AAS) AAM(ASCII adjust AL after multiplex) (AAM) AAD(ASCII adjust AL after divination ) (AAD)
Decimal DAA (Decimal adjust AL after addition ) (DAA) DAS (Decimal adjust AL after subtraction ) (DAS)
Logic Logic AND (AND d,s) OR (OR d,s) NOT (NOT d) XOR (XOR d,s)
SCAS (SCAS d) CMP AX/AL, (ES:DI) set flags SCASB (SCASB) SCASW (SCASW) Control Transfer Control transfer JMP Within: -128byte to 127byte Conditional JMP Carry Parity Zero Overflow Sign (negative) Short Jumps CALL & RET CALL (call procedure_name) If FAR CALL (inter-segment) PUSH CS CS dest_seg PUSH IP IP dest_offset If NEAR CALL (intra-segment) PUSH IP IP dest_offset RET (RET) POP IP
LOOP LOOP (LOOP short-label) CX CX -1 If (cx <>0) JMP short-label LOOPE (LOOPE short-label) CX CX -1 If (cx <>0 and ZF = 1) JMP short-label LOOPNE/ LOOPNZ (LOOPNE/LOOPNZ short-label) CX CX -1 If (cx <>0 and ZF = 0) JMP short-label
INT Process Control Process Control STC, CLC (set/clear carry flag ) CF 0/1 CMC (complement carry flag) CF -CF STD, CLD (set/clear direction flag) DF 0/1 STI, CLI (set/clear interupt enable flag) IF 0/1
The Morgan Kaufmann Series in Data Management Systems Jiawei Han Micheline Kamber Jian Pei Data Mining. Concepts and Techniques 3rd Edition Morgan Kaufmann 2011