Strings Flashcards

(25 cards)

1
Q

true/false

strings should always have a value equal to the total number of cells declared

A

false, strings may have an actual value less then the total number of cells declared

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

string instructions and meaning (5)

A
  1. LODS - load string
  2. STOS - store string
  3. MOVS - move string
  4. CMPS - compare string
  5. SCAS - scan string
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

required operand/s for LODS

A

source

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

required operand/s for STOS

A

destination

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

required operand/s for MOVS

A

src and dest

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

required operand/s for CMPS

A

src and dest

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

required operand/s for SCAS

A

dest

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what register/s do string instructions use as operand/s?

A

rsi (src) and rdi (dest)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

true/false

string instructions automatically increment/decrement the index registers used by them

A

true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

controls the direction of string processing

A

direction flag

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

in what direction will string operations proceed if the direction flag is clear (DF = 0)?

A

forward (head to tail)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

instructions to explixitly manipulate the direction flag (2)

A

std: set DF (DF = 1)
cld: clear DF (DF = 0)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

MOVS format

A

movs dest_str, src_str

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

a prefix accepted by string instructions to repeatedly execute the operation

A

repetition prefix

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

prefix categories (2)

A
  1. unconditional repetition
  2. conditional repetition
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

unconditional repeat prefix

17
Q

rep repeats the instruction until ____

A

the value of the rcx register reaches 0

18
Q

repeats the instruction until either the rcx register reaches 0 or the zero flag (ZF) is equal to 0

19
Q

repeats the instruction until either the rcx register reaches 0 or the zero flag (ZF) is not equal to 0

20
Q

copies the value from the source string (rsi) to the a register

21
Q

copies the value from the A register to the destination string (rdi)

22
Q

what will this block of code do?

mov rcx, qword[strlen]
mov rsi, string1
mov rdi, string2

loop1:
    lodsb
    stosb
    loop loop1
A

it copies the content of string1 into string2

23
Q

compares the two strings at RSI and RDI and sets the flags

24
Q

true/false

CMPS performs RDI - RSI and sets the flags according to the comparison made

A

false, it should be RSI - RDI

25
useful in searching for a particular value or character in a string
SCAS