Module - 8 Summary Exercises

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

Suppose that a program's data and executable code require 1,024 bytes of memory. A new section of code must be added; it will be used with various values 66 times during the execution of a program. When implemented as a macro, the macro code requires 60 bytes of memory. When implemented as a procedure, the procedure code requires 122 bytes (including parameter-passing, etc.), and each procedure call requires 10 bytes. How many bytes of memory will the entire program require if the new code is added as a procedure?

1806 1024 + 122 + (66*10)

Which of the following string primitives will copy a BYTE from the memory location pointed to by ESI to the memory location pointed to by EDI? MOVSB STOSB LODSB SCASB CMPSB

MOVSB

Suppose that a program's data and executable code require 1,024 bytes of memory. A new section of code must be added; it will be used with various values 27 times during the execution of a program. When implemented as a macro, the macro code requires 99 bytes of memory. When implemented as a procedure, the procedure code requires 148 bytes (including parameter-passing, etc.), and each procedure call requires 9 bytes. How many bytes of memory will the entire program require if the new code is added as a procedure?

1,415

Which of the following would be appropriate to scan through one string, stopping when a character in AL is successfully matched to a character in the string? Assume AL, ECX, ESI, and EDI have already been set appropriately (if necessary). - REPE CMPSB - REPNE SCASB - REPE SCASB - REPNE CMPSB

REPNE SCASB

If the string direction flag is not set, string operations will move backward through the string.

False

The REPNE prefix checks the value of the Zero flag but requires its operand-instruction (the instruction which follows it) to modify the flag.

True

Which structure is the following true for? _________ may have LOCAL labels. Macros Neither Macros Nor Procedures Procedures -Both Macros and Procedures

-Both Macros and Procedures

Which structure is the following true for? For _________, arguments are substituted exactly as entered, without checking for memory, registers, or literals. -Procedures -Macros -Neither Macros Nor Procedures -Both Macros and Procedures

-Macros

Which structure is the following true for? For _________, the entire code is substituted for each call. -Both Macros and Procedures -Neither Macros Nor Procedures -Procedures -Macros

-Macros

Which structure is the following true for? _________ are translated only once, and can be called many times. -Both Macros and Procedures -Neither Macros Nor Procedures -Macros -Procedures

-Procedures

Which structure is the following true for? _________ have a return mechanism involving the system stack. -Macros -Neither Macros Nor Procedures -Procedures -Both Macros and Procedures

-Procedures

Which structure is the following true for? _________ have a calling mechanism involving the EIP. -Both Macros and Procedures -Macros -Neither Macros Nor Procedures -Procedures

-Procedures

Suppose that a program's data and executable code require 1,024 bytes of memory. A new section of code must be added; it will be used with various values 52 times during the execution of a program. When implemented as a macro, the macro code requires 110 bytes of memory. When implemented as a procedure, the procedure code requires 129 bytes (including parameter-passing, etc.), and each procedure call requires 13 bytes. How many bytes of memory will the entire program require if the new code is added as a macro?

6,744 1024 bytes + (52*110)

Suppose that a program's data and executable code require 1,024 bytes of memory. A new section of code must be added; it will be used with various values 75 times during the execution of a program. When implemented as a macro, the macro code requires 117 bytes of memory. When implemented as a procedure, the procedure code requires 120 bytes (including parameter-passing, etc.), and each procedure call requires 13 bytes. How many bytes of memory will the entire program require if the new code is added as a macro?

9,799

The REP prefix checks the value of ECX but will not modify it.

False

The REP prefixes may be used with most instructions (MOV, CMP, ADD, etc...).

False

Which of the following string primitives will copy a BYTE from the memory location pointed to by ESI to the AL register? SCASB CMPSB STOSB LODSB MOVSB

LODSB

Which of the following string primitives will modify the ESI register? Check all that apply. STOSB LODSB CMPSB SCASB MOVSB

LODSB CMPSB MOVSB

Which of the following string primitives will modify the EDI register? Check all that apply. SCASB CMPSB MOVSB STOSB LODSB

SCASB CMPSB MOVSB STOSB

Match the instruction to its purpose. a. ) STD b.) CLD 1.) String primitives will increment ESI/EDI 2.) String primitives will decrement ESI/EDI

STD Set direction flag - String primitives will decrement ESI/EDI CLD Clear direction flag - String primitives will increment ESI/EDI


Kaugnay na mga set ng pag-aaral

Computer Science Principles: Self Check

View Set

Ch 3 - Job-Order Costing: Cost Flows and External Reporting

View Set

Xcel Solutions IN Life Insurance Final Exam

View Set

Chapter 8: Structuring Organizations for Today's Challenges

View Set

Principles of Management Test 2 quiz

View Set

AP Psychology Kohlberg/Erikson (Stages of Morality)

View Set

ECON 510 - Exam 3 (Final Exam) - Ch. 7

View Set