Exam 2 Review

Ace your homework & exams now with Quizwiz!

If ECX is initialized to zero before beginning a loop, then the loop will not be executed any time.

False

If the RET instruction is omitted from a procedure, the code will not be assembled

False

In 32-bit mode, the register ESI register manages the stack.

False

It is possible that Zero flag and Sign flag to be set at the same time

False

It is possible to set the overflow flag if you add a positive integer to a negative integer.

False

JMP is a conditional transfer intruction

False

Nested procedure calls are not permitted by the Microsoft assebler unless the NESTED operator is used in the procedure definition

False

The EBX register is usually reserved for addressing the stack

False

The ESI and EDI registers cannot be used when passing 32-bit parameters to procedures

False

The LENGTHOF operator returns the number of bytes in an operand

False

The LOOPE instruction jumps to label when (and only when) the Zero Flag is clear

False

The OFFSET operator always returns a 16-bit value

False

The PUSH instruction cannot have an immediate operand

False

The USES operator only generates push instructions, so you must code pop instruction yourself

False

The destination operand of a MOV instruction cannot be a segment register

False

The loop instruction first checks to see whether ECX is not equal to zero; then LOOP decrements ECX and jumps to the destination label

False

The registers listed in the USES directive must use commas to separate the register names

False

The target of a LOOP instruction must be within 256 bytes of the current location

False

Write a Call statement that calls a procedure name MyProc in an external link library: MyProc Call

False

The following code will jump to the label named Target. mov al, 7Fh cmp al, 80h ja Target

False compare left side to right side

Any 32-bit general-purpose register can be used as an indirect operand.

True

If ECX is initialized to zero before beginning a loop, and ECX is not modified by any other instructions inside the loop, then the loop will be executed 4,294,967,296 many times, that is 2^32

True

If I have USES ESI ECX in procedure head, it is equivalent to have PUSH ESI PUSH ECX at the beginning of the procedure and POP ECX POP ESI at the end of the procedure (Before RET instruction)

True

In 32-bit mode, the LOOPNZ instruction jumps to a label when ECX is greater than zero and the Zero flag is clear

True

In protected mode, each procedure call uses a minimum of 4 bytes of stack space

True

In real-address mode, CX is used as the counter by the LOOP instruction

True

In real-address mode, the ECX register is used as the counter by the LOOPD instruction

True

In the operand notation used by Intel, imm16 indicates a 16-bit constant operand

True

In the operand notation used by Intel, reg/mem32 indicate a 32-bit register or memory operand

True

It is not possible to define a procedure inside an existing procedure

True

It is possible to set the overflow flag if you add a negative integer to a negative integer.

True

It is possible to set the overflow flag when you do NEG instruction

True

Local variables in procedures are created on the stack

True

Stack is called a LIFO data structure

True

The Call instruction pushes the offset of the instruction following the Call on the stack

True

The EIP register cannot be the destination operand of a MOV instruction

True

The PROC directive begins a procedure and the ENDP directive ends a procedure

True

The RET instruction pops the tip of the stack into the instruction pointer

True

The SIZEOF operator returns the number of bytes in an operand

True

The TYPE operator returns a value of 4 for doubleword operands

True

The USES operator lets you name all register that are modified within a procedure

True

The destination label of a LOOPZ instruction must be no farther than -128 or +127 bytes from the instruction immediately following LOOPZ

True

The following instruction is invalid: inc [esi]

True

The following is an indexed operand: array[esi]

True

The running time stack holds the return address of called procedures

True

Three basic types of operands are: Register, Immediate, and Memory

True

Use the PROTO directive to declare a procedure named MyProc in an external link library: MyProc PROTO

True

dll file extension stands for Dynamic Link Library

True

What the following code does? cmp ebx, ecx ja next mov X, 1 next:

if ebx <= ecx X = 1

What the following code does? cmp edx, ecx jb L1 move X, 1 jmp next L1: mov X, 2 next:

if edx >= ecx X = 1 else X = 2

What will be the value of BX after the following instruction execute? mov bx, 0FFFFFh and bx, 6Bh none of these 6Bh 6B00h 006Bh

none of these

Which of the following reverses all the bits in EAX? not eax and eax, 0FFFFFFFFh or eax, 0FFFFFFFFh xor eax, 0FFFFFFFFh

not eax xor eax, 0FFFFFFFFh

Which instruction pop the stack into the EFLAGS registers? popfd popef popf popa

popfd

Suppose there is no push instruction. You write your own two lines of code to equivalent push EAX to stack. Which of the following is correct? sub [esp], 4 mov esp, eax sub [esp], 2 mov esp, eax sub esp, 2 mov [esp], eax sub esp, 4 mov [esp], eax

sub esp, 4 mov [esp], eax

What value will be in EAX after the following instructions execute? .data dVal DWORD 12345678h .code mov ax, 3 mov WORD PTR dVal+2, ax mov eax, dVal 12340003h 00035678h 03005678h 12000378h

00035678h

What will be the value of BL after the following instructions execute? mov bl, 94h xor bl, 37h 0A3h 14h 3Ah 87h

0A3h

What will be the value in EAX after the following lines execute? mov eax, 1002FFFFh inc ax; Error 10020000h 10030000h 1002FFFE

10020000h

What will be the value in EAX after the following lines execute? mov eax, 2003FFFFh neg ax 2002FFFFh 20030000h 20030001h 20020001h

20030001h

Use the following data definition: .data myBytes BYTE 10h, 20h, 30h, 40h Find the requested register values on the right side of the following instruction sequence: mov esi, OFFSET myBytes mov ax, [esi] ; AX = 0020h 1020h 0010h 2010h

2010h

What will be the final value in EAX after the following sequence of code is executed? push 5 push 6 pop eax pop eax 1 11 6 5

5

Which truth table is this? 1 : 1 = 1 1 : 0 = 0 0:1 = 0 0:0 = 0

AND

Write a single instruction using 16-bit operands that clears the high 8 bits of AX and does not change the low 8 bits AND AX, 00FFh OR AX, 00FFh OR AX, 0FF00h AND AX, 0FF00h

AND AX, 00FFh

Which of the following are true after execute the following code? mov al, 00001111b test al, 00000010b ZF = 1 CF = 0 SF = 0

CF = 0 SF = 0

Which of the following is an instruction that decrements val2, which is a WORD. SUB val2, 1 DEC val2 DEC val2, 1 SUB val2

DEC val2

Which of the following registers are needed for input parameters when call ReadString procedure? ESP ECX EDX EBX

ECX EDX

In order to use Irvine32.inc library, which of the following is required? INCLUDING Irvine32.inc USING Irvine32.inc INCLUDE Irvine32.inc USE Irvine32.inc

INCLUDE Irvine32.inc

Which of the following follow the unsigned integer comparison? JNB JNGE JL JA

JNB JA

Which of the following pairs consists of equivalent two jump instructions? JNA and JL JNGE and JL JNAE and JB JNA and JBE

JNGE and JL JNAE and JB JNA and JBE

Which truth table is this? 1:1 = 1 1:0 = 1 0:1 = 1 0:0 = 0

OR

Which statement is true about what will happen when the example code runs? 1: main PROC 2: push 10 3: push 20 4: call myproc 5: pop eax 6: INVOKE ExitProcess, 0 7: main ENDP 8: MyProc PROC 9: pop eax 10: RET 11: MyProc ENDP The program will halt with a runtime error on line 10 The program will halt with a runtime error on line 9 EAX will equal 20 on line 6 EAX will equal 10 on line 6

The program will halt with a runtime error on line 10

A JMP instruction can only jump to a label inside the current procedure

True

A link library consists of assembly language object code.

True

Which of the following procedure from the linked library is used to write an unsigned integer to the console window in decimal form? Write RandomRange WaitMsg WriteDec

WriteDec

Which truth table is this? 1:1 = 0 1:0 = 1 0:1 = 1 0:0 = 0

XOR

If val2 is incremented by 1 using ADD instruction, what will be the values of the carry and sign flags? Assume: .data val2 WORD 8000h a. CF = 0, SF = 0 B. CF = 1, SF = 0 C. CF = 1, SF = 1 D. CF = 0, SF = 1

a

What will be the value in EDX after the sequence of instructions are executed? .data one WORD 8002h two WORD 4321h .code mov edx, 21348041h movsx edx, one ; a) EDX = movsx edx, two ; b) EDX = a) EDX = 00008002h b) EDX = FFFF4321h a) EDX = FFFF8002h b) EDX = FFFF4321h a) EDX = FFFF8002h b) EDX = 00004321h a) EDX = 00008002h b) EDX = 00004321h

a) EDX = 00008002h b) EDX = 00004321h

Use the following variable definition: .data var1 SWORD -16, -42, -38, -21 What will be the hexadecimal value of the destination operand after each of the following instruction execute in sequence? mov ax, var1 ; a. AX = mov ax, [var1+4] ; b. AX = a. AX = FFEFh b. AX = FFDFh a. AX = FFF0h b. AX = FFDAh a. AX = FFF1h b. AX = FFCAh Error

a. AX = FFF0h b. AX = FFDAh

In the following instruction sequence, show the resulting value of AL where indicated, in binary: mov al, 01101111b and al, 00101101b ; a. al = ? mov al, 6Dh and al, 4Ah ; b. al = ? a. al = 2Dh b. al = 48h a. al = 2Dh b. al = 84h a. al = D2h b. al = 48h a. al = D2h b. al = 84h

a. al = 2Dh b. al = 48h

Which of the following add 32 to ax? or ax, 00100000b add ax, 32 add ax, 20h and ax, 11011111b

add ax, 32 add ax, 20h

Given the following data definition: .data myBytes BYTE 10h, 20h, 30h, 40h Find the requested register values on the right side of the following instruction sequence: mov esi, OFFSET myBytes mov al, [esi] ; a. AL = mov al, [esi+3] ; b. AL = a. AL = 10h b. AL = 20h a. AL = 10h b. AL = 30h a. AL = 10h b. AL = 40h a. AL = 30h b. AL = 40h

al = 10h al = 40h

Which of the following instructions clear the Sign Flag? and al, 7Fh and ax, 7FFFh or al, 80h or ax, 8000h

and al, 7Fh and ax, 7FFFh


Related study sets

Human A & P II Lecture: Chapter 16

View Set

Chapter 7 - Axial and Appendicular

View Set

Matter and Energy on Earth - Bio

View Set

Solving Linear Systems by Substitution or Graphing

View Set

NOS 130 Lesson 4. Managing the Windows 10 Environment

View Set

MacMillian Questions Chapter 10, 12, and 14

View Set