How to read this.

   

ADD

MOVE

   

ANDxx

OPEN

   
BEGSR

ORxx

   

CLOSE

PERFORM

   

DOUxx

RANDOMIZE

   

ELSE

RETURN

   

ENDDO

RUN

   

ENDIF

SUBTR

   

GOTO

TAG

   

IFxx

 
 

Home

   

ADD

The operation has two forms:

arg1

ADD

arg2

arg3

The value in arg1 is added to the value in arg2, and the result is placed in arg3, and:

ADD

arg1

arg2

The value in arg1 is added to the value in arg2, and the result is placed in arg2.

Examples:

Initially the value of AGE is 23. After operation the value of NEW-AGE is 25

AGE

ADD

2

NEW-AGE

After operation of the next statemant AGE has the value of 25.

ADD

2

AGE

Top

 

ANDxx

If used, always in conjunction with the IFxx and DOUxx operations, in that way that the latter conditions are extended through the use of  the ANDxx.  The values of xx are:

EQ (equal)

NE (not equal)

GT (greater than)

LT (less than)

GE (greater or equal)

LE (less or equal)

Syntax.

arg1

ANDxx

arg2

Example:

A certain process may only happen if AGE is greater or equals 18, and INCOME is less then 18000.

AGE

IFGE

18

INCOME

ANDLT

18000

 

 

 

 

 

 

Top

 

BEGSR Opens and starts a subroutine.

Syntax:

                     name                BEGSR

Name contains a unique name of the subroutine and is used as target of the PERFORM name operation.

Example:

                     CHILDHOOD  BEGSR

Starts the subroutine CHILDHOOD.

 

 

 

Top

 

CLOSE

Closes a data file (which has to be always first  opened: see OPEN)

Syntax.

CLOSE

filename

Example:

CLOSE

'Love-affairs'

Data file 'Love-affairs' is closed.

 

 

 

 

 

Top

 

DOUxx

Begins a 'do until' loop (which is ended by a ENDDO statement). xx stands for:

EQ (equal)

NE (not equal)

GT (greater than)

LT (less than)

GE (greater or equal)

LE (less or equal)

 

Syntax.

arg1

DOUxx

arg2

The operands between the DOUxx and the ENDDO are performed until the conditions arg1 and arg2 are satisfied.

Example:

AGE

DOUGT

18

 

An event is performed until AGE is greater than 18. Has AGE initially a value greater than 18 than  all operations between DOUxx and ENDDO are skipped and the process continious after the ENDDO-statement.

 

 

 

 

 

Top

 

ELSE

When existent, always between the IFxx and ENDIF statement. When the condition specified for the IFxx operand is true , all statements between IFxx and ELSE are operated, else all statements between ELSE and ENDIF are operated.

Syntax.

 

ELSE

 

 

Example:

AGE has the value of  16, the IFGT statement is not true so jump to the statement direct following the ELSE: SALARY is increased by 50.

AGE

IFGT

18

 

 

ADD

100

SALARY

 

ELSE

 

 

 

ADD

50

SALARY

 

ENDIF

 

 


Top

 

ENDDO

Finishes a corresponding DOUxx-loop.

Syntax.

 

ENDDO

 

 

 

 


 

 

 

 

 

 

Top

 

ENDIF

Finishes a corresponding IFxx.

Syntax.

 

ENDIF

 

 

 

 

 

 

 

 

 

 


Top

 

GOTO

Forces a jump to a corresponding TAG-statement, skipping all underlying statements. 

Syntax.

 

GOTO

label

 

Example:

 

GOTO

HEAVEN

 

 

 

 

 

 

 

 

 

 

HEAVEN

TAG

 

 

 

 

 

Top

 

IFxx

 

Compares arg1 and arg2 under de xx condition. Gives the comparison a outcome true than all the operands between the IFxx and ENDIF (or ELSE) statement are executed. Is the outcome not true than the process succeeded after the ENDIF (or ELSE) statement. xx stands for:

EQ (equal)

NE (not equal)

GT (greater than)

LT (less than)

GE (greater or equal)

LE (less or equal)

Syntax.

arg1

IFxx

arg2

 

Example:

When AGE has the value of 16 than

18

IFGT

AGE

 

 

 

 

 

 

 

 

ENDIF

 

 

all the statements between the IFGT and ENDIF are executed. 

 

 

 

 

 

Top

 

MOVE

Moves the value of arg1 to arg2.

Syntax.

 

MOVE

arg1

arg2

Example:

When DAY has initially the value of 29, it has after the MOVE-operation the value of 1.

 

MOVE

1

DAY

 

 

 

 

Top

 

OPEN

Opens a data file. After receiving appropriate data from the file, it must be closed by the CLOSE operand.

Syntax.

 

OPEN

filename

 

Example:

 

OPEN

'Love-affairs'

 

Opens the file 'Love-affairs' (obviously a file which contents the names of all your liaisons?).

 

 

 

 

Top

 

ORxx

If used, always in conjunction with the IFxx and DOUxx operations.  Their conditioning is extended through the use of th eORxx operand. The values of xx are:

EQ (equal)

NE (not equal)

GT (greater than)

LT (less than)

GE (greater or equal)

LE (less or equal)

Syntax.

arg1

ORxx

arg2

Example:

A certain process may only happen when AGE is greater or equals 18 or INCOME is less than 18000.

AGE

IFGE

18

INCOME

ORLT

18000

 

 

 

 

 

 

 

Top

 

PERFORM

Starts a subroutine. Jumps (by simple click on the word PERFORM) immediately to the BEGSR of the corresponding subroutine. After that subroutine has completed, control returns to the statement following the PERFORM operand.

Syntax:

 

PERFORM

subroutine

 

Example:

 

PERFORM

FALL-IN-LOVE

 

The actual subroutine is temporary left to process the FALL-IN-LOVE subroutine and when the latter is finished, by means of the corresponding RETURN- statement,  process continuous with the operation following the PERFORM statement. See diagram below.

 

 

Top

 

RANDOMIZE

Gives at random the value *TRUE or *FALSE to a so called logical property. You, as reader, warps a two-sided dice of which one side is marked as *TRUE, and the other as *FALSE. 

Syntax:

 

RANDOMIZE

logical

 

Example:

 

RANDOMIZE

Y-CHROMOSOME

 

Puts the value of  Y-CHROMOSOME on *TRUE or *FALSE. The choice is to the reader, but the value have to be consequently  maintained until a next RANDOMIZE  (in this example Y-CHROMOSOME).

 

 

 

 

Top

 

RETURN

Ends a subroutine and gives control back to the calling subroutine, precisely to the statement following the calling PERFORM. 

Syntax:

 

RETURN

(subroutine-a

 

 

 

...

 

 

 

...

 

 

 

subroutine-n)

 

Example:

 

RETURN

(NEW-YORK)

 

Clicking on RETURN brings you back to the calling subroutine (i.e. NEW-YORK).

 

 

Top

 

RUN

Starts, respectively stops the evolutionary process of life.

Syntax:

arg

RUN

 

The value of arg is START or  STOP.

Example:

START

RUN

 

Starts, on earthly conditions, some three and a half billion years ago, life. By the way: when an organism is viable, and happens to be that of an average taxpayer, it starts the algorithm of that very average taxpayer.

 

 

 

Top

 

SUBTR

Two forms:

arg1

SUBTR

arg2

arg3

The value in arg2 is subtracted from the value in arg1, and the result is placed in arg3,
and

SUBTR

arg1

arg2

The value in arg2 is subtracted with the value in arg1 and the result is placed in arg2.

Example:

AGE has the value 23. After operation NEW-AGE has the value of 21.

AGE

SUBTR

2

NEW-AGE

 

Top

 

TAG

Always in conjunction with GOTO: a label, signpost, well, just a tag.

Syntax:

label 

TAG

Example:

                                            GOTO              HEAVEN
                                            .........

                                            .........

HEAVEN

TAG

Skip all in-between lines from  GOTO HEAVEN to HEAVEN TAG.

 

Top

Home

©2001 JanBais The Algorithm of an Average Taxpayer's Life  The Hague The Netherlands