next up previous contents
Next: A Real-life Example: modulo Up: The Simulator's Programming Language Previous: The Simulator's Programming Language   Contents

Subsections

The Syntax

Every program for the ENIAC simulator consists of three major parts, the content, connect, and action blocks, which are enclosed in HTML-like tags. Comment lines have to start with a hash sign (#) or a double hash (##) for printing comments. Printing comment lines will be output on the ENIAC output screen during compilation. They can be used for short explanations of what the program does, and which accumulators it uses (try the example program files).

The reserved words content, connect, and action can easily be changed to suit different moods of the programmer (cf. class eniac.control.Loader).

The content Block

The content block states initial values for the accumulators and the fields of the constant transmitter. Its syntax is

content_block ::=
"<content>" $\hookleftarrow$
{ content_line }
"</content>" $\hookleftarrow$

content_line ::=
accu_name $\to$ long_value $\hookleftarrow$

content_line ::=
const_name $\to$ const_field
$\to$ long_value $\hookleftarrow$

($\to$ means a literal tabulator, $\hookleftarrow$ means a literal newline character. For unit and trunk names, see Table 2.)




Table 2: Unit names.
Unit unit_name
initializing unit init
accumulators accu 1 $\dots$ accu 20
constant transmitter const
printer print
digit trunks I, II, III, IV, V
program trunks A-1 $\dots$ A-10

The connect Block

Wired connections between units or between different ports on the same unit can be expressed in the connect block. As on the original machine, a trunk must be used for every interconnection. Thus, we have to specify a sender (unit and output port, or trunk) and a receiver (trunk, or unit and input port) to establish a connection.

connect_block ::=
"<connect>" $\hookleftarrow$
{ connect_line }
"</connect>" $\hookleftarrow$

connect_line ::=
unit_name $\to$ port_name
$\to$ trunk_name $\hookleftarrow$

connect_line ::=
trunk_name $\to$ unit_name
$\to$ port_name
{ $\to$ unit_name $\to$ port_name } $\hookleftarrow$

The action Block

The action block is exclusively for programming switch settings on the accumulator units. As there are repetetive (5-8) and non-repetitive program switches (1-4), the syntax is varying. Every switch has a name (its number), and states an action (expressed by alpha $\dots$ epsilon, NOP, A, AS, or S). Repetitive program switches take another two optional arguments, the repetition count, and clear-correct switch setting ("cc" means the switch is set).

action_block ::=
"<action>" $\hookleftarrow$
{ action_line }
"</action>" $\hookleftarrow$

action_line ::=
accu_name $\to$ switch_name
$\to$ action_name
[ $\to$ repeat_count ] [ $\to$ "cc" ] $\hookleftarrow$


next up previous contents
Next: A Real-life Example: modulo Up: The Simulator's Programming Language Previous: The Simulator's Programming Language   Contents
Peter Hansen 2003-09-21