Assembly Language for x86 Processors --- 5.5 After-Class Exercises Answers

5.5 Defining and Using Procedures

1 The RET instruction pops the top of the stack into the instruction pointer.

Answer: √

2 The USES operator lets you name all registers that are modified within a procedure.

Answer: √

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

Answer: √

4 The CALL instruction pushes the offset of the instruction following the CALL on the stack.

Answer: √

5 The ESI and EDI registers cannot be used when passing parameters to procedures.

Answer: ×

6 The register list in the USES directive must use commas to separate the register names.

Answer: ×

7 The USES operator only generates PUSH instructions, so you must code POP instructions yourself.

Answer: ×

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

Answer: √

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

Answer: ×

10 It is possible to define a procedure inside an existing procedure.

Answer: ×

11 The CALL instruction pushes the offset of the CALL instruction on the stack.

Answer: ×

12 What would happen if the RET instruction was omitted from a procedure?

答 :Execution would continue beyond the end of the procedure, possibly into the beginning of another procedure. This type of programming bug is often dificult to detect!

Guess you like

Origin blog.csdn.net/weixin_43574277/article/details/106131843