Content -Browse- General Info

Contents | Start

1. Introduction
1.1
1.2
1.3
1.4
1.5
1.6
Introduction
System Requirements
Copyright
Hotline, Error Messages ....
Manual
The Library


1.1 Introduction

Y
ou 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

Addi R4,R3,149

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.


1.3 Copyright

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

Should you still have questions or have discovered any errors or bugs in the Assembler Library or in case you might have some suggestions for improving the program, please contact us at this address:

E-mail: Support@Berkhan.de

Fax/Hotline: ++ 5832 979895 (from USA 011 49 5832 979895) (Monday -Saturday 12 noon to 1 pm, Sunday 2 pm to 3 pm (local time)


Or via postal mail to:
Berkhan-Software
Entwicklung & Vertrieb
Alt-Isenhagen 19
29386 Hankensbüttel
Germany

1.5 Manual

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 be omitted.

For example:

Store_Register Spr_Mask[,Gpr_Mask[,Fpr_Mask]]

This procedure offers three different possibilities for use. The first in the program would approximate this:

Store_Register %11
The link register and the condition register are placed on the dynamic stack.

The second would be as follows:

Store_Register %11,%11000
The general purpose registers R3 and R4 are also placed on the dynamic stack in addition to the two previously mentioned.

And the third:

Store_Register %11,%11000,%10
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 "R" 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.



1.6 Library

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:

Assembler_Init [Lbl_Max]
Initializes Library..
Assembler_Exit
Exits Library.

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:
Assembler_Init
...
'Here, your Assembler program is called.
...
Assembler_Exit
END
...
'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:


Assembler
Displays copyright message.

An alert box is displayed listing the Assembler Library copyright notice.


Contents -Browse- General Info

Contents | Start



© 2003 Berkhan-Software
www.berkhan.com | Online Orders