Module 2 Quiz Questions Flashcards

1
Q

A procedure is declared using the _____ and ____ directives.
PROCEDURE and END
PROC and ENDP
START and END
BEGIN and END

A

PROC and ENDP

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

How many bytes long is a SQWORD on x86 systems?

A

8

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

Write the syntax to set the size of the runtime stack to 2048 bytes.

A

.stack 2048

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

Integer Literal Expressions are evaluated to integer literals at assembly -time.

A

assembly

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

How many bytes long is a DWORD (doubleword) on x86 systems?

A

4

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

Which of the following identifiers are allowed in MASM? (Check all that apply)
BB-8
end
This_one?
manBear_Pig1
2towers

A

This_one?
manBear_Pig1

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

In MASM all text following a semicolon (on the same line) is treated as a comment and ignored when the program is converted to machine code.

A

True

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

Code labels may only appear on lines with no instructions.

A

False

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

The MOVSX instruction sign-extends an integer into a larger operand.

A

True

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

Which answer choice shows the correct values of the Carry, Zero, and Sign flags after the following instructions execute?
mov al,00110011b
test al,2

CF = 0, ZF = 0, SF = 0
CF = 1, ZF = 0, SF = 1
CF = 1, ZF = 0, SF = 1
CF = 0, ZF = 1, SF = 0

A

CF = 0, ZF = 0, SF = 0

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

After the following MASM code is executed:

MOV EAX, 52
MOV EBX, 17
MOV ECX, 23
ADD EAX, EBX
SUB EAX, ECX

What is the decimal value in the EAX register?
What is the decimal value in the EBX register?
What is the decimal value in the ECX register?

A

EAX - 46
EBX - 17
ECX - 23

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

Suppose that you are given the following program. What decimal value does the AX register hold when someProcedure is called?

.data
x DWORD 153461
y BYTE 37
z BYTE 90

.code
main PROC
MOV AH, y
MOV AL, z
CALL someProcedure
INC EAX
MOV EBX, z
XOR EAX, EBX
exit
main ENDP
END MAIN

A

9562

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

After the following MASM code is executed:

MOV EAX, 123
MOV EBX, 13
MOV EDX, 0
DIV EBX

What is the value in the EAX register (in decimal)?
What is the value in the EBX register (in decimal)?
What is the value in the EDX register (in decimal)?

A

EAX - 9
EBX - 13
ECX - 6

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

In the following data definition, assume that List2 begins at offset 2000h. What is the offset of the third value (5)?

List2 WORD 3,4,5,6,7

A

2004h

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

The following are both valid data definitions:

List1 BYTE 10, 20
BYTE 30, 40

A

True

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

MASM will throw an error when assembling the following data segment:

.data
myChecker BYTE 12h
BYTE 34h
BYTE 56h
BYTE 78h
BYTE 90h

16
Q

The following data segment starts at memory address 1000h (hexadecimal)

.data
printString BYTE “Assembly is fun”,0
moreBytes BYTE 10 DUP(0)
dateIssued DWORD ?
dueDate DWORD ?
elapsedTime WORD ?
What is the hexadecimal address of dueDate?

17
Q

The following data segment starts at memory address 1100h (hexadecimal)

.data
printString BYTE “MASM is fun”,0
moreBytes BYTE 48 DUP(0)
dateIssued DWORD ?
dueDate DWORD ?
elapsedTime WORD ?
What is the hexadecimal address of dueDate?

18
Q

Which register contains the starting address of data when calling DumpMem?

ESI
EDI
EBX
EAX
EDX
ECX

19
Q

Which library procedure reads a string from standard input?

A

ReadString

20
Q

The ________ procedure advances the cursor to the beginning of the next line in the console window.

21
Q

Which library procedure writes an unsigned 32-bit integer to standard output in hexadecimal format?