My Little Compiler
PreCompiler V1.31

For the TI-99 with Extended Basic

Version Française


How to take advantage of the assembly language with no clue about it?

Access to the following ressources:
  • Graphism, colors and char definitions
  • Sprites with automatic motion
  • Sound and Speech
  • Files direct and sequentials
  • F18A support (Coprocessor, graphic layer, timer)
  • TEXT and MultiCOLOR modes with option for 30 lines (F18A)
Work with:
  • 16 bits integers or 64 bits reals
  • strings
  • Simple variables or arrays
  • Sets (as you can find in Pascal)

Simply using your Extended Basic without the Editor/Assembler cartridge!


The MLC Compiler
The PreCompiler

It's a binary file designed for Extended Basic that you load this way:

CALL INIT::CALL LOAD("DSK1.NEWMLCO")

Or 12 times faster with the FastLoader provided:

CALL INIT::CALL LOAD("DSK1.NEWFLO")::CALL LINK("NEWFLO")

The compiler is now in memory!

You just have to fill DATA line containing:
  • Macro codes for the program
  • Character definitions
  • Sound definitions
RUN
and everything is done! (including compilation!)
Prepare your work on a PC:
  • Access to a high level language
  • Use your favorite text editor
  • DATA lines are automatically generated
  • Fast compilation
  • Test your program with an emulator
Access to features only known by the PreCompiler:
  • An integrated assembler
  • Pseudos instructions for loops WHILE, FOR, etc
  • semi-graphic character definition
  • Use of hexadecimal or binary notations
  • And many more...


Download
MLC.ZIP
Content:
  • Two image disks for the emulators or the CF7 card with the MLC compiler and its Fast Loader
  • The PreCompiler for Windows
  • Commented source examples
  • sources file of de MLC and the PreCompiler
  • Complete manual for programmation in english (PDF format)
MLC user's manual
Content:
  • The complete programming manual
  • Use on a TI with MLC
  • Use on a PC with the PreCompiler
  • Inline assembler, memory map,...
How to work with the PreCompiler?


Here is a little vidéo that shows the sequence Edition, Compilation and program test.

For the edition, you can use the editor you want, for me it's QuickEditor 3.5.

For testing, I use Classic99, a very good emulator with a Debugger.


What do the source and compiled program look like?


As an example, here is the program looking for how many prime numbers are there between 1 and 32767.

100 CALL CLEAR
$MLC F 110 10 3000
310 CALL LINK("ERATHO",C)
320 PRINT C;" prime numbers"::PRINT "from 2 to 32767."
330 END
$ERATHO
    DIMSET 2 32767 A        ; a is a set with elements from 2 to 32767
    SETFILL A               ; all elements in A
    LET B 2                 ; first element to find
    DO
        SETFINDNEXT A B     ; start looking for an element in A starting from B
    WHILE=                  ; if found, then B=element number, and B is PRIME
        LET C B             ; take the prime number
        DO
            ADD C B         ; computes 2*B, 3*B, 4*B, etc...
        WHILE>
            ELEMENT- A C    ; and remove this list from A
        LOOP
        INC B               ; see if there is another prime number after B
    LOOP
    SETCARD A C             ; computes cardinal of set A
    PUTPARAM 1 C            ; and return the cardinal
$$
$END
The source code


Notes:
  • the line with $MLC replaces every instruction required for loading and compiling.
  • the line CALL LINK calls the compiled program
  • between $ERATHO and $END is defined the program for MLC


100 CALL CLEAR
110 DIM IO(3)
120 CALL INIT::PRINT "LOADING COMPILER..."::CALL LOAD("DSK1.NEWFLO")::CALL LINK("NEWFLO")
130 IO(1)=3000::CALL LINK("COMPIL",IO(),S$(),C$())::If IO(1) THEN PRINT "Error ";IO(1)::END
140 PRINT "COMPILATION OK!"
310 CALL LINK("ERATHO",C)
320 PRINT C;" prime numbers"::PRINT "from 2 to 32767."
330 END
3000 DATA P
3010 DATA ERATHO
3020 DATA "FD2.32767A FOA =B2 LA FFAB _B !=B =CB LC +CB _D !>D F-AC BC LD IB BA LB FCAC P1C"
3030 DATA ""3040 DATA ""
The compiled program


Notes:
  • lines 110 to 140 are the ones generated by the $MLC directive.
  • DATA lines from line 3000 are the compiled version using macro codes of the previous program.


Some programs made with MLC


Modes 32/40 and 80 lines

MultiCOLOR



Lines on the BML (F18A)

Rectangles on the BML (F18A)



Note: it's the old version of the FastLoader that is used there, the new one is twice as fast!
The PONG game

TINTIN



Talking Scroll



The one pixel scroll



15 décembre 2007