内容 5.2 A Register-Machine Simulator · 428
练习 自检推理
Exercise 5.18: Modify the make-register
procedure of 5.2.1 so that registers can be traced. Registers
should accept messages that turn tracing on and off. When a register is
traced, assigning a value to the register should print the name of the
register, the old contents of the register, and the new contents being
assigned. Extend the interface to the machine model to permit you to turn
tracing on and off for designated machine registers.
练习 5.18:修改 5.2.1 节的 make-register 过程,使寄存器可以被追踪。寄存器应接受开启和关闭追踪的消息。当寄存器处于追踪状态时,向该寄存器赋值时应打印寄存器名、寄存器原有内容以及即将赋入的新内容。扩展机器模型的接口,使其能够为指定的机器寄存器开启和关闭追踪。
我的笔记 自动保存