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 (
return values are:
|0||MIX_ERROR||Loading or execution error|
|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-reg evaluates to a number which is the contents of the
mix-set-reg sets 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).
mix-over evaluates to
#t if the overflow toggle is set,
#f otherwise. The value of the overflow toggle can be
Evaluate and set the comparison flag. Possible values are the scheme
E (equal) and
Evaluates to the current virtual machine uptime.
Evaluates to the current virtual machine lapsed time, i.e., the time
elapsed since the last
Evaluates to the total time spent executing the currently loaded program.
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-no evaluates to the current source file number
during the execution of a program.
mix-src-line evaluates to a
string containing the source file line number lineno; when
invoked without argument, it evaluates to
Evaluates to a string containing the full path of the current device directory.