Skip to content

How it works

Samuele95 edited this page Jan 21, 2024 · 7 revisions

GUI version

The user interface is split into two main parts:

  • a text editor, which may be used to write and modify .lc3 source files;
  • an embedded terminal emulator, which is used as an input/output stream to interact with programs and the compiler.

example4

Opening and compiling source files

From the file menu entry, a file chooser dialog may be accessed to open an existing file or to create a new one. The opened file may be compiled through the available compile entry. Shortcuts may be used too. Be careful not to leave blank spaces after the final .END directive, because that word signals the end of the source file. Any character or whitespace following it will result in a compilation error

Run programs

Be careful to choose an object file when running a program. The program will require a shutdown if you accidentally decide to run a .lc3 source file, due to the inner mechanisms of the program execution module which can't release the acquired lock on virtual shared memory. This feature will be fixed in a future update.

Program output results in a snapshot of the virtual machine's registry set status, displaying their content. The values are given in hexadecimal format

Send and receive files

The connect menu entry opens a dialog through which you can decide to send a file to a LC3VM process running in a host within the same network or to receive a file from another process. When sending a file, you must give the IP address of the machine you wish to send a file to.

Terminal version

LC3VM

The user is prompted with all the options available.

Screenshot from 2024-01-20 15-44-25

Text editor

The terminal text editor is provided using a modified version of the Texor editor. Support for the LC3Compiler has been granted, which means you can write and immediately compile a program. Compilation results are available on the text editor bar itself.

Screenshot from 2024-01-20 15-42-12

Run programs

When running a program, a dedicated terminal window will be opened.You can use this new windows to interact with the program. Since no more than a process can acquire control on system memory, if you decide to launch more programs together there will be just one process running while all the others will wait for memory to be freed and, therefore, you cannot interact with their dedicated terminal window.

The main terminal shell running the operating system will continue running and will remain interactive.

Send and receive files

When using the file exchanging module, you will be prompted with the host machine network stats and info, which may be useful to inform the remote host about your network address and interface information.

LC3Compiler

The compiler may be launched as a standalone application, as with common programming languages compilers such as gcc and javac. The output object file is generated in the same folder of the source file and with the same name. As an example, a source file named hello_world.lc3 will be compiled to hello_world.obj. Errors are logged to the standard output.

After the code generation phase, the content of the binary output file is printed on screen as per the following screenshot.

example1