You are on page 1of 13

Lecture 5-6.

Main unprivileged
commands - III
String operations
Command: REP
Purpose: Repeat

Command: REPE
Purpose: Repeat, while equal

Command: REPNE
Purpose: Repeat, while not equal

Command: REPZ
Purpose: Repeat, while zero

Command: REPNZ
Purpose: Repeat, while not zero
Lecture 5-6. Main unprivileged
commands - III

Command: MOVS receiver, source


Purpose: Copying strng

Command: MOVSB
Purpose: Copying byte string

Command: MOVSW
Purpose: Copying word string

Command: MOVSD
Purpose: Copying double word string
Lecture 5-6. Main unprivileged
commands - III

Command: CMPS receiver, source


Purpose: Comparing strings

Command: CMPSB
Purpose: Comparing byte strings

Command: CMPSW
Purpose: Comparing word strings

Command: CMPSD
Purpose: Comparing double word strings
Lecture 5-6. Main unprivileged
commands - III

Command: SCAS receiver


Purpose: Scanning string

Command: SCASB
Purpose: Scanning byte string

Command: SCASW
Purpose: Scanning word string

Command: SCASD
Purpose: Scanning double word string
Lecture 5-6. Main unprivileged
commands - III

Command: LODS source


Purpose: Reading from string

Command: LODSB
Purpose: Reading byte from string

Command: LODSW
Purpose: Reading word from string

Command: LODSD
Purpose: Reading double word from string
Lecture 5-6. Main unprivileged
commands - III

Command: STOS receiver


Purpose: Writing in string

Command: STOSB
Purpose: Writing byte in string

Command: STOSW
Purpose: Writing word in string

Command: STOSD
Purpose: Writing double word in string
Lecture 5-6. Main unprivileged
commands - III

Command: INS source, DX


Purpose: Reading string from port

Command: INSB
Purpose: Reading byte string from port

Command: INSW
Purpose: Reading word string from port

Command: INSD
Purpose: Reading double word string from port
Lecture 5-6. Main unprivileged
commands - III

Command: OUTS DX, receiver


Purpose: Writing string in port

Command: OUTSB
Purpose: Writing byte string in port

Command: OUTSW
Purpose: Writing word string in port

Command: OUTSD
Purpose: Writing double word string in port
Lecture 5-6. Main unprivileged
commands - III
Flag management
Command: STC
Purpose: Set carryover flag

Command: CLC
Purpose: Reset carryover flag

Command: CMC
Purpose: Invert carryover flag

Command: STD
Purpose: Set direction flag

Command: CLD
Purpose: Reset direction flag
Lecture 5-6. Main unprivileged
commands - III

Command: LAHF
Purpose: Load state flags in AH

Command: SAHF
Purpose: Load state flags from AH

Command: PUSHF
Purpose: Place FLAGS in stack

Command: PUSHFD
Purpose: Place EFLAGS in stack
Lecture 5-6. Main unprivileged
commands - III

Command: POPF
Purpose: Load FLAGS from stack

Command: POPFD
Purpose: Load EFLAGS form stack

Command: CLI
Purpose: Disable interruptions

Command: STI
Purpose: Enable interruptions

Command: SALC
Purpose: Set AL according to CF
Lecture 5-6. Main unprivileged
commands - III
Loading segment registers
Command: LDS receiver, source
Purpose: Load address, using DS

Command: LES receiver, source


Purpose: Load address, using ES

Command: LFS receiver, source


Purpose: Load address, using FS

Command: LGS receiver, source


Purpose: Load address, using GS

Command: LSS receiver, source


Purpose: Load address, using SS
Lecture 5-6. Main unprivileged
commands - III

Other commands
Command: NOP
Purpose: Lack of operation

Command: LOCK
Purpose: Blocking prefix of data bus

Command: UD2
Purpose: Indefinite operation

Command: CPUID
Purpose: Processor identification

You might also like