sage icon indicating copy to clipboard operation
sage copied to clipboard

Change diagrams and table for new instructions

Open adam-mcdaniel opened this issue 1 year ago β€’ 0 comments

I changed the Inc and Dec operators to two new operators:

  1. Index
  2. Swap

Index looks at the tape, reads the value, and uses that as an index for a pointer stored in the register. The address of the cell at that index is stored in the register. For implementations that use tape indexes as pointers, like the interpreter, this operation is simply addition. For implementations where pointers do not increment by 1 (an implementation with real pointers), this is addition with a constant multiplier.

Swap simply swaps the value at the tape with the value in the register.

adam-mcdaniel avatar Aug 28 '22 15:08 adam-mcdaniel