Test Bank For Assembly Language for x86 Processors, 8th edition Chapter 1-16
Chapter 1 (Basic Concepts) – Assessment To view the answers in Word 2010, select File | Options | Display, and select the Hidden Text checkbox.
True-False Please indicate whether each statement is True (T) or False (F). 1.
A program that combines object files into an executable program is called a linker.
2.
In any numbering system, the radix specifies the range of alphanumeric digits that can be assigned to a single digit position.
3.
The binary representation of decimal 42 is 00101010.
4.
The hexadecimal representation of decimal 35 is 33h
5.
The sum of the binary integers 01101101 and 00111011 is 10101001.
6.
The 8-bit two's complement of binary 00000010 is 11111110.
7.
The binary representation of decimal −42 is 11010111.
8.
Suppose there is a virtual machine containing levels V1 and V2, where V2 is above V1 in the machine hierarchy. The programs written in language V2 can be executed by a program running at level V1.
9.
The sum of all powers of 2 from 20 to 28 is 511.
10. A dynamic link library (DLL) is never written in the Java programming language. 11. A compiler decodes and executes one program statement at a time. 12. A virtual machine may be constructed from software. 13. The sum of 3AB4h and 0429h is 3EDDh. 14. To translate an unsigned decimal integer into binary, repeatedly divide the integer by 2, saving each remainder as a binary digit. 15. The expression X Y is false when X is false and Y is true.
Irvine, Kip R. Assembly Language for x86 Processors, 8th Edition
1
Chapter 2 (x86 Processor Architecture) – Assessment To view the answers in Word 2010, select File | Options | Display, and select the Hidden Text checkbox.
True-False Please indicate whether each statement is True (T) or False (F). 16. The control unit (CU) coordinates the sequencing of steps involved in executing machine instructions. 17. The arithmetic logic unit performs addition, subtraction, multiplication, and division operations. 18. Data travels along a bus with n bits running in parallel, where the bus is n bits wide. 19. Another name for machine cycle is clock cycle. 20. The upper half of the RDX register is called EDX. 21. The lower half of the RCX register is called EBX. 22. The Carry flag reflects the status of an usigned arithmetic operation. 23. The Zero flag is clear when the result of an arithmetic operation is zero. 24. The MMX register names are just different names for registers in the floating-point unit. 25. Requests from hardware devices are called interrrupts. 26. In Real-address mode, multiple programs can run at the same time, but they can only address physical memory. 27. When running in 64-bit mode, only the lowest 48 bits of address operands are used. 28. In 64-bit mode, you can use three more general-purpose registers than in 32-bit mode. 29. When running in native 64-bit mode, processors do not support 16-bit Real Mode. 30. The Basic Input-Output System is a collection of low-level subroutines that communicate directly with hardware devices.
Chapter 3 (Assembly Language Fundamentals) –Assessment To view the answers in Word 2010, select File | Options | Display, and select the Hidden Text checkbox.
True-False Please indicate whether each statement is True (T) or False (F). 31. A string literal must be enclosed in double quotes. 32. An identifier in assembly language may contain other characters besides letters and digits. 33. Identifiers are by default, case sensitive. 34. The PROC directive marks both the beginning and ending of a procedure. 35. A code name must end with a colon (:).
Irvine, Kip R. Assembly Language for x86 Processors, 8th Edition
2
36. The SDWORD directive is used when defining signed 32-bit integers. 37. The .DATA directive must always occur before the .CODE directive. 38. In the following statement, EAX is called the source operand: mov EBX,EAX 39. If the source code for an assembly language program is modified, you must run both the assembler and linker to update the program's executable code. 40. An object file is commonly read as input by the linker. 41. A listing file contains a copy of the program’s source code, with line numbers, the numeric address of each instruction, and a symbol table. Optionally, it may display the machine code bytes for the program. 42. The listing file is generated by the linker. 43. The following is a valid data definition statement: varX WORD 100h, 65536 44. The following is a valid data definition statement: helloStr SWORD -32768 45. The EQU directive permits a constant to be redefined at any point in a program.
Chapter 4 (Data Transfers, Addressing, and Arithmetic) – Assessment To view the answers in Word 2010, select File | Options | Display, and select the Hidden Text checkbox.
True-False Please indicate whether each statement is True (T) or False (F). 46. The following statement will assemble without errors: mov DWORD PTR [eax], 1234h 47. The following instruction will produce 1FFFFFFCh in EDX: movsx edx,-4 48. The SAHF instruction copies the CPU status flags to the AH register. 49. The following instructions will set the Overflow flag: mov al,0D7h add al,75h 50. The following instruction will assemble correctly: dec BYTE PTR [edi] 51. The following instructions will set the Overflow flag: mov al,80h sub al,-5 52. The format for the ADD instruction is: MOV source, destination 53. The SUB instruction requires the source operand to be no larger than the destination operand.
Irvine, Kip R. Assembly Language for x86 Processors, 8th Edition
3
54. The MOV instruction permits a move between two 8-bit memory operands, as long as one operand uses the BYTE PTR operator. 55. The EIP register can be the source operand of a MOV, ADD, or SUB instruction. 56. The MOVSX instruction can use a variable as the source operand. 57. If AL contains +127 and you add 3 to AL, the Overflow flag will be set. 58. Suppose BX and DX both contain positive integers. If adding them produces a negative result, the Overflow flag will be set. 59. The Overflow flag will never be set when subtracting a positive integer from a negative integer. 60. When you move a 16-bit constant or an 8-bit constant into a 64-bit register, the upper bits of the destination operand are cleared.
Chapter 5 (Procedures) –Assessment To view the answers in Word 2010, select File | Options | Display, and select the Hidden Text checkbox.
True-False Please indicate whether each statement is True (T) or False (F). 61. In a stack, the first value pushed on a stack is the last one to be removed. T 62. The runtime stack is supported by the computer’s processor. T 63. The runtime stack is the same as the stack abstract data type (ADT). F 64. The EBP register points to the last value pushed on the runtime stack.
F 65. The ESP register always points to the next available position (NAP) where a new value will be pushed on the stack.
F 66. When the POP instruction executes, the ESP register is incremented after the value it points to is copied from the stack. T 67. The PUSH instruction copies a value from the stack to an operand before decrementing the stack pointer. F 68. In 32-bit mode, immediate values pushed on the stack are always 32 bits long. T 69. The PUSHAD instruction pushes all the 32-bit general-purpose registers on the stack. T 70. By default, labels are visible only within the procedure in which they are declared. T 71. The RET instruction pops the value pointed to by EBP off the stack into the instruction pointer.. F
Irvine, Kip R. Assembly Language for x86 Processors, 8th Edition
4
72. A nested procedure call occurs when a called procedure calls another procedure before the first procedure returns T 73. The RandomRange procedure always produces a random integer between 0 and 0FFFFFFFFh F 74. The USES operator, coupled with the PROC directive, lets you list the names of all registers modified within a procedure.. T 75. The WriteHex procedure displays integers in hexadecimal format only if an additional formatting parameter is passed in the EDX register. F 76. The WriteDec procedure does not display a plus sign. T
Chapter 6 (Conditional Processing) – Assessment To view the answers in Word 2010, select File | Options | Display, and select the Hidden Text checkbox.
True-False Please indicate whether each statement is True (T) or False (F). 77. For any two integers n and m, ((n XOR m) XOR m) produces n. T 78. The destination operand of the OR instruction cannot be a memory operand. F 79. The TEST instruction always alters the destination operand. F 80. XORing an operand with 1 always causes the Zero flag to be set. F 81. The XOR instruction can be used to generate the two’s complement of an integer. F 82. ANDing an operand with 1 sets the zero flag if the operand was originally an even number. T 83. The Parity flag indicates whether the lowest byte of a destination operand has an even number of 1 bits. T 84. The XOR instruction inverts each bit in a destination operand. F 85. The JAE instruction jumps if the (unsigned) first operand is greater than or equal to the (unsigned) second operand. F 86. The JBE instruction is used when comparing unsigned integers. T
Irvine, Kip R. Assembly Language for x86 Processors, 8th Edition
5