-
Notifications
You must be signed in to change notification settings - Fork 18
Register Machine Code Format
muserr edited this page Mar 17, 2020
·
4 revisions
<Here goes a description of the register machine code format, similar to Section 5.1.5 of SICP JS>
Based on SICP Instruction Summary 5.1.5:
This section is still work in progress.
Assigning a value from register 'register-name-from' to 'register-name-to':
assign(register-name-to, reg(register-name-from))
For example, if you assign contents from register D to register C:
assign("C", reg("D"))
Assigns a constant value to 'register-name'. Constant value is predefined.
assign(register-name, constant(constant-value))
During the treatment of a self-evaluating expression, we can also treat the expression as a constant value. Examples include:
Assignment of numeric values:
assign("A", constant(100))
Assignment of booleans:
assign("B", constant(true))
assign("C", constant(false))
- "register-name" seen in round brackets are just the actual register names in strings.