*unset tla-expd$dir
*set tla-expd$dir <obey$dir>
*if "%0"="" then *echo <28><0><15><79><0><12>
*if "%0"="" then *echo expand assembler-macros for simpler assemblers using TLA-syntax 
*if "%0"="" then *echo Freeware: programmed by MUFTI
*if "%0"="" then *echo syntax: 
*if "%0"="" then *echo !tla-expd [-basic [-start adress]] outputfile inputfile 
*if "%0"="" then *echo options:
*if "%0"="" then *echo -basic        (optional) build a file for bas-inline-assembler und run it
*if "%0"="" then *echo -start adress (optional, only valid with -basic) start-adress of outputfile 
*if "%0"="" then *echo defaults:
*if "%0"="" then *echo no -basic option
*if "%0"="" then *echo if -basic set: adress = &8000
| 
| if you use the basic-option and your binary is greater than the value in the
| line 
| asmlength="XXXXX" 
| then you must patch it 
|
*if "<gawk$path>"="" then *error set variable gawk$path (e.g. set gawk$path $) 
*rmensure FPEmulator     0.00 *error 0 FPEmulator      must be loaded for Gawk
*rmensure SharedCLibrary 0.00 *error 0 SharedCLibrary  must be loaded for Gawk
*if "%0"<>"-basic" then unset tla-expd$out 
*if "%0"<>"-basic" then set tla-expd$out "%0"
*if "%0"<>"-basic" then unset tla-expd$in
*if "%0"<>"-basic" then set tla-expd$in "%1"
*if "%0"="-basic" AND "%1"<>"-start" then unset tla-expd$out 
*if "%0"="-basic" AND "%1"<>"-start" then set tla-expd$out "%1"
*if "%0"="-basic" AND "%1"<>"-start" then unset tla-expd$in
*if "%0"="-basic" AND "%1"<>"-start" then set tla-expd$in "%2"
*if "%0"="-basic" AND "%1"="-start" then unset tla-expd$out 
*if "%0"="-basic" AND "%1"="-start" then set tla-expd$out "%3"
*if "%0"="-basic" AND "%1"="-start" then unset tla-expd$in
*if "%0"="-basic" AND "%1"="-start" then set tla-expd$in "%4"
*if "<tla-expd$out>"="" then *error 0 there is no outputfile
*if "<tla-expd$in>"="" then *error 0 there is no inputfile
*unset tla-expd$error
*set tla-expd$error true
*unset asm$err
*set asm$err false
*echo unexpected error { > <tla-expd$dir>.work.error }
*delete <tla-expd$dir>.work.error 
*if "%0"<>"-basic" then <gawk$path>.gawk -f <tla-expd$dir>.TLAsyntax -v out=%0 %1 
*if "%0"="-basic" AND "%1"<>"-start" then <gawk$path>.gawk -f <tla-expd$dir>.TLAsyntax -v out=<tla-expd$dir>.work.basicfile -v basic=1 -v bin=<tla-expd$out> <tla-expd$in>  
*if "%0"="-basic" AND "%1"="-start" then <gawk$path>.gawk -f <tla-expd$dir>.TLAsyntax -v out=<tla-expd$dir>.work.basicfile -v basic=1 -v bin=<tla-expd$out> -v start=%2 <tla-expd$in>  
|
| if you want to include other functions in the basic-file 
| (e.g. FPAssemble of Stewart Brodie seems to be interesting) use instead of 
|
*if "%0"="-basic" AND "<tla-expd$error>"="false" then settype <tla-expd$dir>.work.basicfile basic
*if "%0"="-basic" AND "<tla-expd$error>"="false" then <tla-expd$dir>.work.basicfile { > <tla-expd$dir>.work.listing }
|
| this between here 
|
|*if "%0"="-basic" AND "<tla-expd$error>"="false" then copy <basic-text-file> <tla-expd$dir>.work.basicfile2  A ~C ~D ~F L ~N ~P ~Q R ~S
|*if "%0"="-basic" AND "<tla-expd$error>"="false" then print <tla-expd$dir>.work.basicfile { >> <tla-expd$dir>.work.basicfile2 } 
|*if "%0"="-basic" AND "<tla-expd$error>"="false" then settype <tla-expd$dir>.work.basicfile2 basic
|*if "%0"="-basic" AND "<tla-expd$error>"="false" then <tla-expd$dir>.work.basicfile2 { > <tla-expd$dir>.work.listing }
|
| and there 
| note: 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 
|
*if "%0"="-basic" AND "<tla-expd$error>"="false" then settype <tla-expd$dir>.work.listing text 
*if "%0"="-basic" AND "<tla-expd$error>"="false" AND "<asm$err>"="true" then rename <tla-expd$dir>.work.listing <tla-expd$dir>.work.error
*if "%0"="-basic" AND "<tla-expd$error>"="false" AND "<asm$err>"="true" then <tla-expd$dir>.work.error 
*if "<tla-expd$error>"="true" then error 0 error occured in !tla-expd  
*quit
