全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Simulator?

Definition 21.2 High School Computer Science · 第 21 章 — Project: An Assembler and Simulator for the Toy Machine

A simulator is a program that imitates a machine: it keeps the machine’s state in its own variables and changes it, step by step, as the machine would.

Decoding the instruction at address 6 of sum_array.toy. The top six bits of the first byte are the operation code, the bottom two the register: LOADR R3, R1.
Decoding the instruction at address 66 of sum_array.toy. The top six bits of the first byte are the operation code, the bottom two the register: LOADR R3, R1.
The simulator’s loop. Each step fetches two bytes, adds 2 to PC, decodes and executes; it stops at HALT, or with an error that names the cause.
The simulator’s loop. Each step fetches two bytes, adds 22 to PC, decodes and executes; it stops at HALT, or with an error that names the cause.
在原文中阅读 →