Jaap's Psion II Page

Psion Organiser II
The Organiser Developer


© Copyright Psion Limited 1987.

All rights reserved. This manual and the programs referred to herein are copyrighted works of Psion limited, London, England. Reproduction in whole or in part, including utilisation in machines capable of reproduction or retrieval, without the express written permission of Psion Limited, is prohibited. Reverse engineering is also prohibited.

The information in this document is subject to change without notice.

Typeset by Lotus Reprographic Services, London. Printed by Premier Metropolis, London.


CONTENTS

1 INTRODUCTION 2 THE EMULATOR RUNNING THE EMULATOR QUITTING THE EMULATOR APPEARANCE The LCD Screen Ram Size Slots B: & C: The DISK Indicator The DEBUG Indicator The Command Area USING THE EMULATOR EMULATION RESTRICTIONS EMULATOR COMMANDS Create Delete Erase Fit Remove Translate Disk Debug Dos Help Quit 3 THE SCREEN EDITOR FUNCTION KEYS F1 Delete Current Line F2 Exit F3 Top/Bottom of Buffer F4 Paste F5 Mark F6 Cut F7 Search F8 Replace F9 Word Left F10 Word Right SHIFT F1 Restore Line SHIFT F2 Swap Buffers SHIFT F3 Merge SHIFT F4 Save Current Buffer SHIFT F10 Other .LNO & .OPL FILES 4 THE DEBUGGER APPEARANCE The LCD Screen Debug Command Area Source Code Display Debug Display DEBUGGER COMMANDS Break Points Catalogue Deposit Examine Go Help Procedures Quit Single Step Trace Variables Watch F2 Display F10 Temporary Break Points 5 DEVELOPMENT UTILITIES THE OPLTRAN UTILITY THE BLDPACK UTILITY THE MAKE UTILITY THE UNMAKE UTILITY A FILE EXTENSIONS AND FORMATS


1 INTRODUCTION

The Organiser Developer consists of a number of programs which allow OPL procedures to be written and debugged on an IBM PC (or compatible) and then transferred to and from an Organiser. It requires 512K of memory and runs on all versions of DOS from 2.0 onwards.

On the supplied disk you will find the following files:

  1. ORG2.EXE - Organiser emulator
  2. OPLTRAN.EXE - Procedure translator
  3. BLDPACK.EXE - Build a Datapak image on the IBM PC
  4. MAKE.EXE - Make a Datapak from a pack image using COMMS LINK
  5. UNMAKE.EXE - Load a pack from the Organiser and break into parts
  6. BOOT.BIN - Sample bootable header

This manual assumes a certain knowledge of and familiarity with the features of the Organiser in general and OPL and COMMS LINK in particular.

IMPORTANT Before using the package you should Copy the files onto either another floppy disk or a hard disk. You should then keep the original disk as a backup, and use the new copy.


2 THE EMULATOR

The main advantages of using the emulator are:

  1. Full QWERTY keyboard
  2. Built-in screen editor for writing procedures
  3. Superior debugging facilities
  4. Use of files instead of Datapaks

The emulator provides an almost complete emulation of the real Organiser. The main limitations are that the OPL commands POKEB and POKEW and the functions USR, USR$, PEEKB and PEEKW have no real effect; alarms cannot be used; machine code cannot be run and the top slot cannot be used (with the exception that the OPL command LPRINT will print to LPT1, normally the PC parallel port, if available).

RUNNING THE EMULATOR

To run the emulator, make the drive which contains the disk the current drive and type:

ORG2ENTER

The screen will clear and the emulator screen will be displayed.

You are now in Emulator Command Mode. To return to emulator - i.e. switch on the Organiser - press F1.

This takes you into Organiser Emulation Mode. To return to emulator command mode when in Organiser emulation mode press F4. Note that this is not possible when editing or debugging procedures - you must first SAVE or QUIT before pressing F4.

QUITTING THE EMULATOR

First enter emulator command mode (see above), then type

QUITENTER

The screen will clear and you will be returned to DOS.

APPEARANCE

The emulator display is divided into three main areas.

  1. The LCD screen
  2. The status area
  3. The emulator command area

This is shown in figure 1.

 -------LCD------ ----------------------------STATUS--------------------------  | || RAMSIZE - SLOT B: - SLOT C: - DISK - DEBUG | | || 24K - EMPTY - EMPTY - ON - ON | ---------------- ------------------------------------------------------------  ---------------------------------EMULATOR COMMAND-----------------------------  | ORGANISER EMULATOR Vx.x Copyright PSION Ltd 1987 | | | | | | > | | | | | | | | | | | | | | | | | | | | | | | | | ------------------------------------------------------------------------------

Figure 1 The Emulator Display

The LCD Screen

The top left of the display represents the 16x2 character Organiser LCD screen. This is where, in Organiser emulation mode, the contents of the Organiser's screen are displayed.

Use of menus, scrolling and print formatting on the emulator are all identical to those on the real Organiser.

RAM Size

This shows the total amount of RAM in the Organiser model XP, which is the amount of RAM available in the Organiser emulator. This figure cannot be changed.

Slots B: & C:

The two indicators, SLOT B: and SLOT C:, show the presence and names of any packs fitted to the Organiser. These may be 8, 16, 32, 64 or 128k Datapaks, or 32k Rampaks. Packs are created and fitted from the emulator command mode (see below).

The DISK Indicator

The DISK indicator is either ON or OFF, and shows the status of the disk. The default is ON which means that procedure files will be created/loaded/deleted/copied as files on the current disk directory. When DISK is OFF, procedures are searched for on devices A:, B: and C: in the same way as on the real Organiser. When DISK is OFF the debugger is automatically off. In general it is more useful to keep DISK ON when developing OPL procedures.

The DEBUG Indicator

The DEBUG indicator is either ON or OFF, the default being ON. If DISK is OFF then DEBUG is automatically OFF.

This facility allows you to step through OPL programs, examine or change the values of variables and perform a variety of other debugging operations. See Chapter 4 for more information on the debugger.

When procedures are translated with DEBUG ON, extra information is added to the object code which allows full use of the debugger. When procedures translated with DEBUG OFF are run, the facilities of the debugger are not available for that procedure even if DEBUG is currently ON.

Procedures translated with DEBUG OFF are exactly the same size as they would be on the real Organiser. However, those translated with DEBUG ON are larger.

The Command Area

When the emulator is in emulator command mode, commands may be typed into the lower part of the screen (the command area) at the '>' prompt. To return to Organiser emulation mode, press F1. The emulator commands are covered later in this chapter.

USING THE EMULATOR

Use of the IBM PC keyboard to emulate that of the Organiser is largely intuitive. The alphanumeric keys may be used shifted or unshifted and the Caps Lock key works as usual. The Num Lock key can be used to make the numeric keypad operate in numeric mode and the following function keys have special uses:

KeyUse
F1 Enter Organiser emulation mode from emulator command mode and, when in Organiser emulation mode, equivalent to the ON/CLEAR key
F2 When in Organiser emulation mode, equivalent to the MODE key
F4 Enters emulator command mode from Organiser emulation mode

EMULATION RESTRICTIONS

The operation of the emulator is the same as that of the real Organiser with the following exceptions:

  1. Top level alarms and diary alarms may be set but are ignored and will not sound
  2. In Organiser emulation mode the Organiser will not automatically turn itself off if left waiting for a keypress
  3. The OPL functions USR, PEEKB and PEEKW return zero and USR$ returns a null string
  4. The OPL commands POKEB and POKEW have no effect and the KSTAT command has no effect on key input or on the cursor
  5. UDGs (User Defined Graphics) cannot be defined
  6. The top slot is not present. So, for example, language extensions supplied by the COMMS LINK cable (LSET:, LINPUT: and TRIG$:) are not recognised. During development these and other language extensions may be commented out with REM statements or dummied by creating the procedure with the name of the language extension required and the appropriate parameters. Note that LPRINT does work through the PC parallel port LPT1 (if present).

The speed of running OPL on the emulator varies between the same speed and one tenth the speed of a real Organiser.

EMULATOR COMMANDS

To re-enter the emulator command mode from Organiser emulation mode, press F4. A prompt (the '>' character) will appear in the lower part of the screen. You may then enter any of the commands listed below. Commands may be abbreviated to the first three letters. Entering just the command without the necessary parameters is permitted, the parameters will be requested in turn. In this list the following syntax is used:

<packname>up to 8 alphanumeric characters starting with a letter
<filename>up to 8 alphanumeric characters starting with a letter
<size> 8, 16, 32, 64 or 128
<slot> either B: or C:
<status> either ON or OFF

Square brackets indicate optional command parameters; vertical bars (|) indicate possible choices between command parameters.

Create

Syntax: CREATE <packname> <size>[ R]ENTER

Create and size an 8, 16, 32, 64 or 128k Datapak or, if the command is terminated with ' R', a 32k Rampak. These packs are held as files with the extension '.IPK'. The name must be different to any existing '.IPK' file.

Delete

Syntax: DELETE <packname>ENTER

Delete a '.IPK' file. The pack to be deleted must not be currently fitted in either slot.

Erase

Syntax: ERASE <packname>ENTER

Erase a '.IPK' file. This is equivalent to formatting a pack in a formatter and then sizing it. The pack to be erased must not be fitted to either of the slots.

Fit

Syntax: FIT <packname> <slot>ENTER

Fit an existing pack to either slot B: or C:.

Remove

Syntax: REMOVE <slot>ENTER

Remove a pack from B: or C:

Translate

Syntax: TRANSLATE [@]<filename>ENTER

Translate either a single '.OPL' file to a '.LNO' file or, if the first character was an '@'. use the command file named <filename> with extension '.TRN' to translate a number of files.

In the command file the first word on each line is taken as the name of a '.OPL' file and the rest of the line is ignored. Progress and errors are reported.

Disk

Syntax: DISK <status>ENTER

Turn DISK ON or OFF. The DISK indicator is covered earlier in this chapter.

Debug

Syntax: DEBUG <status>ENTER

Turn DEBUG ON or OFF. The DEBUG indicator is covered earlier in this chapter.

Dos

Syntax: DOS[ <command line>]ENTER

Allow execution of DOS commands.

If the DOS command is issued alone then the screen is cleared and DOS is invoked. To return from DOS to the emulator type EXIT. If a DOS command line is issued at the same time as the DOS command, then that command is executed. After termination of that command, control is automatically returned to the emulator after a "Press any key to continue..." message.

For example, to redirect the output from LPRINT first enter the emulator command mode, then type:

DOS MODE LPT1:=COM1

which runs the DOS command 'MODE' to redirect any LPRINT output from the parallel port LPT1 to the serial port COM1.

It is possible to 'pass through' from the emulator to DOS and then run the emulator again by typing ORG2ENTER. This is not recommended as it may easily lead to confusion.

Help

Syntax: HELP[ <parameter>]ENTER

Show a list of the keys and commands available. Further help is available by typing the first 3 letters of the options shown after the HELP command is used. The HELP command may also be given the parameter directly. The parameter must be one of the emulator commands listed above - including HELP itself.

Quit

Syntax: QUITENTER

Quit from the emulator to DOS. Any data stored on device A: is lost when you QUIT from the emulator with this command. Any packs currently fitted when this command is issued are automatically removed before quitting.


3 THE SCREEN EDITOR

The Organiser Programming Language, OPL, is found under the usual PROG option in the emulator's top level menu. When PROG is selected, the usual menu is presented, but from here onwards the emulator and the real Organiser differ.

When either NEW or EDIT is selected from the PROG menu the LCD emulation at the top left of the screen shows just the file name given and the current line number of the procedure being edited. For example, when editing a small procedure called TEST1, the screen might look as in figure 2.

-------LCD------ ----------------------------STATUS--------------------------  | Edit:TEST1 || F1:Del Ln F2:Exit F3:Top/Bot F4:Paste F5:Mark F6:Cut | | Line:1 || F7:Search F8:Rplce F9:Lft Wrd F10:Rgt Wrd Shft F10:Other| ---------------- ------------------------------------------------------------  ---------------------------------EMULATOR COMMAND-----------------------------  | TEST1: | | LOCAL c% | | OPEN "A:MAIN",A,A$ | | DO | | IF c%<RECSIZE | | c%=RECSIZE | | ENDIF | | NEXT | | UNTIL EOF | | CLOSE | | PRINT "Largest record" | | PRINT "is ";c%;" bytes" | | | | GET | | [EOF] | | | ------------------------------------------------------------------------------

Figure 2 The Screen Editor

This is known as the screen editor. As you move around the procedure, the top left area of the screen shows the number of the line which is currently being edited. Note that the procedure name is protected, just as in the real Organiser. To change the name of a procedure, use the COPY option in the PROG menu to make a new copy under a new name and then delete the original.

This editor provides all the basic line editor facilities. However, if the user prefers, procedure files may be edited using any ASCII text editor either before running the emulator or by using the DOS command. To produce the object code (the '.LNO' file), the file can either the translated with the TRANSLATE command or the procedure can be loaded, translated and saved by the screen editor.

The first line of the screen editor display shows the name of the procedure being edited. The bottom line shows an end of file marker ([EOF]). The cursor keys may be used to move around the current buffer. The keys shown below have the following uses.

HOME Move cursor to left of current line
END Move cursor to right of current line
PG UP Scroll up one screen
PG DN Scroll down one screen

FUNCTION KEYS

The top right area of the screen shows the uses of the function keys. These are:

F1 Delete Current Line

Delete the current line, wherever the cursor is positioned in that line.

F2 Exit

Exit to the usual TRAN SAVE QUIT menu. This is equivalent to pressing the MODE key during editing on the real Organiser. At this point you may press F4 to return to the emulator command mode and, for example. turn DISK ON or OFF.

F3 Top/Bottom Of Buffer

Move the cursor to the top of the buffer or, if it is already at the top, move it to the bottom of the buffer.

F4 Paste

Insert the contents of the paste buffer before the start of the current line. If the cursor is positioned in the middle of a line, the contents of the paste buffer will still be inserted before that line.

F5 Mark

Mark the position of the start of a block of text to be cut.

F6 Cut

Cut all text between the previously placed mark (see above) and the current line, including the current line, and place it in the paste buffer. Only whole lines may be cut.

F7 Search

Search forwards from the current cursor position for a specified text string. When F7 is pressed, the top right area of the screen prompts for the search string. When you type the string and press ENTER the cursor moves to the first occurrence of that string unless the string cannot be found between the cursor position and the end of the buffer.

If the string is found, you are prompted to continue searching (press C) or stop searching (press X).

The search is case independent.

F8 Replace

Search forwards from the current cursor position for occurrences of a given text string and optionally replace that string with another. When F8 is pressed, the top right of the screen prompts for the string to be replaced and then for the string to replace it by.

When you type the string and press ENTER the first occurrence of the string is found and you are offered three options: press C to continue searching without replacing the string; press R to replace the search string with the new string and continue searching, or press X to stop searching.

The search is case independent.

F9 Word Left

Move the cursor one word to the left.

F10 Word Right

Move the cursor one word to the right

SHIFT F1 Restore Line

Restore the line most recently deleted with F1. Inserts the line before the current line regardless of the cursor position in that line

SHIFT F2 Swap Buffers

Swap from one buffer to the other. The screen editor has two buffers, each of which may be used to edit text. Initially the second buffer is empty. When the second buffer is selected. the EDITOR STATUS area at the top left of the screen shows the indicator 'Buffer'.

This alternative buffer may be used, for example, to write or edit '.TRN' and '.BLD' files as described in Chapter 5.

SHIFT F3 Merge

Merge a file into the current buffer before the line where the cursor is currently positioned. When SHIFT F3 is pressed. the top right area of the screen clears and prompts for the file name to be merged into the current buffer. A valid file name, including the file extension, may then be entered, with a DOS directory path if required.

SHIFT F4 Save Current Buffer

Save the contents of the current buffer as an ASCII file. When SHIFT F4 is pressed, the top right of the screen prompts for the name which the current buffer should be saved under. A valid file name, including the file extension, may then be entered with a DOS directory path if required.

SHIFT F10 Other

Toggle the display of function key uses between unshifted and shifted effects.

.LNO & .OPL FILES

When the SHIFT F4 option in the screen editor is used to save the contents of the current buffer, the file name IS not given a default extension. However, when the F2 ( MODE ) key is used from the main buffer the TRAN SAVE QUIT menu is presented and, if DISK is ON, the following file extensions are given to the file:

SAVEproduces one ASCII file with the extension '.OPL'.
TRANfollowed by SAVE produces the same '.OPL' file plus a '.LNO' file containing the executable object code. The '.LNO' file cannot be edited.

4 THE DEBUGGER

When running OPL procedures on the emulator, the debug facility may be switched on or off. When switched off, procedures run as they would on the real Organiser with all screen activity and memory access operating as determined by the OPL code itself. When switched on, the debugger offers all of the usual language debugging tools, allowing for example tracing to be used and variables to be examined, watched or altered. Procedures can only be debugged if they were translated with the DEBUG indicator set to ON.

APPEARANCE

When DEBUG is ON and a procedure is run which has been translated with DEBUG ON, the screen divides into four areas as in figure 3.

-------LCD------ -------------------------DEBUG COMMAND----------------------  | || Running OPL debugger | | || ? | ---------------- ------------------------------------------------------------  ---------------------------------------SOURCE---------------------------------  | TEST1:1 TEST1: | | TEST1:2 LOCAL c% | | >TEST1:3 OPEN "A:MAIN",A,A$ | | TEST1:4 DO | | TEST1:5 IF c%<RECSIZE | | TEST1:6 c%=RECSIZE | | TEST1:7 ENDIF | | TEST1:8 NEXT | ---------------------------------------DEBUG----------------------------------  | | | | | | | | | | | | | | ------------------------------------------------------------------------------

Figure 3 The Debugger

The LCD Screen

The top left area of the display operates in the same way as the LCD on the real Organiser and will display any data printed to the screen in the usual way.

Debug Command Area

The top right area of the screen is the debug command area and shows the message 'Running OPL Debugger' and a '?' prompt at which a debug command may be entered. See the list of debug commands later in this chapter.

Source Code Display

The central area of the screen is the source code display. This shows the line of OPL currently being executed and the lines surrounding it. The current line is indicated at the left by the '>' marker.

Debug Display

The lower area of the screen is the debug display, which is used to display the output of some of the available commands For example, if you press H ENTER the HELP option will display the full list of commands available in the debugger on the top two lines of the debug display

DEBUGGER COMMANDS

The following commands are available in the debugger. Note that some of these are available in shortened form as follows:

F1 Break into a running OPL program provided it is not executing a GET, KEY, MENU or INPUT instruction
F2 Display another '.OPL' file
F3 Help
F5 Step to the next instruction, or into a procedure
F6 Step to the next instruction in the current procedure
F7 Go - execute instructions continuously until the next break point
F10 Set a temporary break point - deleted after single use
 ↑ Move the cursor up a line in the source window
 ↓ Move the cursor down a line in the source window
PG UPScroll the source code one screen up
PG DNScroll the source code one screen down

See the relevant items in the following list for a full explanation of the commands.

In the command descriptions, the following syntax is used:

<procname> up to 8 alphanumeric characters starting with a letter
<variable name>[<procname>:]<name> where <name> is up to 8 alphanumeric characters starting with a letter
<string> up to 254 characters
<number> a number of up to 4 digits

Square brackets indicate optional command parameters, vertical bars (|) indicate possible choices between command parameters.

Break Points

Syntax: B[<procname>[:<number>>]]ENTER

Set a break point in any procedure either on entry (by entering just the procedure name) or on any particular line. No checking is done that the procedure or line number exists.

Up to 8 break points may be set at any one time. This includes temporary break points which are described later in this chapter.

Typing "B" on its own gives a list of the current break points. Break points may be deleted by entering them exactly as they were first entered.

Catalogue

Syntax: CENTER

Show a list of all '.OPL' files on the disk.

Deposit

Syntax:D[<procname>:]<variable name>ENTER
<string>ENTER

Alter any variable except field variables. If the string does not contain the right type of data for the specified variable an error is reported and the previous value remains unchanged.

Examine

Syntax: E[<procname>:]<variable name>ENTER

Examine the value of any variable in any procedure. For example to find the current value of the variable C% in the procedure TEST1:, type:

E TEST1:C%

at the debugger command prompt. If you do not specify a procedure then the command looks for the first instance of that variable.

Go

Syntax: GENTER

Continue the program execution from the current position. If TRACE is ON, each instruction is displayed as it is executed. The procedure will pause and return control to the debugger if a break point is reached, a watched variable changes, an untrapped error occurs, or F1 is pressed (other than in a GET, KEY, MENU or INPUT statement).

Help

Syntax: HENTER

List all the options available.

Procedures

Syntax: PENTER

Show the procedures above the current procedure in the calling structure with their current line number.

Quit

Syntax: QENTER

End execution of the OPL program.

Single Step

Syntax: S[/I|/R]|<number>]ENTER

Execute a single statement; if followed by a number, execute that number of statements. By default this steps over procedure calls. "S/I" will step into a procedure.

The "/R" option continues program execution until the current procedure is exited or the execution of OPL breaks for any reason.

Trace

Syntax: TENTER

Toggle the trace flag. If TRACE is ON, the source of the code being executed is displayed, as it is executed. Note that, when executing OPL, pressing F1 (except during a GET, KEY, MENU or INPUT instruction) returns control to the debugger.

Variables

Syntax: V[<variable name>]ENTER

List all, or a subset of, the variables currently available. For example "V ABC*" will list all variables starting with the letters ABC. Typing "V" lists all current variables and typing "V *.*" lists all field variables, since only field variables have the '.' character in their names.

Watch

Syntax: W[<variable name>]ENTER

Set watch points on up to 4 variables, excluding field variables. The variables are checked after each statement and the program will pause and return control to the debugger if any of them have changed. A slight degradation in running speed is to be expected when using this command.

Typing "W" on its own gives a list of the current watch points Watch points may be deleted by entering them exactly as they were first entered.

F2 Display

Display another '.OPL' file. While the file is displayed, you may set temporary break points in it.

To return to the current procedure, press F2 ENTER

F10 Temporary Break Points

Temporary break points may be set at the current position in the currently displayed procedure by pressing F10. Temporary break points are deleted after being reached.


5 DEVELOPMENT UTILITIES

The following syntax is used in the chapter:

<packname> up to 8 alphanumeric characters starting with a letter
<filename> up to 8 alphanumeric characters starting with a letter
<newname> up to 8 alphanumeric characters starting with a letter
<size> 8, 16, 32, 64 or 128
<separator> any character
<comment> any number of characters

Square brackets indicate optional command parameters; vertical bars (|) indicate possible choices between command parameters.

All of the following utilities are called from DOS.

THE OPLTRAN UTILITY

Syntax: OPLTRAN [@]<filename>[ -s| -o| -t]ENTER

The OPLTRAN utility translates OPL source code files, which have extension '.OPL', to Organiser format files with extension '.OB3'. These files can be downloaded via COMMS LINK to the Organiser or built with BLDPACK into a Datapak image.

If OPLTRAN is followed by an '@' then a command file with extension '.TRN' is used. This command file consists of the file names of a number of source code files to be translated. The file extension '.OPL' should not be specified in these file names as it is assumed.

Three flags are available to control the outputs produced:

-s source only
-o object only (default)
-t source and object

Progress and errors are reported as the files are translated.

THE BLDPACK UTILITY

Syntax: BLDPACK @<filename>[ -i][ -map]ENTER

The BLDPACK utility allows a Datapak image to be built for use on either an Organiser or the emulator. The Datapak can contain bootable code, binary data, OPL procedures and database files.

To use this command, the <filename> specified must exist with the extension '.BLD'. This must be an ASCII file containing the list of files to be built into a pack.

The optional flag '-i' turns the output from being for the Organiser to being for the emulator. The output from this command is a '.OPK' file, or a '.IPK' file if the '-i' flag was used.

The first line of the '.BLD' file takes the following format:

<packname>[ <size>][ COPY| NOCOPY][ WRITE| NOWRITE]

where <packname> is the file name of the Datapak produced. If <size> is specified it is the size of the pack generated. Otherwise the pack size is the smallest pack onto which the data will fit. If the data will not fit in 128K or the size specified, further packs will be generated; the file name of the first pack will have '0' appended to the <packname> specified, the second pack will have '1' appended, and so on. The other options are to make the pack copy protected (NOCOPY) and write protected (NOWRITE). The defaults are COPY and WRITE.

The second line of the '.BLD' file, which is optional, includes a binary file which might, for example, make the pack bootable. This line takes the format:

<filename> bin[ !<comment>]

The code file is always of type '.BIN'. The file should contain a pack header and, in general, follow the pack structure conventions. The header bytes are followed exactly when blowing the pack except for the size byte and the PAGE/NOPAGE, EPROM/Rampak, WRITE/NOWRITE and COPY/NOCOPY bits which are taken from the hardware or from the first line of the '.BLD' file instead.

As an example the file BOOT.BIN is provided which, when booted on the Organiser, attempts to run an OPL procedure called BOOT every time the machine is re-booted. For details of the pack structure and bootable format refer to the "Organiser Technical Manual". Note that the bootable option is not available if the '-i' flag is used.

If no '.BIN' is included, a standard header is put down at the start of the pack.

Subsequent lines contain the other files to be included on the pack within the pack structure. These files may be database, or binary image files. In all the following cases, the file created on the pack will have the same name as the <filename> specified unless <newname> is given.

For database files the line format is:

<filename> odb [<newname>][,<separator>][ !<comment>]

The database file has extension '.ODB' and should be in ASCII format, with one line per record and field delimited by TABs or by the given separator.

Image files may be included if the target is the Organiser (in other words, no '-i' flag was used). The line format is:

<filename> <obx> [<newname>][ !<comment>]

<obx> is a file extension in the range '.OB2' to '.OBF'. which covers all Organiser image files. See the Appendix for a full list of these extensions. '.OPL' files cannot be included directly; they must be convened to binary image files by using the OPLTRAN utility.

If the '-i' flag was used then '.LNO' files (OPL object code for the IBM PC) are the only image files which may be included. The line format is:

<filename> lno [<newname>][ !<comment>]

As the build proceeds the status and any errors are reported. This information can be written to a file at the same time by using the '-map' flag. The map file produced will have the extension '.MAP' and the same file name as the pack which is being built.

Below is an example of a '.BLD' file which, when used with the BLDPACK command, will produce a 16K non-copyable Datapak containing one data file called TABLE and two procedures called RUN and RUN2 (taken from the files PROC1.OB3 and PROC2.OB3). The resulting pack will be made for the Organiser and have the file name EXAMPLE.

The '.BLD' file is as follows:

EXAMPLE 16,NOCOPY TABLE ODB ! Data file PROC1 OB3 RUN ! First procedure PROC2 OB3 RUN2 ! Second procedure

and to build the pack you should type from DOS:

BLDPACK FNAMEENTER

where FNAME is the file name of the '.BLD' file.

THE MAKE UTILITY

Syntax MAKE <packname>[<baud rate>]ENTER

The MAKE utility allows '.OPK' files created on the PC with the BLDPACK utility to be downloaded directly to a Datapak or Rampak in slot C: on an Organiser, via the COMMS LINK package.

<packname> is the name of the '.OPK' file on the PC. The optional Baud rate should be the same as the Baud rate set on the Organiser. The options are 9600, 4800, 2400, 1200, 600, 300, 150, 110, 75 and 50 Baud. The default, both on the Organiser and in the MAKE command, is 9600 Baud.

It is worth using an Organiser power supply when using MAKE as the power drain when running both COMMS LINK and blowing the pack (unless it is a Rampak) is substantial.

To use this utility you must first link the PC and the Organiser with the COMMS LINK cable, as described in the COMMS LINK manual. Then issue the MAKE command with the appropriate packname and, unless you are using 9600 Baud, the Baud rate desired. You will then be prompted to select the BOOT option from the COMMS menu on the Organiser. When this has been done the Organiser will prompt with "NAME: "; simply press the EXE key. After this point all prompts and messages appear on the IBM PC screen. For a few seconds the message "Loading..." will be displayed. Then the prompt:

Place unsized pack in C:, then press a key

will given. When a newly formatted but unsized pack has been inserted in C:, press any key on the PC. The specified '.OPK' file will then be downloaded directly to the pack on the Organiser. On a Datapak. as opposed to a Rampak, this may take some time.

The PC will then display the message:

Pack successfully made Do you want to make another pack (Y/N) ?

If you press Y you will be prompted again to insert a blank pack in slot C:. Alternatively, press N to return to DOS.

Possible errors which may occur during MAKE are:

No Link The link between the Organiser and the PC has not been correctly established
No Pack In Slot No pack has been inserted in the lower slot on the Organiser (device C:)
Pack Not Blank The pack contains old data and should be reformatted
Write Error The data cannot be written to the pack; ensure the pack is correctly fitted
Pack Too Small The pack in device C: is too small to accept the data in the specified '.OPK' file

All of these errors will end the attempt to blow that pack. In the case of a "No Link" error you will have to start again; in the other cases you will be given the opportunity to blow another pack.

If the pack is different in size to that specified in the '.OPK' file but there is enough room for the data then the message:

WARNING: PACK IS DIFFERENT SIZE

is given.

If for any reason you wish to abort the transfer, the safest way is to pull the COMMS LINK cable out of the Organiser

THE UNMAKE UTILITY

Syntax: UNMAKE <packname>[ <baud rate>]ENTER

The UNMAKE utility is roughly the opposite of MAKE. It loads an entire Datapak into the IBM PC as a '.OPK' file and, if requested, will break the pack up into its constituent parts.

<packname> is the name of the '.OPK' file to be generated on the PC. The optional Baud rate should be the same as the Baud rate set on the Organiser. The options are 9600, 4800, 2400, 1200, 600, 300, 150, 110, 75 and 50 Baud. The default, both on the Organiser and in the UNMAKE command, is 9600 Baud.

To use this utility you must first link the PC and the Organiser with the COMMS LINK cable, as described in the COMMS LINK manual. Then issue the UNMAKE command with the appropriate packname and, unless you are using 9600 Baud, the Baud rate desired. You will then be prompted to select the BOOT option from the COMMS menu on the Organiser. When this has been done the Organiser will prompt with "NAME:"; simply press the EXE key. After this point all prompts and messages appear on the IBM PC screen. For a few seconds the message 'Loading...' will be displayed. Then the prompt:

Place pack to be loaded in C:, then press a key

will be given. When the pack has been inserted in device C:, press any key on the PC. The contents will be loaded into a '.OPK' file with the specified name.

The PC will then display the message:

Pack successfully loaded Do you want to break the pack into parts (Y/N) ?

If you press N you will be returned to DOS. If you press Y, a separate file will be created on the IBM PC for each file on the pack. If any files would be empty then they are ignored. Any files with the same name and extension as the files on the packs will be overwritten. If you are in doubt as to the contents of a pack it is worth creating a temporary subdirectory on your IBM PC, and loading the files into there.

Possible errors which may occur during UNMAKE are:

No Link The link between the Organiser and the PC has not been correctly established
No Pack In SlotNo pack has been inserted in the lower slot on the Organiser (device C:)

All of these errors will end the attempt to load the pack.


APPENDIX A

FILE EXTENSIONS AND FORMATS

OPL source code (ASCII) .OPL
OPL object code for IBM PC .LNO
IBM PC Datapak image .IPK
Organiser Datapak image .OPK
Object code (binary) .BIN
Database file (ASCII) .ODB
Translate command file (ASCII) .TRN
Build command file (ASCII) .BLD
Diary file .OB2
OPL source/object code for Organiser .OB3
COMMS LINK setup file .OB4
Spreadsheet file .OB5
Reserved by PSION .OB6-7
Unspecified .OB8-F
Organiser database file .ODB

All Organiser files on the IBM PC which are not ASCII start with a six byte header. The first three bytes consist of the file extension in ASCII, just as it is listed above.

The formats of '.IPK' and '.OPK' files are byte by byte the same as real Datapaks except for the 6 byte header. The first three bytes are the extension, and the next three bytes are the current size with the most significant byte at the lowest address)

'.ODB' files are in ASCII format with one line per record, and field delimited by TABs or by some other separator.

For more details of the formats see the File Transfer Procedures section in the COMMS LINK manual, and the Organiser Technical Manual.