1. Introduction 1.1
Hotline, Error Messages ....
You probably have asked yourself before how Omikron Basic generates a series of zeros and ones from the BASIC commands in your program, which are then recognized by the PowerPC processor as commands and executed. This requires two steps:
|-||First, the editor converts your input program text into a symbolic temporary - or intermediary - code also called token code. This is done when exiting a program line.|
|-||The compiler then generates the machine code from the token code (a series of zeros and ones), which can be executed directly by the processor.|
|This is where the Assembler Library becomes important. Because it
has greatly simplified our compiler programming by converting short sequences of
letters, so-called mnemonics, into a series of zeros and ones. It is much easier
for people to work with mnemonics because letters can be associated better than a
series of zeros and ones. For example, the mnemonic
means that the number 149 is added to the content in register 3 and the result is to be saved in register 4. This command is easy to remember because Addi immediately evokes the association of "adding" while the corresponding binary number
%00111000100000110000000010010101 or hexadecimal $38830095
hardly allows for any kind of association. When computer programming was in its infancy, (still in the 80s), such columns of figures were actually used to create programs - an extremely labor and time intensive way of programming.
The Assembly Library is thus used to create programs that directly program the processor and are therefore especially effective simply with the use of practical mnemonics.
|Notes about the Lite Version
The Lite Version does include all commands but allows only the creation of small programs with an object code not to exceed 256 bytes. However, this is enough to see how the program works and to generate short primitives.
|1.2 System Requirements
The Assembler Library requires Omikron Basic 6 or later and an Apple computer with PowerPC processor. At least 6 MB of available memory or more, the more the better. Since the fields of the Assembler Library are dimensioned and programs require some application heap memory you have to use the control terms COMPILER "BAS_MEM X" or COMPILER "MIN_SIZE Y" to reserve sufficient BASIC or heap memory (see Omikron Basic Manual under compiler control terms and memory management).
Nothing special is required of the operating system or the type of PowerPC processor. Should Omikron Basic be running you may also use the Assembler Library. Remember, not all PowerPC processors supports all PowerPC commands. Please read the respective User Manual for more information available as a free download from the Motorola or IBM Web sites . Some manuals may also be ordered from these sites as a hardcopy version.
You may copy the Assembler Library for your own use as often as you wish. You may save the Library to your hard drive or to a working disk. However, make sure third parties do not have access to your original copies because you are possibly liable for any pirated copies.
|If you would like to distribute programs that require the Assembler Library, you have to ensure that the Library is protected against misuse by third parties. It is best to pass on only compiled programs, since it is impossible to reconstruct neither the source code of your program nor the Library itself.|
1.4 Hotline, Error Messages & Suggestions
The individual functions of the Assembler Library are not alphabetized but are rather explained sorted according to the subject field. This is meant to facilitate a step-by-step familiarization process with the subject matter However, the command overview is alphabetical for the most part with the simplified mnemonics always listed with the corresponding main commands.
|The syntax descriptions follow the layout of the Omikron Basic manual.
Assembler Library commands are always depicted with this font: Courier New. The actual command is in bold and the parameter normal. Elements in [square brackets] may
|This procedure offers three different possibilities for use. The first in the program would approximate this:|
|The link register and the condition register are placed on the dynamic stack.|
|The second would be as follows:|
|The general purpose registers R3 and R4 are also placed on the dynamic stack in addition to the two previously mentioned.|
|And the third:|
|The link register, condition register, general purpose registers R3 and R4, as well as the floating point register Fr1 are placed on the dynamic stack.|
|The angle brackets, which are used in the Omikron Basic manual to
indicate that a meaningful substitution is to be input, are here omitted entirely.
The parameters (plain text) are always used to indicate examples. Subsequently, you
can also use other names. However, it is not possible to replace the procedure or
function name with another one (bold text).
An "R" preceding a parameter indicates that you are dealing with a return parameter. The Assembler Library will then return a value:
|Caution: Do not add the
yourself. Its only purpose is to describe the syntax.
The examples in these instructions presume that programming will be without line numbers. To try out the examples, it is best to copy them from the online manual to the clipboard and from there to an Omikron Basic editor window. Copying by hand is tiring and the likelihood of making typing mistakes is great.
The Assembler Library is deposited in a special encoding procedure (token code), which enables Omikron Basic to load the Library very quickly. This is done from within the editor using the menu item 'Edit/Merge Library... '.
The Library will be automatically appended to the end of your program. There, it is listed as:
|LIBRARY CODE Assembler 'Version X.YZ, Release DD.MM.YYYY|
|The line containing the LIBRARY
CODE cannot be changed. At most, you can delete the line ([Alt]
+ [Backspace]). This removes the Library from your program. After that, it is advisable
to click on 'Program/Clean Sweep' in the editor so that all now superfluous Assembler
Library variables are cleaned from the table.
The Assembler Library has to be initialized when the program starts and de-initialized when the program is ended. The following two calls serve this purpose:
|Another optional parameter can be passed with Assembler_Init as well, which may be used to specify the max. number of labels. Specify nothing and the max. number of labels equals 1024. The command Label lists an explanation about what a label is and how to use it. The skeleton of an Assembler program is as follows:|
'Here, your Assembler program is called.
'Here, your Assembler program is defined.
|The skeleton as depicted above is already an executable program, which,
however, has no purpose and ends right away.
Note: All sample programs of the following chapters with this form are directly executable. Thus, they can be copied with 'Copy' and subsequently pasted into an empty program window. Of course, this has to be followed with the loading of the Assembler Library using 'Merge Library'. If the examples do not list Assembler_Init at the beginning, you are then dealing with program fragments used only to explain special commands.
|And finally, this introduction would not be complete without mentioning the Assembler procedure:|
|Displays copyright message.|
|An alert box is displayed listing the Assembler Library copyright notice.|
© 2003 Berkhan-Software
www.berkhan.com | Online Orders