Version 1.1
x86 Flags Register: Bit: 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 OF DF IF TF SF ZF AF PF CF
x86 Instruction Set
- MOV <destination>,<source>
- MOVZX <destination>,<source>
- MOVSX <destination>,<source>
- LAHF ; load the low byte of EFLAGS into AH
- SAHF ; store the value of AH into low byte of EFLAGS
- XCHG <destination>,<source>
- INC <destination>
- DEC <destination>
- ADD <destination>,<source>
- SUB <destination>,<source>
- LOOP <short-label>
- NEG <destination>
- JMP <target>
- PUSH <source> [<comment>]
- POP <destination> [<comment>]
- PUSHA [<comment>]
- POPA [<comment>]
- PUSHAD [<comment>]
- POPAD [<comment>]
- CALL <target>
- RET [<popvalue>]
- AND <destination>,<source>
- OR <destination>,<source>
- XOR <destination>,<source>
- NOT <destination>
- TEST <destination>,<source>
<op-code> <short-label>- JA/JNBE (unsigned)
- JAE/JNB
- JB/JNAE
- JBE/JNA
- JE/JZ
- JNE/JNZ
- JG/JNLE (signed)
- JGE/JNL
- JL/JNGE
- JLE/JNG
- JC (flags register)
- JNC
- JO
- JNO
- JS
- JNS
- JP/JPE
- JNP/JPO
- CMP <destination>,<source>
- LOOPE <short-label> LOOPZ <short-label>
- LOOPNE <short-label> LOOPNZ <short-label>
- MUL <destination> (unsigned)
- IMUL <destination> (signed)
- DIV <destination> (unsigned) AX-quotient, DX-remainder
- IDIV <destination> (signed)
- SAR <destination>,<shiftcount> - Arithmetic right-shift (signed)
- SAL <destination>,<shiftcount>- Arithmetic left-shift (signed)
- SHR <destination>,<shiftcount>- Logical right-shift (unsigned)
- SHL <destination>,<shiftcount>- Logical left-shift (unsigned)
- ROR <destination>,<shiftcount>- right rotate
- ROL <destination>,<shiftcount>- left rotate
- RCR <destination>,<shiftcount>- right rotate-through carry
- RCL <destination>,<shiftcount>- left rotate-through carry
- CALL <target>
- RET
- CLD ; increment
- STD ; decrement
- MOVSB ; ds:si -> es:di
- MOVSW ; ds:si -> es:di
- LODSB ; al <- ds:si
- LODSW ; ax <- ds:si
- STOSB ; al -> es:di
- STOSW ; ax -> es:di
- CMPSB ; ds:si - es:di
- CMPSW ; ds:si - es:di
- SCASB ; al - es:di
- SCASW ; ax - es:di
- REP <string-op>
- REPE <string-op> REPZ <string-op>
- REPNE <string-op> REPNZ <string-op>
- IRET
- INT <int-type>
Library Routines
Clrscr - clears console Crlf - outputs carriage return / line feed Delay - set eax to the number of milliseconds to delay DumpRegs - dumps the registers to the screen GetMseconds - number of milliseconds elapsing since midnight in eax Gotoxy - dh = row (0 - 24) dl = column (0 - 79) Random32 - 32-bit pseudorandom integer in eax Randomize - sets the random seed based on the time of day RandomRange - produces random number between 0 to (n - 1) where n is eax ReadChar - returns character in al ReadHex - returns up to 8 HEX digits in eax ReadInt - returns 32-bit signed int in eax ReadString - edx points to the beginning of the string ecx is the maximum number of characters that can be input eax is the number of characters actually read WaitMsg - outputs Press [Enter] to continue... and waits for the user to hit return WriteBin - ouputs the value in eax in binary form WriteChar - outputs character represented in al register WriteDec - outputs 32-bit unsigned integer in eax in decimal with no leading zeros WriteHex - outputs 32-bit unsigned integer in eax in hex with leading zeros added if necessary to make 8 hex digits WriteInt - outputs 32-bit signed integer in eax with a leading sign and no leading zeros WriteString - point edx to beginning of null terminated string