Optimizer for fwsdk.
---------------------

Contents : 

1. The idea
2. My solution
3. Installation
4. bugfixes

1. The idea : 
-------------
fwsdk is a greate tool ... no question - but :

Each call is formed as banked call, regardless it points to the own bank or not. This takes more 
code and runtime-performance. 

There are many libs with many routines linked; regardless I need only same of them.

2. My solution :
-----------------

I made a tool which changes fwsdks .asm-files. It kicks out unneccessary routines and forms 
bankedcall to normal calls, when they point to the same modul and are not called from other moduls. 
It adjusts stackpointer in the called routine.

The programm is a windows-dialog-programm but it behaives like commandline-programm. So it 
is possible to call it from a makefile.

The optimuzed app is faster and it takes up to 5 kByte less memory !

I order to do this and make it safty, I build up a file which contents all fwskd assm-code.
It's formated as an ini-file. 

Here you find the following sections : 

[Version]           Version information, not used by optimizer-programm
[Modul-List]        List with all applied moduls
[Special Requests]  List with asm-code-statment to identify the requrement for same moduls.
                    Normaly all requirements ar identified by a banked call. 
[...]               Each modul has its own section, with coding, alternateivecode 
                    for allinone-apps, and it requirenment-list 

It looks like : 
-------------------------------------------------------------------------------------------------------
...
[_SetDisplayDirection]
    CodeLine=    SetDisplayDirection = 0x006f
    CodeLine=  .area _code
    CodeLine=  .globl _SetDisplayDirection
    CodeLine=_SetDisplayDirection:
    CodeLine=    call pop1
    CodeLine=  .dw SetDisplayDirection
    Required=pop1
    CodeLine1=    SetDisplayDirection = 0x006f
    CodeLine1=  .area _code
    CodeLine1=  .globl _SetDisplayDirection
    CodeLine1=_SetDisplayDirection:
    CodeLine1=    call pop1_allinone
    CodeLine1=  .dw SetDisplayDirection
    Required1=pop1_allinone
...

Special optimized alternative code for allinone Applications are in block
Codeline1. In Required block (also Required1) needed sub-module are listed.

3. Installation
---------------

Please unpack the zip-fle optimizer.zip into a temp-directory.

You'll find the following files : 

optimizer.exe     The Optimizer. Please copy it into /bin - directory of your fwsdk-system
		  Doubleclick this file to get information about parameters.
fwsdk.ini	  The Basefile, please copy it into /lib - directory of your fwsdk-system
optimizer.txt     This files. Please read it.
makefile_allinone Example for a makefile for allinone applications.
makefile_opti     Example for a makefile for optimizer applications.


4. Bugfixes
------------
* version 0.2
- problem with AssignBankNo __BankNo not added to StartupX.opt : 
  new entry added to paragraph [Special Requests]
- problem with user-function's name which is part of system-function : 
  changed Optimizer.exe   


Have fun.

Hubert Baumgarten

email hubert.baumgarten@nexgo.de
