Simulator - kvakil/venus GitHub Wiki
The Simulator is the main component of venus.
Simulator Controls
The following controls are available:
- Run / Stop: runs the program until it terminates or a breakpoint is hit. While running, the program can be stopped by clicking it again.
- Step: executes the highlighted instruction.
- Prev: undo the previously executed instruction.
- Reset: resets the simulator to its initial state (equivalent to reassembling the program).
Program View
The program view displays the assembled program. It contains three columns:
- Machine Code: the machine code of the instruction in hexadecimal.
- Basic Code: the assembly code after pseudoinstruction expansion and linking.
- Original Code: the original code in the program.
Debugging
The instruction which is about to be executed is highlighted in green.
In order to add a breakpoint, simply click on the instruction. This will cause the row to be highlighted red, indicating that a breakpoint has been set. To remove the breakpoint, click it again.
Sidebar View
Registers
The register tab displays the values of the current registers. The most recently changed register is highlighted in blue. In addition, the registers values can be edited.
Memory
The memory tab shows the bytes currently in memory.
Memory Controls
The Jump to select box allows jumping to a memory segment.
The Up / Down buttons scroll the memory view. Up moves towards higher addresses, and down moves towards lower addresses.
Display Settings
The display settings can be used to change how values are displayed. By default, values are displayed in unsigned hexadecimal.
- Hex (default) - display as unsigned hexadecimal.
- Decimal - display as signed decimal.
- Unsigned - display as unsigned decimal.
- ASCII - display as ASCII character, surrounded by single quotes.
- If the number is too big (not between 0 and 255), it is displayed as hex instead.
- Anything which is in ASCII but not printable is displayed as the unicode replacement glyph: �
Console Output
The console output is used for ecalls and displaying any errors which occur.