Help for Rosetta
NOTE: Open, Save and Save As are only available on browsers that support those functions for applets! |
|
Basic Controls
Rosetta is a code parser and generator which allows you to enter high level code, break it down into it's parse tree, and then translate it to assembly code. The generation of the parse tree and assembly code is animated for you. There are four directions of operation, indicated by the icons at the bottom left corner of the screen. These are, in order, Reset (double left arrow), Stop (square button), Play (single right arrow), and Next Step (double right arrow). Play will generate the whole parse tree or set of assembly code, Next Step will step you through the animation one stage at a time, Stop will stop the animation in progress, and Reset will return you to your start state. |
|
Modes of Operation
Howard Stone has two modes. In Parsing mode, you will generate a parse tree, breaking your code into it's tokens of understandable information. In Code Generation mode, you will generate assembly code by collapsing the parse tree line by line and interpreting the necessary instructions. You can switch between these modes using the switch in the bottom center of the screen. |
|
Using the Stone
To enter an equation, place your cursor in the box at the top left of the screen. To set the equation for parsing, click the "Set Equation" button. There is a limited set of variable names and operators accepted by Howard Stone. These are:
- Variables: W, X, Y, Z (case insensitive - upper and lower case translate the same).
- Numbers: any integer between -126 and 126.
- Operators: + (addition), - (subtraction or negation), * (multiplication), / (division), = (assignment). Parentheses are also allowed.
|
|
Once an equation is entered, you can click Play to see the complete parse tree in Parsing mode, or generate the complete assembly code translation in Code Generation mode. You can also click the next step button to step through these processes one step at a time.
PIPPIN Language
The simulator understands 14 instructions:
| Binary | Opcode | Meaning |
| Data Flow |
| 00010100 | LOD X (or #X) | Load from Memory location X (or number X) to the accumulator |
| 00000100 | STO Y | Store contents of
accumulator in Memory location Y |
| Control |
| 00001100 | JMP P | Jump to instruction P |
| 00001101 | JMZ P | If Acc = 0, go to instruction number P, otherwise, go to next
instruction. |
| 00001110 | NOP | No operation, but go to next
instruction. |
| 00001111 | HLT | Halt execution, do nothing more. |
| Arithmetic-logic |
| 00000000 | ADD X (or #X) | Add contents of memory location X (or #X) to Acc. |
| 00000001 | SUB X (or #X) | Subtract contents of memory location X (or #X) to Acc. |
| 00000010 | MUL X (or #X) | Multiply Acc. by contents of memory location X (or #X) |
| 00000011 | DIV X (or #X) | Divide Acc. by contents of memory location X (or #X) |
| 00001000 | AND X (or #X) | If contents of Acc. and memory location X (or number X) are both
0, put 1 into Acc., otherwise put 0 into Acc. |
| 00001001 | NOT | If Acc. contains 0, set Acc. to 1, otherwise set to 0. |
| 00001010 | CPZ X (Compare zero) | If X = 0, set Acc. to 1, otherwise set A to 0.
|
| 00001011 | CPL X (Compare less) | If X < 0, set Acc. to 1, otherwise set Acc. to 0. |
|
|
Copyright Notice
© 2003
PWS Publishing Company,
All Rights Reserved.