CS271 Week 3

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

If the LOOP instruction sets ECX to zero, a jump to the destination label does take place.

False

MASM has built-in range checking for effective addresses.

False

The MOVSX instruction is only used with unsigned integers.

False

The following instructions will set the Carry flag: mov al,0FEh sub al,2

False

Which library procedure reads a 32-bit signed decimal integer from standard input?

ReadInt

Which library procedure reads a string from standard input?

ReadString

By default, labels are visible only within the procedure in which they are declared.

True

Mechanically speaking, the CALL instruction pushes its return address on the stack and copies the called procedure's address into the instruction pointer.

True

The INC instruction does not affect the Carry flag.

True

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

True

The USES operator, coupled with the PROC directive, lets you list the names of all registers modified within a procedure.

True

The following instructions will set the Sign flag: mov al,0FEh sub al,2

True

The linker combines object files into an executable file.

True

Which of the following code sequences assigns the value 0x10 to EBX? (select all that are correct)

mov edx,20h push edx mov ecx,10h push ecx pop ebx pop edx mov edx,20h push edx mov ecx,10h push ecx pop ebx pop edx

A/An ________ procedure call occurs when a called procedure calls another procedure before the first procedure returns.

nested

What will be the value of EAX when the following sequence of instructions has executed? push 5 push 10 push 20 pop eax

20

What will be the value of EAX when the following sequence of instructions has executed? push 5 push 10 pop ebx pop eax

5

There are several important uses of runtime stacks in programs (select all that apply):

A stack makes a convenient temporary save area for registers when they are used for more than one purpose. After they are modified, they can be restored to their original values. When calling a subroutine, you pass input values called arguments by pushing them on the stack. When the CALL instruction executes, the CPU saves the current subroutine's return address on the stack. The stack provides temporary storage for local variables inside subroutines.

The instructions used to manipulate the ESP regieter are (select all that apply):

CALL POP RET PUSH

Which library procedure displays the CPU flags and 32-bit registers?

DumpRegs

Which register contains an integer before calling WriteDec?

EAX

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

Esi

Which library procedure generates a 32-bit pseudorandom integer in a caller-specified range?

RandomRange

Which of the following is NOT a valid MOV operation? Table 4-1 might be helpful. (check any/all that apply)

MOV imm,mem MOV mem,mem MOV imm,imm

A common programming error is to inadvertently initialize ECX to zero before beginning a loop (when using the LOOP instruction).

True

Adding 5 to 0FBh in an 8-bit register sets the Zero flag.

True

Adding 7Fh and 05h in an 8-bit register sets the Overflow flag.

True

Which library procedure writes a single character to standard output?

WriteChar

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

WriteHex

Which of the following CALL instructions writes the contents of EAX to standard output as a signed decimal integer?

call WriteInt


Ensembles d'études connexes

Burger King: PHU Product Hold Times

View Set

Chapter 16: Drugs for the Treatment of Seizure Disorders

View Set