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

Exercise 5.15 · 习题

Exercise 5.15: Add

instruction counting

to the register machine simulation. That is, have the machine model

keep track of the number of instructions executed. Extend the machine model’s

interface to accept a new message that prints the value of the instruction

count and resets the count to zero.

练习 5.15:向寄存器机器模拟添加指令计数功能,即让机器模型记录已执行的指令数。扩展机器模型的接口,使其接受一条新消息,用于打印指令计数值并将计数重置为零。