STRINGS

Cards (12)

  • String

    A series of ASCII characters, typically terminated with a NULL
  • The NULL is a non-printable ASCII control character that can be used to mark the end of a string
  • String instructions
    Ease string manipulation, can operate on 8-,16-,32- or 64-bit operands
  • Reading and Writing String instructions
    1. LODS (Load string)
    2. STOS (Store string)
    3. MOVS (Copy string to desired destination)
  • Direction flag (DF)

    Determines whether the index registers are incremented or decremented
  • CLD

    Clears the direction flag, index registers are incremented
  • STD

    Sets the direction flag, index registers are decremented
  • REP

    Unconditional repeat prefix which causes the instruction to repeat according to the value of rcx
  • REPE/REPZ
    Similar to REP but immediately terminates when ZF = 0
  • REPNE/REPNZ

    Similar to REP but immediately terminates when ZF = 1
  • LEA (Load Effective Address)

    Loads the effective address of the memory operand into the specified register, without loading the value
  • Comparison String instructions

    1. CMPS (Compares two strings per element)
    2. SCAS (Scans a character in a string)