This program is Freeware.
You may copy and use the program, if you don't get money for this.
If you change this program, your version must be also Freeware and 
you should send me a message.

!TLA-expd expands macros for non-macro-assemblers.
Assembler-macros are very useful, to make a assembler-program more readable
and easier to maintain.

e.g. if you often use some equal commands: 
(target-assembler: Basic-inline-assembler):

(1)
     SWI "OS_WriteS"
     .adress_1 EQUS " String 1 "
     EQUB 0
     ALIGN
     B hupf_1
     .adressptr_1 EQUD adress1
     .hupf1 LDR R1,adressptr_1     

     SWI "OS_WriteS"
     .adress_2 EQUS " String 2 "
     EQUB 0
     ALIGN
     B hupf_2
     .adressptr_2 EQUD adress2
     .hupf2 LDR R2,adressptr_2     

     SWI "OS_WriteS"
     .adress_3 EQUS " String 3 "
     EQUB 0
     ALIGN
     B hupf_3
     .adressptr_3 EQUD adress3
     .hupf3 LDR R3,adressptr_3     


it's useful to put them in a macro and use the macro

(2)
     .MACRO printstr  
     SWI "OS_WriteS"
     \.adress EQUS %2
     EQUB 0
     ALIGN
     B hupf
     \.adressptr EQUD \adress
     \.hupf LDR %1,\adressptr     
     .ENDM

     printstr R1," String 1 "
     printstr R2," String 2 "
     printstr R3," String 3 "

this program is made to expand (2) into (1). 


Commands:


.MACRO   :  defines a Macro-header.

   .MACRO macroname 

.ENDM    :  define the end of a macro

  .ENDM

 local labels (labels which are only valid inside this macro) will be 
 defined and used by including a \-sign before the label. 
 \label1 is local and label2 is global. 
 
 The Arguments of the macros are replaced with the %-sign before the number
 of the Argment (%1 for 1. Argument, %2 for 2. Argument ....)

use the macro with 

  macroname argument1,argument2, .... argumentN

.INCLUDE :  the programm can also read from multiple files with 

  .INCLUDE filename

this is useful, if you have a collection of useful macros


in addition to this, !TLA-expd writes a outputfile suitable for the
basic-inline-assembler.

to allow conditional assembling there are 3 Commands more (note: only for
the basic-inline-assembler !!!)

.IF, .ELSE and .ENDC

.IF (boolean basic-expression)
   assemble this, if expression is true
.ELSE    
   assemble this, if expression is false
.ENDC


Syntax:


 syntax: 
 !TLA-expd [-basic [-start adress]] outputfile inputfile 
 options:
 -basic        (optional) build a file for bas-inline-assembler und run it
 -start adress (optional, only valid with -basic) start-adress of outputfile 
 defaults:
 no -basic option
 if -basic set: adress = &8000


Problems: 


 problems to make mathematics in the .IF-  boolean basic-expression with 
 identifiers, which not known yet  

 if you use the basic-option and your binary will become greater than the 
 value in the line 
 asmlength="XXXXX" ;
 of <TLA-expd$dir>.TLAsyntax then you must patch it 

 maybe you want to include other functions in the basic-file 
 (e.g. FPAssemble of Stewart Brodie seems to be interesting) use instead of 
 if the last linenumber of <basic-text-file> is greater then the first 
 linenumber in <TLA-expd$dir>.work.basicfile, then patch 
 linenumber= XXXXX ; in <TLA-expd$dir>.TLAsyntax to the matching value 
 but in most cases, it's better to use the basic-commands CHAIN or LIBRARY
 patch
 REM LIBRARY
 to 
 CHAIN or LIBRARY
 of <masm-expd$dir>.MASMsyntax


!TLA-expd is a typical gawk-script, short and a little bit slow.
On the Acorn Archimedes multitasking with gawk is impossible and gawk must be 
started on the commandline (if don't have a program like !prog).

Errormessages and other opions are wellcome.  

So long

MUFTI 
( 
  zrzm0111@helpdesk.rus.uni-stuttgart.de   in the internet
 and
  ZRZM at DS0RUS1I                         in the bitnet
) 
 
