Chapter 9 & 10 Flashcards
(27 cards)
MOVSB, MOVSB, and MOVSD
Move the string BYTE, “”WORD, “”DWORD
Copies data from the memory location pointed to by ESI to the memory location pointed to by EDI
Direction Flag
Controls the inc or dec of ESI and EDI
DF = 0 - forward/increment DF = 1 - backward/decrement
CLD
Clear Direction Flag
STD
Set Direction Flag
Repeat Prefix
REP - inserted before MOVSB, MOVSW, etc.
ECX controls num reps
REPE(REPZ)
REPNE(REPNZ)
CMPSB, CMPSW, and CMPSD
Compare string byte, “”WORD, “”DWORD
Compares a memory operand pointed to by ESI to a memory operand pointed to by EDI
SCASB, SCASW, and SCASD
Scan string byte, WORD, DWORD
Compares a value in AL/AX/EAX to a byte, word, or DWORD addressed by EDI
LODSB, LODSW, LODSD
Load string byte,…
Loads a byte or word from memory at ESI into AL/AX/EAX respectively
Str_compare Procedure
Compares string1 and string2
Str_length Procedure
Calculates the length of a null-terminated string and returns the length in the EAX register
Str_copy Procedure
Copies a null-terminated string from a source location to a target location
Str_trim
Removes all occurrences of a selected trailing character from a null terminated string
Str_ucase Procedure
Converts a string to all uppercase characters
Base-Index Operand
Adds the values of two registers (called base and index), producing an effective address
Base-Index-Displacement Operand
Adds the base and index registers to a constant, producing an effective address
Structure
Template/pattern given to a logically related group of variables
Syntax:
Name STRUCT
Field declarations
Name ENDS
Union
Same as structure except all fields begin at the same offset
Macro
Named block of assembly statements
During the assembler preprocessing step, each macro call is expanded into a copy of the macro
Default Argument Initializer
Automatically assigns a value to a parameter when a macro argument is left blank
Ex:
mWriteLn MACRO text:=
…
ENDM
IFIDN and IFIDNI
Both compare two symbols and return true if they are equal
IFIDN is case sensitive
IFIDNI is case insensitive
&
Substitution Operator
- resolves ambiguous references to parameter names within a macro
%
Expansion Operator
- expands text macros or converts constant expressions into their text representations
<>
Literal-text Operator
- groups one or more characters and symbols into a single text literal
!
Literal-character Operator
- forces the preprocessor to treat a predefined operator as an ordinary character