home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
develop, the CD; issue 1
/
Apple_Develop_1989.bin
/
dynamo
/
buildapp.manual.text
< prev
next >
Wrap
Text File
|
1989-12-10
|
34KB
|
816 lines
Getting started: Setting up the DYNAMO cross-development system:
Step 1: Copy the DYNAMO folder onto your Macintosh. Then rename
the folder to indicate the project.
Step 2: Create a ProDOS disk. It should be initialized at a 4:1
interleave. ProDOS should be copied onto it (get the ProDOS file from a
bootable ProDOS 8 disk, or get the P8 file from the System folder of a
GS/OS disk and rename it to ProDOS on the floppy). The
BUILDAPP.SYSTEM and BUILDAPP.TEXT files (found in the folder
prodos.stuff) should be copied to the ProDOS disk via Apple File
Exchange or copied over a server. When copied to the ProDOS disk, the
filetype/auxtype of BUILDAPP.SYSTEM should be $FF/$0000, and the
filetype/auxtype of BUILDAPP.TEXT should be $04/$0000.
Step 3: Start MPW by clicking on any of the source files in the project
directory. Do a full-build of SAMPLE. When prompted, insert the ProDOS
disk.
Step 4: Insert the ProDOS disk into the Apple II (or IIGS). Boot it.
(Or double click on BUILDAPP.SYSTEM from the finder.)
You should now be running the DYNAMO sample application. This sample
is simply an exerciser of the DYNAMO runtime routines. It tests the routines,
and also the source code demonstrates using the runtime and macro
libraries.
Now, for more detail:
The BUILDAPP.SYSTEM program allows the developer to build a
multiple-segment application into one program file, and to launch it simply
on the //e. Segments are automatically relocated to appropriate banks of
memory, and then the application is launched starting at any address in any
bank chosen.
BUILDAPP.SYSTEM uses a text file as a script for building the application.
The default name for this text file is BUILDAPP.TEXT. This can be
changed by modifying the pathname in the program BUILDAPP.SYSTEM.
The pathname starts at the sixth byte of the file, memory location $2006 if
BLOADed. The pathname is a pascal string. (This is the standard ProDOS
way of giving the launched application a pathname.)
To use the BUILDAPP.SYSTEM program, you will need a disk with
ProDOS, the BUILDAPP.SYSTEM program, a build script file called
BUILDAPP.TEXT, and all the segments of your application on one disk.
This disk is now bootable. When the disk is booted, BUILDAPP.SYSTEM
will construct a single executable block of code starting at address $2000.
Then it will prompt you as to whether or not you want to save this image.
During development, you will often choose not to save it, since it takes just
that much longer to get the application executing. Then you can test your
latest addition or change to your application. To make a bootable disk
without BUILDAPP.SYSTEM, you just save the application image to disk
when prompted, and then copy the application to a disk with just ProDOS
on it. If the application name ends with .SYSTEM, and it has a filetype of
$FF, you have a bootable application.
You may wish to develop on one machine, which writes the segments to the
ProDOS disk, and then just boot the disk on another machine. This saves a
lot of time booting into your development environment. There is also the
advantage of always being able to look at the most current source while
executing the program. You don't need two machines to develop, but it will
definitely speed up the add/change/test development cycle every
programmer goes through.
How the application is build depends on the BUILDAPP.TEXT script file.
Here is the explanation of this file:
The first line of the build script is the pathname that will be placed at $2006
of the application. You may have no need for this, but if you are
developing a system application, launchers may place a pathname there, and
you may want a default.
Lines 2-N are for the segments to be loaded. The first field is the mode
byte. Bits 0-2 of the mode byte indicate what bank of memory the segment
should be transferred to at execution time.
Bit 0 indicates ROM or language card. Off for ROM, on for language card.
Bit 1 indicates which language card (if bit 0 is on). Off for primary
language card, on for auxiliary language card.
Bit 2 indicates 1st or 2nd $D000 bank of language card. Which language
card is still indicated by bit 0 and 1. Off selects the secondary $D000 bank
($C083), and on selects the primary $D000 bank ($C08B).
Bit 3 indicates primary or auxiliary 48k. Off for primary, on for auxiliary.
Bit 4 indicates that the auxiliary stack pointer should NOT be initialized. If
you load a block of code or data into the auxiliary language card, the
auxiliary stack pointer is initialized to $FF unless you indicate otherwise by
setting this bit on.
Bit 7 of the mode byte being on indicates the end of the segment list. Bits
0-3 still indicate a bank of memory, and the following field indicates the
launch address within that bank.
The second field is the load address. This is the address the segment will be
moved to at execution time.
The third field is the name of the segment itself. This can be a full or partial
pathname.
The next two lines indicate whether you want hex or decimal information
indicating starting address and total application size.
The final line indicates the application filetype, auxtype, and filename. The
application builder will ask if you want the application saved. After the file
is saved (or not), the application is launched for testing.
All numeric fields can be decimal or hex.
The below is a sample build script that was used to make the application
builder itself.
There is only one segment for this application. The runtime was linked into
the main code module, generating only one binary code segment.
BUILDAPP.TEXT ;The default script filename.
0,$800,BUILD.BIN ;The buildapp application.
$80,$800 ;Starting address.
$ ;Display starting address in hex.
$ ;Display application size in hex.
$FF,0,BUILDAPP.SYSTEM ;Filetype, auxtype, and filename.
The BUILDAPP.TEXT file can be up to 2045 bytes long.
Bank switching will still have to occur within the application, as necessary.
There is no getting around that on a //e. BUILDAPP.SYSTEM is to
simplify the loading and starting of an application, by making it a single,
launchable file.
Below are the macros included in the runtime, and their basic usage:
____________________________________________________________
_
OPERAND USAGE:
If the operand represents an integer variable or string, then you do not put a
# in front of it. Variables and strings are always either a ldx literal, or a ldy
literal, so the # is assumed. When the macro is expanded, the # is put there
automatically.
If the operand represents a value, then you will need to put a # or an * in
front of the operand. If you put a # in front of the operand, then it is a
literal. If you put an * in front, then it uses the value at that address. This
is similar to the C unary operator *.
These macros are interfaces for the runtime routines associated with them.
The runtime routines handle up to 128 integer variables, and up to 256
strings. The runtime also has multi-dimension array support. The integer
functions are simple add,sub,mul,div, and others. These others include
mass-initialization, min, max, print decimal, etc. The string functions are
most of what is available in AppleSoft, in various forms. The array
functions are used to define a base pointer to a row of dta within the array,
and then to index into and out of that row.
The principle of the runtime routines is that the xreg holds a destination
variable number (for ints: 0-254, for strings: 0-255). All runtimes preserve
the xreg, therefore, you can do multiple operations to a single variable
without having to reload the xreg. The values that are used on the xreg
variable (the source data), is one of 3 forms for integers:
1. 1-byte value
2. 2-byte value
3. 2-byte integer variable.
1-byte values are placed in the acc. 2-byte values are placed in the acc,y
(acc=lo, y=hi). 2-byte integer variables have the variable number placed in
the yreg. (The yreg is not preserved by the runtime routines.) Once the
source