TINY14E Development

The next stages of development (with Jack Crenshaw's relevant instalment in brackets) were as follows.

  • Procedures (Part XIII)
    • Developed first without parameters. Procedure without parameters needs empty brackets after its identifier.
    • Pass-by-value parameters introduced. We now have a set of procedures LoadParam, StoreParam IncParam, DecParam and CompareParam analogous to those for global variables.
    • Local variables introduced. We decided to initialise local variables for consistency.
  • Repeat loop and for loop (Part V)
  • Semicolons allowed at places allowed by Pascal (Part XII)
  • Nestable comments in braces (Part XII)
  • Writing constant strings. Also readLn and writeLn procedures.

Generally, the development required careful use of the variables Token and Look and appropriate positioning of calls to the Next and Scan procedures.

During our testing we noted these restrictions due to MASM.

  • The use of < or > within a print statement causes a problem because of its use within MASM. For a solution you could emit printf in your assembler code instead of print. The TINY programmer would then precede the problematic character with a backslash.
  • A variable named C causes problems.
  • Variable names should not be the same as opcodes e.g. Test.

The code is in the units given on following pages. The main program TINY14E and the units uGlobals, uInput, uOutput, uErrors are small and in separate sections on the same page. The more substantial uScanner, uParser and uCodegen units follow.

After this section we provide examples of programs written in TINY. You can use these programs to see acceptable syntax. Note the lack of "syntactic sugar". For example, DO is not allowed after WHILE.

Programming - a skill for life!

by PPS in association with Jack Crenshaw