written by vangelis(vangelis@wowhacker.org)
0 0000 8 1000 1 0001 9 1001 2 0010 10 1010 3 0011 11 1011 4 0100 12 1100 5 0101 13 1101 6 0110 14 1110 7 0111 15 1111 110112 + 100012 = 1011002
110 0000 0101 1010 0111 11102 6 0 5 A 7 E16 1324 / 16 = 82.75 82 x 16 = 1312 13241312 = 12: C 82 / 16 = 5.125 5 x 16 = 80 82 80 = 2: 2 5 / 16 = 0.3125 0 x 16 = 0 5 0 = 5: 5 0 11111111 FF 0255. 0 0 0000 1 1 0001 2 2 0010 3 3 0011 4 4 0100 5 5 0101 6 6 0110 7 7 0111 8 8 1000 9 9 1001 A 10 1010
B 11 1011 C 12 1100 D 13 1101 E 14 1110 F 15 1111 0 1 2 3 4 5 6 7 2A 45 B8 20 8F CD 12 2E ASCII Unicode
Segment x 10h + offset= 1234 x 10h + 4321 = 16661
MOV MOV,. AX 56h : MOV AX,56h ;AX 56h. : MOV AX,BX ;AX BX. ; BX 45h AX 45h.
XCHG. XCHG. XCHG.. XCHG 1, 2. MOV DX,56h MOV AX,3Fh XCHG DX,AX DX 56h, AX 3Fh, (XCHG) DX 3Fh, AX 56h. : 8 (h/l) 16 (X).. XCHG AH,BX INC DEC.. INC, DEC.. MOV DX,50h INC DX ;DX 50h ;DX 51h., DX++ MOV DX,50h DEC DX ;DX 50h ;DX 4F.(50h 1h = 4Fh), DX--. 6, 2. POP PUSH.. POP PUSH AX..
PUSH AX POP. POP AX 16.. AX BX. MOV AX,51h MOV BX,4Fh XCHG AX,BX PUSH AX MOV AX,34h POP BX PUSH BX POP AX? AX 4Fh, BX 4Fh.. MOV AX,51h MOV BX,4Fh ;AX 51h. ;BX 4Fh. XCHG AX,BX ;AX BX. AX=4Fh, BX 51h PUSH AX MOV AX,34h ;AX ;AX 34h POP BX ;BX., BX = 4Fh
PUSH BX ;BX 4Fh POP AX ;AX = 34h., 4Fh.. 4 ADD, SUB, MUL, DIV. ADD. ADD. ADD 1, 2 ADD, MOV AX,5h MOV BX,4h ;AX 5h ;BX 4h ADD AX,BX ;AX BX, AX (5h + 4h = 9h = AX). MOV AX,5h ADD AX,4h ;AX = 5h, 4h. AX 5h + 4h. SUB.. SUB 1, 2 SUB, MOV BX,4Fh 4Fh SUB BX,5h ;BX 5h 4A
MUL... AX AH. MUL MOV AX,5h MOV BX,4Fh MUL BX AX 18B(4Fh x 5h = 18B) DIV.. DIV MUL MOV AX,5h MOV BX,4Fh DIV BX AX Fh (4Fh / 5h = Fh) 4Fh = 79 5h = 5 79 / 5 = 15.8 15 = Fh Bit AND, OR, XOR, NOT. bit...
AND : AND 1, 2 AND, MOV AX,5h MOV BX,6h AND AX,BX ;AX AX 4. 16 bit 2 5h = 101b 6h = 110b 101b 110b --- 100b 4h AND truth. 1 1. 0 AND 0 = 0 1 AND 0 = 0 0 AND 1 = 0 1 AND 1 = 1 OR : OR 1, 2 OR,
OR 1 1 MOV AX,5h MOV BX,6h OR AX,BX AX 7h. 5h = 101b 6h = 110b 101b 110b ---- 111b 111b = 7h 0 OR 0 = 0 1 OR 0 = 1 0 OR 1 = 1 1 OR 1 = 1 XOR XOR 1, 2 XOR, MOV AX,5h MOV BX,6h
XOR AX,BX 5h = 101b 6h = 110b 101b 110b ---- 011b 11b = 3h XOR 0 XOR 0 = 0 1 XOR 0 = 1 0 XOR 1 = 1 1 XOR 1 = 0 NOT. NOT.. NOT NOT MOV AX,F0h NOT AX AX F. F0h = 11110000 00001111, F. NOT NOT 1 = 0 NOT 0 = 1
Flags Name Description Formats O S Z A P C ADC Add with Carry O2 C C C C C C ADD Add Integers O2 C C C C C C AND Bitwise AND O2 0 C C? C 0 CALL Call Routine R M I CBW Convert Byte to Word CDQ Convert Dword to Qword CLC Clear Carry 0 CLD Clear Direction Flag CMC Complement Carry C CMP Compare Integers O2 C C C C C C CMPSB Compare Bytes C C C C C C CMPSW Compare Words C C C C C C CMPSD Compare Dwords C C C C C C CWD Convert Word to Dword into DX:AX CWDE Convert Word to Dword into EAX DEC Decrement Integer R M C C C C C DIV Unsigned Divide R M?????? ENTER Make stack frame I,0 IDIV Signed Divide R M?????? IMUL Signed Multiply R M C???? C R16,R/M16 R32,R/M32 R16,I R32,I R16,R/M16,I R32,R/M32,I INC Increment Integer R M C C C C C INT Generate Interrupt I JA Jump Above I JAE Jump Above or Equal I JB Jump Below I
JBE Jump Below or Equal I JC Jump Carry I JCXZ Jump if CX = 0 I JE Jump Equal I JG Jump Greater I JGE Jump Greater or Equal I JL Jump Less I JLE Jump Less or Equal I JMP Unconditional Jump R M I JNA Jump Not Above I JNAE Jump Not Above or Equal I JNB Jump Not Below I JNBE Jump Not Below or Equal I JNC Jump No Carry I JNE Jump Not Equal I JNG Jump Not Greater I JNGE Jump Not Greater or Equal I JNL Jump Not Less I JNLE Jump Not Less or Equal I JNO Jump No Overflow I JNS Jump No Sign I JNZ Jump Not Zero I JO Jump Overflow I JPE Jump Parity Even I JPO Jump Parity Odd I JS Jump Sign I JZ Jump Zero I LAHF Load FLAGS into AH LEA Load Effective Address R32,M LEAVE Leave Stack Frame LODSB Load Byte LODSW Load Word LODSD Load Dword LOOP Loop I LOOPE/LOOPZ Loop If Equal I LOOPNE/LOOPNZ Loop If Not Equal I
MOV Move Data O2 SR,R/M16 R/M16,SR MOVSB Move Byte MOVSW Move Word MOVSD Move Dword MOVSX Move Signed R16,R/M8 R32,R/M8 R32,R/M16 MOVZX Move Unsigned R16,R/M8 R32,R/M8 R32,R/M16 MUL Unsigned Multiply R M C???? C NEG Negate R M C C C C C C NOP No Operation NOT 1 s Complement R M OR Bitwise OR O2 0 C C? C 0 POP Pop From Stack R/M16 R/M32 POPA Pop All POPF Pop FLAGS C C C C C C PUSH Push to Stack R/M16 R/M32 I PUSHA Push All PUSHF Push FLAGS RCL Rotate Left with Carry R/M,I R/M,CL C C RCR Rotate Right with Carry R/M,I C C R/M,CL REP Repeat REPE/REPZ Repeat If Equal REPNE/REPNZ Repeat If Not Equal RET Return ROL Rotate Left R/M,I C C R/M,CL
ROR Rotate Right R/M,I C C R/M,CL SAHF Copies AH into FLAGS C C C C C SAL Shifts to Left R/M,I C R/M, CL SBB Subtract with Borrow O2 C C C C C C SCASB Scan for Byte C C C C C C SCASW Scan for Word C C C C C C SCASD Scan for Dword C C C C C C SETA Set Above R/M8 SETAE Set Above or Equal R/M8 SETB Set Below R/M8 SETBE Set Below or Equal R/M8 SETC Set Carry R/M8 SETE Set Equal R/M8 SETG Set Greater R/M8 SETGE Set Greater or Equal R/M8 SETL Set Less R/M8 SETLE Set Less or Equal R/M8 SETNA Set Not Above R/M8 SETNAE Set Not Above or Equal R/M8 SETNB Set Not Below R/M8 SETNBE Set Not Below or Equal R/M8 SETNC Set No Carry R/M8 SETNE Set Not Equal R/M8 SETNG Set Not Greater R/M8 SETNGE Set Not Greater or Equal R/M8 SETNL Set Not Less R/M8 SETNLE Set Not LEss or Equal R/M8 SETNO Set No Overflow R/M8 SETNS Set No Sign R/M8 SETNZ Set Not Zero R/M8 SETO Set Overflow R/M8 SETPE Set Parity Even R/M8 SETPO Set Parity Odd R/M8 SETS Set Sign R/M8
SETZ Set Zero R/M8 SAR Arithmetic Shift to Right R/M,I C R/M, CL SHR Logical Shift to Right R/M,I C R/M, CL SHL Logical Shift to Left R/M,I C R/M, CL STC Set Carry 1 STD Set Direction Flag STOSB Store Btye STOSW Store Word STOSD Store Dword SUB Subtract O2 C C C C C C TEST Logical Compare R/M,R 0 C C? C 0 R/M,I XCHG Exchange R/M,R R,R/M XOR Bitwise XOR O2 0 C C? C 0