LUMYDCTT as a BASIC and Assembly Compiler


The first step is making keywords to uppercase: scnclr=SCNCLR, lda #$08=LDA #$08. After it, the compiling-process forks.

  1. BASIC compiler: you can use patterns or special characters.
    Pattern Symbol
    {white} 5 = $05 ()
    {down} 17 = $11 ()
    {reverse on} 18 = $12 ()
    {home} 19 = $13 ()
    {escape} 27 = $1B (invisible)
    {red} 28 = $1C ()
    {right} 29 = $1D ()
    {green} 30 = $1E ()
    {blue} 31 = $1F ()
    {pi} 126 = $7E ()
    {orange} 129 = $81 ()
    {flash on} 130 = $82 ()
    {flash off} 132 = $84 ()
    {f1} 133 = $85 ()
    {f3} 134 = $86 ()
    {f5} 135 = $87 ()
    {f7} 134 = $88 ()
    {f2} 135 = $89 ()
    {f4} 136 = $8A ()
    {f6} 137 = $8B ()
    {help} 138 = $8C ()
    {black} 144 = $90 ()
    {up} 145 = $91 ()
    {reverse off} 146 = $92 ()
    {clear} 147 = $93 ()
    {brown} 149 = $95 ()
    {yellow-green} 150 = $96 ()
    {pink} 151 = $97 ()
    {blue-green} 152 = $98 ()
    {light-blue} 153 = $99 ()
    {dark-blue} 154 = $9A ()
    {light-green} 155 = $9B ()
    {purple} 156 = $9C ()
    {left} 157 = $9D ()
    {yellow} 158 = $9E ()
    {cyan} 159 = $9F ()
    You have to write decimal numbers in patterns. You can clone easily these patterns or characters with asterix(*):

    Special characters Symbol
    \ backslash (pound, £)

  2. Assembly compiler:
    1. Looking for INCLUDEs: include other sources.
    2. Looking for Variables: evaluation variables and replace them.
    3. Looking for Macros: finding macros and replace them.
    4. The main compiling-process:
      • Skip macro definitions
      • Skip conditional compilation if need
      • Evaluate variables again (with unresolved references)
      • Search assembly mnemonics and find their codes
      • Search labels and store them with their addresses
      • Search KeyWords: ORG, DB, DW, INCLUDE (binary), CMAP and store them
      • Search conditional and unconditional branches
      • Search operations in the source: after mnemonics, branches, etc.
      • Write codes into the file
    5. After compilation:
      • Sorting labels
      • Evaluating the remain operations
      • Releasing unknown branches
    6. Executing in an emulator: Plus4emu, VICE, YAPE, etc.