灯下 登录
计算机科学 / SICP / 5.2.4 Monitoring Machine Performance

Exercise 5.16 · 习题

Exercise 5.16: Augment the simulator to provide

for

instruction tracing. That is, before each instruction is

executed, the simulator should print the text of the instruction. Make the

machine model accept trace-on and trace-off messages to turn

tracing on and off.

练习 5.16:扩展模拟器,提供指令追踪功能,即在每条指令执行之前,让模拟器打印该指令的文本。使机器模型接受 trace-on 和 trace-off 消息,以开启和关闭追踪。