# 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.

## dgasm.py¶

Usage: dgasm.py [OPTIONS] INPUT_FILE

Command line tool to produce Digirule 2 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 –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.

-mn, --max-n INTEGER

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

--theme TEXT

Specifies the CSS theme to use (e.g. 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.

## 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