Inspection and modification of the virtual machine state (memory, registers, overflow toggle and comparison flag contents) is accomplished using the following commands:
pstat | state command |
This commands prints the current virtual machine state, which can be one
of the following:
|
pc | state command |
Prints the current value of the program counter, which stores the address of the next instruction to be executed in a non-halted program. |
sreg A | X | J | I[1-6] value | state command |
preg [A | X | J | I[1-6]] | state command |
pall | state command |
preg prints the contents of a given MIX register. For instance,
preg A will print the contents of the A-register. When
invoked without arguments, all registers shall be printed:
MIX > preg rA: - 00 00 00 00 35 (0000000035) rX: + 00 00 00 15 40 (0000001000) rJ: + 00 00 (0000) rI1: + 00 00 (0000) rI2: + 00 00 (0000) rI3: + 00 00 (0000) rI4: + 00 00 (0000) rI5: + 00 00 (0000) rI6: + 00 00 (0000) MIX > As you can see in the above sample, the contents is printed as the sign plus the values of the MIX bytes stored in the register and, between parenthesis, the decimal representation of its module.
Finally, MIX > sreg I1 1000 MIX > preg I1 rI1: + 15 40 (1000) MIX > sreg I1 1000000 MIX > preg I1 rI1: + 09 00 (0576) MIX > |
pflags | state command |
scmp E | G | L | state command |
sover F | T | state command |
pflags prints the value of the comparison flag and overflow
toggle of the virtual machine, e.g.
MIX > pflags Overflow: F Cmp: E MIX > The values of the overflow toggle are either F (false) or T
(true), and, for the comparison flag, E, G, L (equal,
greater, lesser). |
pmem from[-to] | state command |
smem address value | state command |
pmem prints the contents of memory cells in the address range
[FROM-TO]. If the upper limit to is omitted, only
the contents of the memory cell with address FROM is printed, as
in
MIX > pmem 3000 3000: + 46 58 00 19 37 (0786957541) MIX > The memory contents is displayed both as the set of five MIX bytes plus sign composing the stored MIX word and, between parenthesis, the decimal representation of the module of the stored value.
|