Detailed Script Descriptions

At the moment this section includes the help sections of each script as it would have been obtained via a > ./[script].py --help call.

Where [script] is one of:

Core scripts

dgasm.py

Usage: dgasm.py [OPTIONS] INPUT_FILE

Command line tool to produce Digirule binaries (.dgb).

The script produces a .dgb file with the same name as the .asm in its input, see option -o to set the output file explicitly.

Options:

-o, –output-file PATH

-g, –target [2A|2U] Selects the target digirule model to generate code for

--help

Show this message and exit.

author

Athanasios Anastasiou

date

Mar 2020

dginspect.py

Usage: dginspect.py [OPTIONS] INPUT_FILE

Command line tool to inspect and modify .dgb files.

If modifying the .dgb file, a backup (.bak) with the version prior to applying the modifications is created automatically. To turn this functionality off, see option –no-backup

Options:
-b, --list-binary

Produces a listing of the code in binary as ADDR:VALUE. This format makes keying the program into the Digirule easily by cross referencing the ADDR with the Address LEDs.

-g, --get-mem TEXT

Gets the values of a memory range. The format of TEXT is <Symbol>[:Length[:Offset]]. If only Symbol is provided, it must have been defined in the program for its offset to be automatically determined. In this case, Length will be 1 by default. If Symbol:Length is provided, it must have been defined in the program for its offset to be automatically determined. If Symbol:Length:Offset is provided, Symbol does not have to have beendefined in the ASM program. In this case, Symbol is just a name for a region of memory of Length bytes that starts at Offset.

-s, –set-mem <INTEGER INTEGER>…

Set a memory value (as Address, Value).

-nb, --no-backup

If set then no backup file is created.

--help

Show this message and exit.

author

Athanasios Anastasiou

date

Mar 2020

dgsim.py

Usage: dgsim.py [OPTIONS] INPUT_FILE

Command line program that produces a trace of a Digirule2 binary on simulated hardware.

Options:
-otf, --output-trace_file PATH

Filename containing trace information in HTML.

-omf, --output-memdump_file PATH

Filename containing final memory space.

-t, --title TEXT

An optional title for the produced trace.

-wd, --with-dump

Whether to include a complete dump of memory at every time step.

-I, --interactive-mode

Whether to execute the program in interactive mode.

-ts, --trace-symbol TEXT

Adds a symbol to be traced in every execution step. The format of TEXT is<Symbol>[:Length[:Offset]]. If only Symbol is provided, it must have been defined in the program for its offset to be automatically determined. In this case, Length will be 1 by default. If Symbol:Length is provided, it must have been defined in the program for its offset to be automatically determined. If Symbol:Length:Offset is provided, Symbol does not have to have beendefined in the ASM program. In this case, Symbol is just a name for a region of memory of Length bytes that starts at Offset.

-sn, --skip-n INTEGER

Number of steps to skip generating a dump for. For example, if –skip-n 10, the first 10 steps will be executed and the HTML report will start at n=10

-mn, --max-n INTEGER

Maximum number of time steps to allow the sim to run for.

--theme TEXT

Specifies the CSS theme to use (plain OR dgbeos)

--help

Show this message and exit.

author

Athanasios Anastasiou

date

Mar 2020.

Note

For an example of dgsim output, please see this HTML file

This is generated by the example in section Adding two literals saving the result to memory.

dgui.py

Usage: dgui.py [OPTIONS] INPUT_FILE

Text based user interface to dgasm and dgsim.

This script accepts one parameter (INPUT_FILE) that is the .dsf file to go through the compilation procedure.

Options:
-o, --output_file PATH

Optionally sets the output file

--help

Show this message and exit.

author

Athanasios Anastasiou

date

April 2020

dgform.py

Usage: dgform.py [OPTIONS] INPUT_FILE

Generates an HTML file with code formatted through the DigiruleASM pygments formatter.

Options:
--help

Show this message and exit.

author

Athanasios Anastasiou

date

May 2020

Extras

dgbf.py

Brainfuck to Digirule2 ASM compiler.

author

Athanasios Anastasiou

date

July 2020

dgsust.py

Superstack to Digirule2 ASM compiler.

author

Athanasios Anastasiou

date

August 2020