When writing non-trivial Scheme extensions using the MIX/Scheme library,
you will probably need to evaluate the contents of the virtual machine
components (registers, memory cells and so on). For instance, you may
need to store the contents of the
A register in a variable. The
Scheme functions described so far are of no help: you can print the
(mix-preg 'A), but you cannot define a
variable containing the contents of
A. To address this kind of
problems, the MIX/Scheme library provides the following additional
Return the current status of the virtual machine, as a number (
mixvm-status) or as a symbol (
mix-vm-status). Posible return values are:
0 MIX_ERROR Loading or execution error 1 MIX_BREAK Breakpoint encountered 2 MIX_COND_BREAK Conditional breakpoint 3 MIX_HALTED Execution terminated 4 MIX_RUNNING Execution stopped after
5 MIX_LOADED Program successfully loaded 6 MIX_EMPTY No program loaded
Predicates asking whether the current virtual machine status is
mix-regevaluates to a number which is the contents of the specified register.
mix-set-regsets the contents of the given register to value. The register can be specified either as a string (
"X", etc.) or as a symbol (
'X, etc.). For instance,guile> (mix-reg 'A) 2341 guile> (mix-set-reg! "A" 2000) ok guile> (define reg-a (mix-reg 'A)) guile> (display reg-a) 2000 guile>
Evaluate and set the contents of the memory cell number cell_no. Both cell_no and value are Scheme numbers.
Evaluates to the value of the location counter (i.e., the address of the next instruction to be executed).
#tif the overflow toggle is set, and to
#fotherwise. The value of the overflow toggle can be modified using
Evaluate and set the comparison flag. Possible values are the scheme symbols
Evaluates to the current virtual machine lapsed time, i.e., the time elapsed since the last
Evaluates to a string containing the basename (without any leading path) of the currently loaded MIX program.
Evaluates to a string containing the full path to the currently loaded MIX program.
Evaluates to a string containing the full path to the source file of the currently loaded MIX program.
mix-src-line-noevaluates to the current source file number during the execution of a program.
mix-src-lineevaluates to a string containing the source file line number lineno; when invoked without argument, it evaluates to