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

Exercise 5.17 · 习题

Exercise 5.17: Extend the instruction tracing of

Exercise 5.16 so that before printing an instruction, the simulator

prints any labels that immediately precede that instruction in the controller

sequence. Be careful to do this in a way that does not interfere with

instruction counting (Exercise 5.15). You will have to make the

simulator retain the necessary label information.

练习 5.17:扩展练习 5.16 的指令追踪功能:在打印一条指令之前,先打印控制器序列中紧接在该指令之前的所有标号。注意实现方式不应干扰指令计数(练习 5.15)。你需要让模拟器保留必要的标号信息。