Pop-up menus and files
The pop-up menu for memory includes four options in addition to the options common to all components:
- Edit Contents:
Bring up a hex editor for editing the contents of memory.
- Clear Contents:
Resets all values in memory to 0.
- Load Image...:
Resets all values in memory based on the values found in a file using the format described below.
- Save Image...:
Stores all values in memory into a file using the format described below.
The file format used for image files is intentionally simple; this permits you to write a program, such as an assembler, that generates memory images that can then be loaded. For example if we had a memory as below:
and then all the values are at zero and the resultant file will be the following.
v2.0 raw 12 22 45 67 12*80 23 a2 bb ce 4f 6a cc 45 7*cc 12 24
The first line identifies the file format used (currently, there is only one file format recognized "raw"). Subsequent values list the values in hexadecimal, starting from address 0; you can place several such values on the same line. If the data dimension of the file is smaller than the space in memory the remaining cells will not be changed.
The image file can use run-length encoding; for example, rather than list the value 80 twelve times in a row, the file can include 12*80. Notice than the number of repetitions is written in base 10. Files produced by Logisim will use run-length encoding for runs of at least four values.
You can place comments into the file by using the '#' symbol. All characters in the line from the '#' symbol will be ignored by Logisim.
Next: Hex editor.