13.7 / KEY TERMS, REVIEW QUESTIONS, AND PROBLEMS 481 13.7 How many times does the processor need to refer to memory when it fetches and executes an indirect-address-mode instruction if the instruction is (a) a computation requiring a single operand; (b) a branch? 13.8 The IBM 370 does not provide indirect addressing. Assume that the address of an operand is in main memory. How would you access the operand? 13.9 In [COOK82], the author proposes that the PC-relative addressing modes be eliminated in favor of other modes, such as the use of a stack. What is the disadvantage of this proposal? 13.10 The x86 includes the following instruction: IMUL op1, op2, immediateThis instruction multiplies op2, which may be either register or memory, by the immediate operand value, and places the result in op1, which must be a register. There is no other three-operand instruction of this sort in the instruction set. What is the possible use of such an instruction? (Hint: Consider indexing.) 13.11 Consider a processor that includes a base with indexing addressing mode. Suppose an instruction is encountered that employs this addressing mode and specifies a displacement of 1970, in decimal. Currently the base and index register contain the decimal numbers 48,022 and 8, respectively. What is the address of the operand? 13.12 Define: EA = (X)+ is the effective address equal to the contents of location X, with X incremented by one word length after the effective address is calculated; EA = -(X) is the effective address equal to the contents of location X, with X decremented by one word length before the effective address is calculated; EA = (X)- is the effective address equal to the contents of location X, with X decremented by one word length after the effective address is calculated. Consider the following instructions, each in the format (Operation Source Operand, Destination Operand), with the result of the operation placed in the destination operand. a. OP X, (X) b. OP (X), (X)+ c. OP (X)+, (X) d. OP - (X), (X) e. OP - (X), (X)+ f. OP (X)+, (X)+ g. OP (X)-, (X) Using X as the stack pointer, which of these instructions can pop the top two elements from the stack, perform the designated operation (e.g., ADD source to destination and store in destination), and push the result back on the stack? For each such instruction, does the stack grow toward memory location 0 or in the opposite direction? 13.13 Assume a stack-oriented processor that includes the stack operations PUSH and POP. Arithmetic operations automatically involve the top one or two stack elements. Begin with an empty stack. What stack elements remain after the following instructions are executed? PUSH 4 PUSH 7 PUSH 8 ADD PUSH 10 SUB MUL 13.14 Justify the assertion that a 32-bit instruction is probably much less than twice as useful as a 16-bit instruction. 13.15 Why was IBM’s decision to move from 36 bits to 32 bits per word wrenching, and to whom?
đang được dịch, vui lòng đợi..