summaryrefslogtreecommitdiffhomepage
path: root/doc/mdk_gmixvm.texi
blob: 81ced1d4f080251552c5f77f7dc23d5efdda52bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
@node gmixvm, mixasm, mixvm, Top
@comment  node-name,  next,  previous,  up
@chapter gmixvm
@cindex @code{gmixvm}
@cindex GUI
@cindex GTK+

@menu
* Invoking @code{gmixvm}::      Invoking the GTK+ interface.
* MIXVM console::               Using @code{mixvm} commands.
* MIX virtual machine::         The MIX virtual machine window.
* MIXAL source view::           Viewing the MIXAL source code.
* MIX devices view::            Device output.
* Menu and status bars::        Available menu commands.
@end menu

@node Invoking @code{gmixvm}, MIXVM console, gmixvm, gmixvm
@comment  node-name,  next,  previous,  up
@section Invoking @code{gmixvm}

If you have built @sc{mdk} with GTK+ support (@pxref{Installing MDK}), a
graphical front-end for the MIX virtual machine will be available in
your system. You can invoke it by typing

@example
gmixvm @kbd{RET}
@end example

@noindent
at your command prompt. The @code{gmixvm} main window will appear,
offering you a graphical interface to run and debug your MIX programs.

@image{img/ss_mix}

Apart from the menu and status bars, we can distinguish two zones (or
halves) in this main window. In the upper half of @code{gmixvm}'s main
window there is a notebook with three pages, namely,

@itemize
@item
a MIX virtual machine view, which shows you the registers, flags, memory
contents and time statistics of the virtual machine;
@item
a MIXAL source view, which shows the MIXAL file and lets you manage
breakpoints;
@item
a Devices view, which shows you the output to character based MIX block
devices.
@end itemize

@noindent
On the other hand, the main window's lower half presents you a
@code{mixvm} command prompt and a logging area where results of the
issued commands are presented. These widgets implement a @code{mixvm}
console which offers almost the same functionality as its @acronym{CLI}
counterpart. 

The following sections describe the above mentioned components of
@code{gmixvm}. 

@node MIXVM console, MIX virtual machine, Invoking @code{gmixvm}, gmixvm
@comment  node-name,  next,  previous,  up
@section MIXVM console

In the lower half of the @code{gmixvm} main window, you will find a
command text entry and, above it, an echo area. These widgets offer you
the same functionality as its @acronym{CLI} counterpart, @code{mixvm}
(@pxref{mixvm}). You can issue almost all @code{mixmv} commands at the
@code{gmixvm}'s command prompt in order to manipulate the MIX virtual
machine. Please, refer to @xref{mixvm}, for a description of these
commands, and to @xref{Getting started}, for a tutorial on using the MIX
virtual machine.

@node MIX virtual machine, MIXAL source view, MIXVM console, gmixvm
@comment  node-name,  next,  previous,  up
@section MIX virtual machine

The first notebook's page displays the current status of the virtual
machine. There you can find the registers' contents, the value of the
comparison and overflow flags, the location pointer, a list with all MIX
memory cells and their contents, and the time statistics (including
total uptime, elapsed time since the last run command and total
execution time for the currently loaded MIX program).

Clicking any register entry, you will be prompted for a new register's
contents.

@ifnotinfo
The next figure shows the enter word dialog.
@image{img/ss_worddlg, 400pt}
@end ifnotinfo

In the same manner, click on any address of the memory cells list to be
prompted for the new contents of the clicked cell. If you click the
address column's title, a dialog asking you for a memory address will
appear; if you introduce a valid address, this will be the first cell
displayed in the scrollable list after you click the OK button.

The register contents are shown as a list of MIX bytes plus sign. If you
place the mouse pointer over any of them, the decimal value of this MIX
word will appear inside a tooltip.

@node MIXAL source view, MIX devices view, MIX virtual machine, gmixvm
@comment  node-name,  next,  previous,  up
@section MIXAL source view

The second notebook's page, dubbed MIXAL, shows you the MIXAL source of
the currently loaded MIX file. A shown in the next figure, the
information is presented in two columns.

@image{img/ss_mixal, 400pt}

The first column shows the address and memory contents of the compiled
MIX instruction, while the second one displays its corresponding MIXAL
representation, together with the source file line number. The current
location of the location counter is highlighted in grey, while any set
breakpoint is marked in red. You can set/unset breakpoints by clicking
on any line in this view which has an associated memory address.

@node MIX devices view, Menu and status bars, MIXAL source view, gmixvm
@comment  node-name,  next,  previous,  up
@section MIX devices view

The last notebook page, dubbed Devices, shows you the output on
character based MIX devices (the console, line printer and paper tape,
@pxref{Devices}) produced by the running program. The binary
input/output devices (disks, cards, etc.) are handled via files, as in
@code{mixvm} (@pxref{Devices}).

@ifnotinfo
@image{img/ss_devices, 400pt}
@end ifnotinfo

@node Menu and status bars,  , MIX devices view, gmixvm
@comment  node-name,  next,  previous,  up
@section Menu and status bars

The menu bar gives you access to the following commands:

@deffn File Load...
Opens a file dialog that lets you specify a binary MIX file to be loaded
in the virtual machine's memory. It is equivalent to the @code{mixvm}'s
@code{load} command (@pxref{File commands}).
@end deffn

@deffn File Exit
Exits the application.
@end deffn

@deffn Debug Run
Runs the currently loaded MIX program, up to the next breakpoint. It is
equivalent to the @code{mixvm}'s @code{run} command (@pxref{Debug
commands}). 
@end deffn

@deffn Debug Next
Executes the next MIX instruction. It is equivalent to the
@code{mixvm}'s @code{next} command (@pxref{Debug commands}).
@end deffn

@deffn Debug Clear breakpoints
Clears all currently set breakpoints. It is equivalent to the
@code{mixvm}'s @code{cabp} command.
@end deffn

@deffn Help About...
Shows information about @code{gmixvm}'s version and copyright.
@end deffn

On the other hand, the status bar displays the name of the last loaded
MIX file.