StrongBS allows you add more "Squash Options" to the existing ones.
Options added will automatically appear under the "3rd Party Options" menu.
Note: Any type of option can be added. The option does not necessarily have to be a compression or squashing type.
A maximum of 32 new Squash Options may be added to the 3rd Party Options menu.
If you write any additional options then send me a copy so that it can be included with future versions of StrongBS. The code you write becomes Freeware and the conditions that apply to StrongBS will automatically apply to your code.
A simple example code is given in the 3rdParty directory, have a look at it and also at the "CodeList" text file to get some idea.
Note: Use is made of memory, no disc access required.
On entry: StrongBS will pass the following to your code: | ||
R0 - | Memory start address of "Source Program" in memory | |
R1 - | Memory start address to store "Output Program" |
On exit: Your code should return the following to StrongBS: | ||
R0 - | End address of "Output Program". (i.e. end of new result program). If an error occurred then set bit 31 of R0 and bit 0-7 to the error number. Bits 8 to 30 will be the line no. of the program where error occurred |
It is very important that you pass back the end address of the result "Output Program" in StrongBS uses this to calculate the new size of "Output Program" you have generated. "Output File size" = R0 - R1 on entry.
Your code gets called by StrongBS front end program which is a BASIC program. So your code is called like this (assuming that your code is loaded by StrongBS in buffer memory code%):
You should preserve registers that are important to basic like R13 and R14. Any others are free for your code except that you should return result back in R0.
StrongBS does not offer you any supporting routines, therefore your code should work on the whole program from start to end.
Your code does not have to perform compression! it could do anything to the BASIC program. The result file could be larger than the original! You don't have to worry about size allocated to the result file in memory. In fact you could perform de-compression of the file, although this is not recommended as it is against the purpose of StrongBS.
If you think an existing option does not produce the results you want, I suggest you contact me rather than coding your own code. StrongBS is built around some 72 separate codes, these can be very easily changed and customized with very little modification.
If you have a new idea for an option that you want to test and experiment with or you are developing another application and think that some of the code used in StrongBS may be applicable or may help speed-up the development stage of your application, let me know so that I could send you some of the source code of the routines and sub-routines I use in StrongBS.
The current version of StrongBS assumes that your code can be executed from memory and it will load your code into memory and then call it. StrongBS doesn't allow (yet) 3rd party options to be written as a stand alone application that can be run using the command line nor does it allow the BASIC program to be passed to your code as a file. This may however change in future versions.