Module 2 Quiz Questions Flashcards
A procedure is declared using the _____ and ____ directives.
PROCEDURE and END
PROC and ENDP
START and END
BEGIN and END
PROC and ENDP
How many bytes long is a SQWORD on x86 systems?
8
Write the syntax to set the size of the runtime stack to 2048 bytes.
.stack 2048
Integer Literal Expressions are evaluated to integer literals at assembly -time.
assembly
How many bytes long is a DWORD (doubleword) on x86 systems?
4
Which of the following identifiers are allowed in MASM? (Check all that apply)
BB-8
end
This_one?
manBear_Pig1
2towers
This_one?
manBear_Pig1
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.
True
Code labels may only appear on lines with no instructions.
False
The MOVSX instruction sign-extends an integer into a larger operand.
True
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
CF = 0, ZF = 0, SF = 0
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?
EAX - 46
EBX - 17
ECX - 23
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
9562
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)?
EAX - 9
EBX - 13
ECX - 6
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
2004h
The following are both valid data definitions:
List1 BYTE 10, 20
BYTE 30, 40
True
MASM will throw an error when assembling the following data segment:
.data
myChecker BYTE 12h
BYTE 34h
BYTE 56h
BYTE 78h
BYTE 90h
False
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?
101Eh
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?
1140h
Which register contains the starting address of data when calling DumpMem?
ESI
EDI
EBX
EAX
EDX
ECX
ESI
Which library procedure reads a string from standard input?
ReadString
The ________ procedure advances the cursor to the beginning of the next line in the console window.
CrLf
Which library procedure writes an unsigned 32-bit integer to standard output in hexadecimal format?
WriteHex