CSCI321 - Unit 2

Ace your homework & exams now with Quizwiz!

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

False

The PROC directive begins a procedure and the END directive ends a procedure. true false

False //ENDP ends the procedure

Which procedure in the link library generates a random integer within a selected range?

RandomRange

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

SF = 0 CF = 0

Which procedure in the link library displays "Press [Enter] to continue...and waits for the user to press the Enter key?

WaitMsg

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

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 if edx >= ecx X = 1 else X = 2 if edx > ecx X = 1 else X = 2 if edx < ecx X = 1 else X = 2

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 6B00h 006Bh none of these 6Bh

none of these

Which of the following statements converts an uppercase character in AL to lowercase but does not modify AL if it already contains a lowercase letter? sub al, 00100000b add al, 00100000b and al, 11011111b or al, 00100000b

or al, 00100000b

Which of the following instructions sets the high 8 bits of AX and does not change the low 8 bits? xor ax, 00FFh or, ax,0F0h or ax,0FF00h or ax,FF00h

or ax,0FF00h

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

popfd

Which of the following lists the three basic types of operands? register, immediate, memory indexed, register, immediate memory, immediate, indirect indirect, register, memory direct

register, immediate, memory

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, 2 mov [esp], eax sub [esp], 2 mov esp, eax sub [esp], 4 mov esp, eax sub esp, 4 mov [esp], eax

sub esp, 4 mov [esp], eax

The following code sequence contains a loop that is supposed to look for the first negative value in the array and leave ESI pointing to that value if the Zero flag is clear. One line is missing, shown by underline characters: .data array SWORD 3,5,14,-3,-6,-1,-10,10,30,40,4 sentinel SWORD 0 .code mov esi,OFFSET array mov ecx,LENGTHOF array next: __________________________ pushfd add esi,TYPE array popfd loopz next jz quit sub esi,TYPE array Which of the following code lines should be inserted in the program to complete this task? test WORD PTR [esi],8000h test WORD PTR [esi],0FFFFh or WORD PTR [esi],8000h xor WORD PTR [esi],8000h

test WORD PTR [esi],8000h

Which of the following instructions sets the Zero flag if the 32-bit value in EAX is even, and clears the Zero flag if EAX is odd? test eax, 2 test eax, 1 and eax, 3 or eax, 1

test eax, 1

The CALL instruction pushes which offset on the stack? the address of the instruction preceding the CALL the address of the current CALL the address of the next instruction following the CALL

the address of the next instruction following the CALL

Which of the following statements increments the integer inside val2? .data val1 BYTE 10h val2 WORD 8000h val3 DWORD 0FFFFh val4 WORD 7FFFh add val2, 2 add 2, val2 add [val2], 2 the first and third answer choices are correct

the first and third answer choices are correct

Which of the following answers gives the final value of EAX when the following code executes? mov eax,0 mov ecx,10 ; outer loop counter L1: mov eax,3 mov ecx,5 ; inner loop counter L2: add eax,5 loop L2 ; repeat inner loop loop L1 ; repeat outer loop 50h 1Ch 10h the loop will not stop, so the value of EAX cannot be determined

the loop will not stop, so the value of EAX cannot be determined

A PROTO directive must appear at the top of your programs for each 64-bit procedure you plan to call from the Irvine64 library. true false

true

According to the Microsoft x86 Calling Convention, the CALL instruction subtracts 8 from the RSP (stack pointer). true false

true

An operand notated as imm16 indicates that it must be a 16-bit immediate (constant) value. true false

true

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

true

If the RET instruction was omitted from a procedure, execution would fall through to the next address in memory following the procedure. true false

true

If val1 is incremented by 1 using the ADD instruction, CF = 0, and ZF = 0. (Abbreviations: CF = Carry flag, ZF = Zero flag, and OF = Overflow flag).  .data val1 BYTE 10h val2 WORD 8000h val3 DWORD 0FFFFh val4 WORD 7FFFh true false

true

If val2 is decremented by 1 using the SUB instruction, SF = 0 and OF = 1. .data val1 BYTE 10h val2 WORD 8000h val3 DWORD 0FFFFh val4 WORD 7FFFh true false

true

If val4 is incremented by 1 using the ADD instruction, SF = 1 and OF = 1. .data val1 BYTE 10h val2 WORD 8000h val3 DWORD 0FFFFh val4 WORD 7FFFh true false

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 false

true

In a finite-state machine diagram, each node represents a single state. true false

true

In a finite-state machine when no more input is available and the current state is a nonterminal state, the finite-state machine enters an error state. true false

true

In the signed integer finite-state machine of Figure 6-5, State C is reached when the input consists of "+5"? true false

true

Local variables in procedures are created on the stack. true false

true

Moving a constant value of 0FFh to the RAX register clears bits 8 through 63. true false

true

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

true

The LOOP instruction does the following: It decrements ECX; then, if ECX is not equal to zero, LOOP jumps to the destination label. false true

true

The PROTO directive is required when calling a procedure located in an external link library. true false

true

The PUSH instruction can have an immediate operand. true false

true

The SAHF instruction copies the contents of the AH register into the low-order byte of the EFLAGS (or RFLAGS) register. true false

true

The SIZEOF operator returns the number of bytes in an operand. true false

true

The TYPE operator returns a value of 4 for doubleword operands. true false

true

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

true

The destination label of a LOOPZ instruction must be no father than -128 or 127 bytes from the instruction immediately following LOOPZ. true false

true

The following code sequence causes a program to pause for 700 milliseconds. mov eax,700 call Delay true false

true

The following code will move the value 3 to EAX: .data array DWORD 1,2,3,4 .code mov esi, 8 mov eax, array[esi] true false

true

The following instruction clears the high 8 bits of AX and does not change the low 8 bits. and ax,00FFh true false

true

The following instruction is valid: add WORD PTR[esi+2], 20 true false

true

The following instruction sequence subtracts val1 from val2. mov ax,0 mov al,val1 sub val2,ax .data val1 BYTE 10h val2 WORD 8000h val3 DWORD 0FFFFh val4 WORD 7FFFh true false

true

The following instruction sequence subtracts val4 from val2. mov ax,val4 sub val2,ax .data val1 BYTE 10h val2 WORD 8000h val3 DWORD 0FFFFh val4 WORD 7FFFh true false

true

The runtime stack is the only type of stack that is managed directly by the CPU. For example, it holds the return addresses of called procedures. true false

true

The following code will jump to the label named Target: mov ax,0D4h cmp ax,26h ja Target true false

true (ja is for unsigned, so what you have to do is

Which of the following instructions reverses bits 0, 4, and 5 in AL without modifying any other bits? or al,110001b xor al,11001b xor al,110001b test al,11001b

xor al,110001b

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

xor eax, 0FFFFFFFFh not 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 12000378h 03005678h

00035678h

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

0A3h

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

10020000h

What value will RCX contain after executing the following instructions? Give your answer in hexadecimal, using only digits and capital letters: mov rcx,1234567800000000h add rcx,0ABABABABh

12345678ABABABAB

What value will RCX contain after executing the following instructions? Give your answer in hexadecimal, using only digits and capital letters: mov rcx,1234567800000000h sub ecx,1

12345678FFFFFFFF

Which of the following answers gives the final value of EAX when the following code executes? mov eax,0 mov ecx,10 L1: push ecx mov eax,3 mov ecx,5 L2: add eax,5 loop L2 pop ecx loop L1 1Ch 10h 50h

1Ch

What value will the AL register contain after executing the following instructions? Give your answer in hexadecimal, using only digits and capital letters: .data bArray BYTE 10h,20h,30h,40h,50h .code mov rdi,OFFSET bArray dec BYTE PTR [rdi+1] inc rdi mov al,[rdi]

1F

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

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 0010h 2010h 1020h

2010h

If ECX is initialized to zero before beginning a loop, how many times will the LOOP instruction repeat? (Assume ECX is not modified by any other instructions inside the loop.) 65,536 times cannot be determined 4,294,967,296 times 0 times

4,294,967,296 times

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

5

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, 0FF00h OR AX, 0FF00h AND AX, 00FFh OR AX, 00FFh

AND AX, 00FFh

In the signed integer finite-state machine of Figure 6-5, how many digits can occur after a minus sign? No digits No more than 1 digit No more than 2 digits An infinite number of digits

An infinite number of digits

If val2 is incremented by 1 using the ADD instruction, what will be the values of the Carry and Sign flags? Assume .data val2 WORD 8000h CF = 1, SF = 0 CF = 1, SF = 1 CF = 0, SF = 0 CF = 0, SF = 1

CF = 0, SF = 1

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

DEC val2

What value will the low 16 bits of RCX contain after executing the following instructions? Give your answer in hexadecimal, using only digits and capital letters: mov rcx,0DFFFh mov bx,3 add cx,bx

E002

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

ECX EDX

What are the required input parameters for the ReadString procedure? ESI contains the offset of an array of bytes, and EBX contains the maximum number of characters to read. ESI contains the offset of an array of bytes, and ECX contains the maximum number of characters to read. EDX contains the offset of an array of bytes, and ECX contains the maximum number of characters to read.

EDX contains the offset of an array of bytes, and ECX contains the maximum number of characters to read.

In 32-bit mode, which register points to the most recent value pushed onto the stack? EBP ESP SP BP

ESP

When a 32-bit value is pushed on the stack, what happens to ESP? ESP is incremented by 1 ESP is decremented by 1 ESP is incremented by 4 ESP is decremented by 4

ESP is decremented by 4

In a finite-state machine diagram, what do the edges represent? Each edge is a transition from one state to another, caused by some input. Each edge is a state, and the nodes are transitions Both nodes and edges can be transitions, as long as they are labeled correctly.

Each edge is a transition from one state to another, caused by some input.

Which procedure from the link library places the cursor at a specific console window location?

GotoXY

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

INCLUDE Irvine32.inc

Write the INCLUDE directive that is required when using the Irvine32 library.

INCLUDE Irvine32.inc

Which of the following is 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 JMP is a conditional transfer intruction A JMP instruction can only jump to a label inside the current procedure If ECX is initialized to zero before beginning a loop, then the loop will not be executed any time.

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 A JMP instruction can only jump to a label inside the current procedure

Which of the following are true? In 32-bit mode, the LOOPNZ instruction jumps to a label when ECX is greater than zero and the Zero flag is clear When ZF have value 1, it means ZF is clear. The destination label of a LOOPZ instruction must be no farther than -128 or +127 bytes from the instruction immediately following LOOPZ The LOOPE instruction jumps to label when (and only when) the Zero Flag is clear

In 32-bit mode, the LOOPNZ instruction jumps to a label when ECX is greater than zero and the Zero flag is clear The destination label of a LOOPZ instruction must be no farther than -128 or +127 bytes from the instruction immediately following LOOPZ

Which of the following are true In real-address mode, CX is used as the counter by the LOOP instruction The target of a LOOP instruction must be within 256 bytes of the current location In real-address mode, the ECX register is used as the counter by the LOOPD instruction The loop instruction first checks to see whether ECX is not equal to zero; then LOOP decrements ECX and jumps to the destination label

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

Which of the following are true? It is possible that Zero flag and Sign flag to be set at the same time It is possible to set the overflow flag when you do NEG instruction It is possible to set the overflow flag if you add a negative integer to a negative integer. It is possible to set the overflow flag if you add a positive integer to a negative integer.

It is possible to set the overflow flag when you do NEG instruction It is possible to set the overflow flag if you add a negative integer to a negative integer.

Which list contains jump instructions that only apply to unsigned integer comparisons? JA, JB, JAE, JBE JE, JNE, JG, JL JG, JL, JLE, JGE none of the other answers are correct

JA, JB, JAE, JBE

Which unsigned conditional jump instruction is equivalent to JNAE?

JB

Which unsigned conditional jump instruction is equivalent to the JNA instruction?

JBE

Which list contains jumps instructions that only apply to signed integer comparisons? JA, JB, JAE, JBE none of the other answers are correct JG, JL, JLE, JGE JE, JNE, JG, JL

JG, JL, JLE, JGE

Which signed conditional jump instruction is equivalent to the JNGE instruction?

JL

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

JNB JA

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

JNGE and JL JNA and JBE JNAE and JB

Which of the following are true? Local variables in procedures are created on the stack Stack is called a LIFO data structure The PUSH instruction cannot have an immediate operand The running time stack holds the return address of called procedures In 32-bit mode, the register ESI register manages the stack.

Local variables in procedures are created on the stack Stack is called a LIFO data structure The running time stack holds the return address of called procedures

What types of statements are inside the Irvine32.inc file? compiled object code in a library format assembly language instructions, such as MOV and ADD PROTO statements (procedure prototypes) and constant definitions

PROTO statements (procedure prototypes) and constant definitions

Which of the code sequences correctly implements the following pseudocode in assembly language, assuming the values in the registers are unsigned? (val1 and X are 32-bit variables.) if edx <= ecx X = 1 else X = 2 Sequence: cmp edx,ecx jnbe L1 mov X,1 jmp next L1: mov X,2 next: Sequence: cmp edx,ecx jna L1 mov X,1 jbe next L1: mov X,2 next: Sequence: cmp edx,ecx jnae L1 mov X,1 jb next L1: mov X,2 next:

Sequence: cmp edx,ecx jnbe L1 mov X,1 jmp next L1: mov X,2 next:

Which of the code sequences correctly implements the following pseudocode in assembly language, assuming the values in the registers are unsigned? (val1 and X are 32-bit variables.) if ebx > ecx X = 1 Sequence: cmp ebx,ecx ja next mov X,1 next: Sequence: cmp ebx,ecx jae next mov X,1 next: Sequence: cmp ebx,ecx jna next mov X,1 next:

Sequence: cmp ebx,ecx jna next mov X,1 next:

Which of the following are true? The Call instruction pushes the offset of the instruction following the Call on the stack If the RET instruction is omitted from a procedure, the code will not be assembled The PROC directive begins a procedure and the ENDP directive ends a procedure It is not possible to define a procedure inside an existing procedure

The Call instruction pushes the offset of the instruction following the Call on the stack The PROC directive begins a procedure and the ENDP directive ends a procedure It is not possible to define a procedure inside an existing procedure

Which of the followng are true? The EIP register cannot be the destination operand of a MOV instruction In the operand notation used by Intel, imm16 indicates a 16-bit constant operand In a MOV instruction, the second operand is known as the destination operand The destination operand of a MOV instruction cannot be a segment register In the operand notation used by Intel, reg/mem32 indicate a 32-bit register or memory operand Three basic types of operands are: Register, Immediate, and Memory

The EIP register cannot be the destination operand of a MOV instruction In the operand notation used by Intel, imm16 indicates a 16-bit constant operand In the operand notation used by Intel, reg/mem32 indicate a 32-bit register or memory operand Three basic types of operands are: Register, Immediate, and Memory

Which of the following are true? The ESI and EDI registers cannot be used when passing 32-bit parameters to procedures The RET instruction pops the tip of the stack into the instruction pointer In protected mode, each procedure call uses a minimum of 4 bytes of stack space Nested procedure calls are not permitted by the Microsoft assebler unless the NESTED operator is used in the procedure definition

The RET instruction pops the tip of the stack into the instruction pointer In protected mode, each procedure call uses a minimum of 4 bytes of stack space

Which of the following are true The SIZEOF operator returns the number of bytes in an operand The PTR operator returns the 32-bit address of a variable The OFFSET operator always returns a 16-bit value The LENGTHOF operator returns the number of bytes in an operand The TYPE operator returns a value of 4 for doubleword operands

The SIZEOF operator returns the number of bytes in an operand The TYPE operator returns a value of 4 for doubleword operands

Which of the following are true? The USES operator lets you name all register that are modified within a procedure The USES operator only generates push instructions, so you must code pop instruction yourself The registers listed in the USES directive must use commas to separate the register names 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)

The USES operator lets you name all register that are modified within a procedure 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)

Which of the following are true? The following is an indexed operand: array[esi[ Any 32-bit general-purpose register can be used as an indirect operand. The following instruction is invalid: inc [esi] The EBX register is usually reserved for addressing the stack

The following is an indexed operand: array[esi[ Any 32-bit general-purpose register can be used as an indirect operand. The following instruction is invalid: inc [esi]

The stack is called a LIFO structure because: The last value you popped from the stack matches the first value you pushed on the stack. The last value popped from the stack matches the value that was most recently pushed on the stack.

The last value popped from the stack matches the value that was most recently pushed on the stack.

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 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

The program will halt with a runtime error on line 10

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

WriteDec

Which procedure from the link library writes an unsigned integer to the console window in decimal format?

WriteDec

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 = FFFF8002h b) EDX = 00004321h a) EDX = FFFF8002h b) EDX = FFFF4321h a) EDX = 00008002h b) EDX = FFFF4321h a) EDX = 00008002h b) EDX = 00004321h

a) EDX = FFFF8002h b) EDX = 00004321h

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 = 40h a. AL = 10h b. AL = 30h a. AL = 10h b. AL = 20h a. AL = 30h b. AL = 40h

a. AL = 10h b. AL = 40h

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 = Error a. AX = FFF0h b. AX = FFDAh a. AX = FFF1h b. AX = FFCAh a. AX = FFEFh b. AX = FFDFh

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? add ax, 20h or ax, 00100000b add ax, 32 and ax, 11011111b

add ax, 20h add ax, 32

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

and ax, 7FFFh and al, 7Fh

The linker utility combines a program's source code file with one or more object files and link libraries. true false

false //the linker utility combines a program's OBJECT code file with...

According to the Microsoft x86 Calling Convention, the first four parameters passed to a procedure are placed in the RCX, RDX, RAX, and RBX, registers, in that order. true false

false //they are placed in RCX, RDX, R8, then finally R9

Which of the following are true? Write a Call statement that calls a procedure name MyProc in an external link library: MyProc Call dll file extension stands for Dynamic Link Library A link library consists of assembly language object code. Use the PROTO directive to declare a procedure named MyProc in an external link library: MyProc PROTO

dll file extension stands for Dynamic Link Library A link library consists of assembly language object code. Use the PROTO directive to declare a procedure named MyProc in an external link library: MyProc PROTO

What type of file is kernel32.dll? executable program static library dynamic link library

dynamic link library

A 32-bit constant may be moved to a 64-bit register, but 64-bit constants are not permitted. true false

false

A finite-state machine is a specific application of a tree data structure. true false

false

An operand notated as reg/mem32 indicates that it must be either a register of any size, or a 32-bit memory operand. true false

false

If val2 is incremented by 1 using the ADD instruction, CF = 1, and ZF = 0. .data val1 BYTE 10h val2 WORD 8000h val3 DWORD 0FFFFh val4 WORD 7FFFh true false

false

If val3 is incremented by 1 using the ADD instruction, CF = 1, and ZF = 0. .data val1 BYTE 10h val2 WORD 8000h val3 DWORD 0FFFFh val4 WORD 7FFFh true false

false

In a MOV instruction, the second operand is known as the destination operand. true false

false

It is possible to define a procedure inside an existing procedure. true false

false

JMP is a coditional transfer instruction. false true

false

The EBX register is usually reserved for addressing the stack. true false

false

The LAHF instruction copies the contents of the AH register into the high-order byte of the EFLAGS (or RFLAGS) register. true false

false

The LENGTHOF operator returns the number of bytes in an operand. true false

false

The LOOP instruction first checks to see whether ECX is not equal to zero. Next, LOOP decrements ECX and jumps to the destination label. true false

false

The LOOPE instruction jumps to a label only when the Zero flag is clear. true false

false

The Microsoft x86 Calling Convention must be followed whenever you call 64-bit procedures, even when you call the routines in the Irvine64 library. true false

false

The Microsoft x86 Calling Convention specified that it is the caller's responsibility to allocate at least 16 bytes of shadow space on the runtime stack so the called procedures can optionally save the register parameters in this area. true false

false

The OFFSET operator always returns a 16-bit value. true false

false

The PTR operator returns the 32-bit address of a variable. true false

false

The USES operator tells the assembler to generate PUSH instructions that save the registers on the stack at the beginning of the procedure. You are, however, responsible for adding a POPAD instruction at the end of the procedure to restore the registers to their original values. true false

false

The XCHG instruction can exchange the values of two memory operands. true false

false

The following code will move the value 2 to EAX: .data array DWORD 1,2,3,4 .code mov esi,0 mov eax, array[esi*2] true false

false

The following instruction always reverses all the bits in EAX. not eax,0FFFFFFFFh true false

false

The following instruction is valid: inc [esi] true false

false

The following instruction subtracts val1 from val2. sub val2,val1 .data val1 BYTE 10h val2 WORD 8000h val3 DWORD 0FFFFh val4 WORD 7FFFh true false

false

The following instruction subtracts val4 from val2. sub [val2],[val4] .data val1 BYTE 10h val2 WORD 8000h val3 DWORD 0FFFFh val4 WORD 7FFFh true false

false

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

false

The following code will jump to the label named Target: mov ax,8109h cmp ax,26h jg Target true false

false (8109 is negative)

The following code excerpt contains statements that prompt the user for an identification number and store the user's input in an array of bytes. .data str1 BYTE "Enter identification number: ",0 idStr BYTE 15 DUP(?) .code mov ebx,OFFSET str1 call WriteString mov eax,OFFSET idStr mov ecx,(SIZEOF idStr) - 1 call ReadString true false

false //Writestring uses edx, not ebx

A link library consists of assembly language source code. true false

false //it is machine code


Related study sets

REGLAS Y REGULACIOES DEL HOGAR CUIDADO DE NINOS INFANTIL Y FAMILIAR (HOME)

View Set

FBLA Computer Problem Solving (TYPES OF PRINTERS)

View Set

Module 4: Oral and Topical Medications

View Set

renaissance to modern art final exam

View Set

Alabama Water Treatment Operator 1000 Questions (Not Really)

View Set

Chapter 14; Glycolysis and Gluconeogenesis

View Set

Intro to Computers and Office Applications Module 5

View Set

Chapter 5 - Strategies in Action

View Set

Exam 2 Prep Questions from Virtual Clinical

View Set