📄 mdk_gmixvm.texi
字号:
@c -*-texinfo-*-@c This is part of the GNU MDK Reference Manual.@c Copyright (C) 2000, 2001@c Free Software Foundation, Inc.@c See the file mdk.texi for copying conditions.@c $Id: mdk_gmixvm.texi,v 1.15 2001/09/29 01:55:05 jao Exp $@node gmixvm, mixguile, mixvm, Top@comment node-name, next, previous, up@chapter @code{gmixvm}, the GTK virtual machine@cindex @code{gmixvm}@cindex GUI@cindex GTK+This chapter describes the graphical MIX virtual machine emulatorshipped with @sc{mdk}. In addition to having all the command-orientedfunctionalities of the other virtual machines (@code{mixvm} and@code{mixguile}), @code{gmixvm} offers you a graphical interfacedisplaying the status of the virtual machine, the source code of the thedownloaded programs and the contents of the MIX devices.@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}), agraphical front-end for the MIX virtual machine will be available inyour system. You can invoke it by typing@examplegmixvm [-vhuq] [--version] [--help] [--usage] [--noinit]@end example@noindentat your command prompt, where the options have the following meanings:@defopt -v@defoptx --versionPrints version and copyleft information and exits.@end defopt@defopt -h@defoptx --help@defoptx -u@defoptx --usagePrints a summary of available options and exits.@end defopt@defopt -q@defoptx --noinitDo not load the Guile initialisation file @code{~/.mdk/mixguile.scm} atstartup. This file contains any local Scheme code to be executed by theembedded Guile interpreter at startup (@pxref{Using Scheme in mixvm andgmixvm}).@end defoptTyping @code{gmixvm} or @code{gmixvm -q} at your command prompt, themain window will appear, offering you a graphical interface to run anddebug your MIX programs.@ifnottex@image{img/ss_mix, 400pt}@end ifnottexApart from the menu and status bars, we can distinguish two zones (orhalves) in this main window. In the upper half of @code{gmixvm}'s mainwindow there is a notebook with three pages, namely,@itemize@itema MIX virtual machine view, which shows you the registers, flags, memorycontents and time statistics of the virtual machine;@itema MIXAL source view, which shows the MIXAL file and lets you managebreakpoints;@itema Devices view, which shows you the output to character based MIX blockdevices.@end itemize@noindentThe application can run in two modes: non-split (the above windows areplaced in a notebook in the main window) or split mode (the windows aredetached from the main one, and can be hidden individually). You canchoose the display mode using the corresponding command from the@code{View} menu.@ifhtmlHere is an screenshot showing how @code{gmixvm} looks like when runningin split mode:@image{img/ss_split, 420pt}@end ifhtmlOn the other hand, the main window's lower half presents you a@code{mixvm} command prompt and a logging area where results of theissued commands are presented (in split mode, these widgets occupy thewhole main window's space between the menu and status bars). Thesewidgets implement a @code{mixvm} console which offers almost the samefunctionality as its @acronym{CLI} counterpart.When @code{gmixvm} is run, it creates a directory named @file{.mdk} inyour home directory (if it does not already exist). The @file{.mdk}directory contains the program settings, the device files used by yourMIX programs (@pxref{Devices}), and a command history file.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 consoleIn the lower half of the @code{gmixvm} main window, you will find acommand text entry and, above it, an echo area. These widgets offer youthe 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 virtualmachine. Please refer to @xref{mixvm}, for a description of thesecommands, and to @xref{Getting started}, for a tutorial on using the MIXvirtual machine. The command prompt offers command line completion forpartially typed commands using the @key{TAB} key; e.g., if you type@examplelo @key{TAB}@end example@noindentthe command is automatically completed to @code{load}. If multiplecompletions are available, they will be shown in the echo area. Thus,typing@examplep @key{TAB}@end example@noindentwill produce the following output on the echo area:@exampleCompletions:pc psym preg pflags pall pmem @end example@noindentwhich lists all the available commands starting with @code{p}. Inaddition, the command prompt maintains a history of typed commands,which can be recovered using the arrow up and down keys. As mentionedabove, a file containing previous sessions' commands is stored in theconfiguration directory @file{~/.mdk}, and reloaded every time you start@code{gmixvm}. You can change the font used to display the issued commands and themessages in the echo area using the @w{Settings->Change font->Commandprompt} and @w{Settings->Change font->Command log} menu commands.@node MIX virtual machine, MIXAL source view, MIXVM console, gmixvm@comment node-name, next, previous, up@section MIX virtual machineThe first notebook's page displays the current status of the virtualmachine. There you can find the registers' contents, the value of thecomparison and overflow flags, the location pointer, a list with all MIXmemory cells and their contents, and the time statistics (includingtotal uptime, elapsed time since the last run command and totalexecution time for the currently loaded MIX program).Clicking any register entry, you will be prompted for a new register'scontents.@ifhtmlThe next figure shows the enter word dialog.@image{img/ss_worddlg, 250pt}@end ifhtmlIn the same manner, click on any address of the memory cells list to beprompted for the new contents of the clicked cell. If you click theaddress column's title, a dialog asking you for a memory address willappear; if you introduce a valid address, this will be the first celldisplayed in the scrollable list after you click the OK button.@ifhtmlThe next figure shows the enter address dialog.@image{img/ss_goto, 200pt}@end ifhtmlThe register contents are shown as a list of MIX bytes plus sign. If youplace the mouse pointer over any of them, the decimal value of this MIXword will appear inside a tooltip.You can change the font used to display the MIX virtual machine contentsusing the @w{Settings->Change font->MIX} menu command.@node MIXAL source view, MIX devices view, MIX virtual machine, gmixvm@comment node-name, next, previous, up@section MIXAL source viewThe second notebook's page, dubbed MIXAL, shows you the MIXAL source ofthe currently loaded MIX file. @ifnottex@image{img/ss_mixal, 400pt}@end ifnottexThe information is presented in two columns. The first column shows theaddress and memory contents of the compiled MIX instruction, while thesecond one displays its corresponding MIXAL representation, togetherwith the source file line number. The current location of the locationcounter is highlighted in grey, while any set breakpoint is marked inred. You can set/unset breakpoints by clicking on any line in this viewwhich has an associated memory address.The colors used to mark the location pointer line and the breakpointscan be customized with the @w{Settings->Colors...} menu command. When youclick on this menu item, a dialog showing the current line colors willappear. @ifhtmlThe following figure shows the change color dialog.@image{img/ss_colors, 250pt}@end ifhtmlClicking on any of the colors will produce a color selection dialog forchoosing a new color for the given element. In this way, you can changethe foreground and background colors used for drawing the current line,the lines where breakpoints have been set and plain MIXAL code lines.You can change the font used to display the MIXAL source codeusing the @w{Settings->Change font->MIXAL} menu command.@node MIX devices view, Menu and status bars, MIXAL source view, gmixvm@comment node-name, next, previous, up@section MIX devices viewThe last notebook page, dubbed Devices, shows you the output/inputto/from MIX block devices (the console, line printer, paper tape,disks, card and tapes @pxref{Devices}) produced by the runningprogram. @ifhtml@image{img/ss_devices, 400pt}@end ifhtmlInput device contents is read from files located in the @file{~/.gmivm}directory, and the output is also written in files at the samelocation. Note that device tabs will appear as they are used by the MIXprogram being run, and that loading a new MIX program will close allpreviously open devices.The input/output for binary block devices (tapes and disks) shall be alist of MIX words, which can be displayed either in decimal or wordformat (e.g. @w{- 67} or @w{- 00 00 00 01 03}. The format used by@code{gmixvm} can be configured using the @w{Settings->Device output}menu command for each binary device.You can change the font used to display the devices contentusing the @w{Settings->Change font->Devices} menu command.@node Menu and status bars, , MIX devices view, gmixvm@comment node-name, next, previous, up@section Menu and status barsThe 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 loadedin the virtual machine's memory. It is equivalent to the @code{mixvm}'s@code{load} command (@pxref{File commands}).@end deffn@deffn File Edit...Opens a file dialog that lets your specify a MIXAL source file to beedited. It is equivalent to the @code{mixvm}'s @code{edit} command(@pxref{File commands}). The program used for editing can be specifiedusing the menu entry @code{@w{Settings->External programs}}, or using the@code{mixvm} command @code{sedit}.@end deffn@deffn File Compile...Opens a file dialog that lets your specify a MIXAL source file to becompiled. It is equivalent to the @code{mixvm}'s @code{compile} command(@pxref{File commands}). The command used for compiling can be specifiedusing the menu entry @code{@w{Settings->External programs}}, or using the@code{mixvm} command @code{sasm}.@end deffn@deffn File ExitExits the application.@end deffn@deffn View @w{Toolbar(s)}Toggles the toolbar(s) in the @code{gmixvm} window(s) (in split modethere are multiple windows and, hence, multiple toolbars).@end deffn@deffn View MIX@deffnx View MIXAL@deffnx View DevicesThese toggles are available when running @code{gmixvm} in split mode,and let you turn on/off the visibility of the corresponding@code{gmixvm} windows.@end deffn@deffn View @w{Split windows}@deffnx View @w{One window}Change the mode between one and split windows.@end deffn@deffn Debug RunRuns the currently loaded MIX program, up to the next breakpoint. It isequivalent to the @code{mixvm}'s @code{run} command (@pxref{Debugcommands}). @end deffn@deffn Debug NextExecutes the next MIX instruction. It is equivalent to the@code{mixvm}'s @code{next} command (@pxref{Debug commands}).@end deffn@deffn Debug @w{Clear breakpoints}Clears all currently set breakpoints. It is equivalent to the@code{mixvm}'s @code{cabp} command.@end deffn@deffn Debug Symbols...Opens a dialog showing the list of symbols defined in the currentlyloaded MIX program.@ifhtml@image{img/ss_symbols, 250pt}@end ifhtml@end deffn@deffn Settings Colors...Lets you change the colors used to mark the current and breakpoint linesin the MIXAL tab, as well as the colors used for plain source lines.@end deffn@deffn Settings @w{Change font}Lets you change the font used in the various @code{gmixv} widgets(i.e. commad prompt, command log, MIX, MIXAL and devices).@end deffn@deffn Settings @w{Device output...}Opens a dialog that lets you specify which format shall be used to showthe contents of MIX binary block devices.@ifhtml@image{img/ss_devform, 250pt}@end ifhtmlThe available formats are decimal (e.g. @w{-1234}) and MIX word(e.g. @w{- 00 00 00 19 18}).@end deffn@deffn Settings @w{Devices dir...}Opens a dialog that lets you choose where the MIX device files will bestored (@file{~/.mdk} is the default location).@ifhtml@image{img/ss_devdir, 250pt}@end ifhtmlYou can also specify the devices directory using the @code{mixvm}command @code{sddir} (@pxref{Configuration commands}).@end deffn@deffn Settings @w{External programs...}This menu command opens a dialog that lets you specify the commands usedfor editing and compiling MIXAL source files.@ifhtml@image{img/ss_extprog, 250pt}@end ifhtmlThe commands are specified as template strings, where the controlsubstring @code{%s} will be substituted by the actual file name. Thus,if you want to edit programs using @code{vi} running in an @code{xterm},you must enter the command template @code{@w{xterm -e vi %s}} in thecorresponding dialog entry. These settings can also be changed using the@code{mixvm} commands @code{sedit} and @code{sasm} (@pxref{Configurationcommands}). @end deffn@deffn Settings SaveSaves the current settings.@end deffn@deffn Settings @w{Save on exit}Mark this checkbox if you want @code{gmixvm} to save its settingsevery time you quit the program.@end deffn@deffn Help About...Shows information about @code{gmixvm}'s version and copyright.@end deffnOn the other hand, the status bar displays the name of the last loadedMIX file. In addition, when the mouse pointer is over a MIXAL sourcefile line that contains symbols, a list of these symbols with theirvalues will appear in the status bar.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -