Inspection and modification of the virtual machine state (memory, registers, overflow toggle and comparison flag contents) is accomplished using the following commands:
This commands prints the current virtual machine state, which can be one of the following:
Prints the current value of the program counter, which stores the address of the next instruction to be executed in a non-halted program.
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.
pall prints the contents of all registers plus the comparison
flag and overflow toggle.
sreg Sets the contents of the given register to
value, expressed as a decimal constant. If value exceeds the
maximum value storable in the given register,
MAXIMU_VALUE is stored, e.g.
MIX > sreg I1 1000 MIX > preg I1 rI1: + 15 40 (1000) MIX > sreg I1 1000000 MIX > preg I1 rI1: + 09 00 (0576) MIX >
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,
sover are setters of the
comparison flag and overflow toggle values.
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
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.
smem sets the content of the memory cell with address
address to value, expressed as a decimal constant.