p101_is

Crates.iop101_is
lib.rsp101_is
version0.9.0
sourcesrc
created_at2024-10-07 22:03:42.991357
updated_at2024-10-07 22:03:42.991357
descriptionRepresent Olivetti Programma 101 programs
homepage
repositoryhttps://gitlab.com/cokkaai/programma_101/-/tree/master/is
max_upload_size
id1400509
size82,043
(cokkaai)

documentation

README

A simulator, as any computer, it is hardly useful with no programs. Since I didn't know how to program a P101, I started looking at other simulators for P101 sources. I found out that there is no standard format. So, in order to read all such formats I implemented a generic framework leveraging traits and a strongly typed instruction representation.

The Encoding trait defines how to convert a text line in an instruction and vice versa. There are two encodings:

  • the standard one which represent instructions using the original code symbols. Once you master the programming language it is easy to read. On the other hand, writing code is not straightforward because many symbols are not available on modern keyboards; you have to copy paste the exact unicode character.
  • the second one is the AsciiEncoding, which takes the opposite approach and express operations using tokens made of ASCII only characters. Easier to write but less readable in my own opinion. Decoding is not implemented as of now.

On the web I found other encoding loosely based on CSV triples that I may support in the future. For instance https://github.com/Fabioamd87/P101, which is similar to the (retired?) emulator for University of Cassino.

Optionally one can implement the Annotator trait to comment each line during encoding. I find this improve code readability as P101 instruction are largely simbolic and you have to get used to.

Encodings are used by a generic Encoder to convert program into text and a generic Decoder to convert a text into a Program. The LariniDecoder is specialized for the format used by the simulator wrote by Claudio Larini that also has made available most P101 programs.

Commit count: 0

cargo fmt