10 - Parameters and Pointers Flashcards

1
Q

How does one print the value of a decimal integer?

A

printf(“%d”,n) in C

push myint //push the value of the variable onto the stack
lea eax,format //address of the format string is saved in eax
push eax //push the address of the string to the stack
call printf //call printf, it will take two parameters from the stack
add esp,8 //clean top two positions in the stack

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

How does one scan a decimal value ?

A

scanf(“%d”, &n)

&n is the address of the variable ‘n’

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

What does %c do in printf?

A

Print a character

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

What does %i do in printf?

A

Print a signed decimal number

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

What does %s do in printf?

A

Print a string of characters

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

What does %c do in scanf?

A

Read a single character

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

What does %d do in scanf?

A

Read a signed decimal integer

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

What does %s do in scanf?

A

Read a string of characters until a whitespace char (blank, newline, tab)

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

What are the two types of jump instructions ?

A
  • Conditional: JCXZ, JECXZ

- Unconditional: JMP <address></address>

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

JC, JNC ?

A

JC = Jumps if carry flag is set (=1)

JNC = Jumps if carry flag is clear (=0)

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