home *** CD-ROM | disk | FTP | other *** search
-
- FixFD v1.0
- User Manual
-
- Copyright (C) 1988 by Peter Wyspianski
-
- [31 Dec 88]
-
-
- ----------------------
- Please Read The Manual
- ----------------------
-
- The FixFD utility is not complicated, but please take a couple minutes to
- read through this manual before you try it. Thanks!
-
-
- --------
- Abstract
- --------
-
- FixFD is a utility for the Amiga series of computers that reads an '.FD'
- file to produce an assembler 'include' file.
-
-
- -----------
- Legal Stuff
- -----------
-
- Amiga is a trademark of Commodore-Amiga, Inc.
- The author is in no way connected with Commodore-Amiga, Inc.
-
- The FixFD utility package, consisting of the program and documentation file,
- is copyrighted. Permission is granted for NON-COMMERCIAL distribution of
- UNMODIFIED copies of the entire package. All other rights are reserved.
- Distribution of separate parts of the package, or of modified copies is
- specifically prohibited. Failure to abide by these rules may result in a
- fine, and/or jail term. Additionally you may get a guilty conscience and
- I certainly won't visit you. Pass the word, pass this program!
-
-
- -----------------------
- Who Needs This Utility?
- -----------------------
-
- If you are an Amiga assembly language programmer (or want to be), then read
- on. Otherwise, this utility is NOT for you (sorry)!
-
-
- -----------
- The Problem
- -----------
-
- When you're programming in assembly language, the most common way to define
- a 'Library Vector Offset' (LVO) is to use the XLIB macro like so:
-
- XLIB Open ; DOS.Library
- XLIB Close ; DOS.Library
-
- where the 'XLIB' macro looks something like this:
-
- XLIB macro ; <routine name>
- xref _LVO\1
- endm
-
- so by the time the assembler has sorted out those first couple of
- definitions
- here is what you got:
-
- xref _LVOOpen
- xref _LVOClose
-
- Later on in the program you may want to call the 'Open' routine:
-
- move.l DOSBase,a6
- jsr _LVOOpen(a6)
-
- Of course most of us use a macro for those lines. But here is a question -
- just where IS the actual value of the symbol '_LVOOpen' defined? It is
- defined in the scanned library 'Amiga.Lib'!
-
- The problem is that Amiga.Lib is about 80K bytes long, and contains a LOT of
- things besides the _LVO definitions. Having the _LVOs defined in Amiga.Lib
- requires that you ALWAYS link your code with Amiga.Lib. This effectively
- neutralizes assemblers that produce loadable object files. It also makes
- for some very long link times.
-
-
- ------------
- The Solution
- ------------
-
- The ideal solution to the problem of having the LVOs defined in Amiga.Lib
- is to just equate them to their proper values:
-
- _LVOOpen EQU -30
- _LVOClose EQU -36
-
- Now you don't have to link with Amiga.Lib and the assembler will probably
- get done a bit sooner as it doesn't have to do as much work. To get these
- equates you simply use FixFD!
-
-
- ------------
- What It Does
- ------------
-
- The Extras disk includes a drawer called 'FDx.x' (where x.x is the operating
- system revision, currently '1.3'. Within this drawer are a number of files
- whose names end with '.FD'. These '.FD' files all have a standard format.
- They completely define all the LVOs within a particular library. The '.FD'
- files are updated with every new revision of the operating system.
-
- FixFD simply reads an '.FD' format file and cranks out a file that your
- assembler can read (using 'INCLUDE'). And thats all there is to it!
-
- You have a lot of choices when it comes to putting the resultant 'include'
- files to use. Adding a bunch of 'INCLUDE' statements is one possibility.
- Or you could merge them into one big include file. If your assembler
- supports 'preassembled symbols' then you can preassemble the LVO file(s)
- for lightning assembly speed!
-
- I like to have all the LVOs in one big file. That way I can use the cut-
- and-paste features of my text editor to put just the LVOs I need right into
- the assembly file I'm working on.
-
- There is probably a utility somewhere out there that does exactly the same
- thing as FixFD. Too bad I haven't seen it (yet)! So here is my contribution.
- Incidentally, it would have been far quicker to write this in something like
- BASIC, but I simply wanted some practice at working with DOS files from
- assembly.
-
-
- -----------
- Using FixFD
- -----------
-
- From the CLI (Command Line Interpreter) or Shell type:
-
- >fixfc source_file dest_file
-
- where 'source_file' is the name of the '.FD' file you want to read
- and 'dest_file' is the name of the new file you want to make
-
- You can use an asterix ('*') for the dest file, to send output to the CLI
- window. In that case the fancy line number display is suppressed so it
- doesn't tangle up the output.
-
- FixFD can be aborted in the usual way (ctrl-c). And if you forget one of
- the file names (or use '?'), you get a little blurb reminding you what to do.
-
- It DOESN'T work from WorkBench so don't try it (crashes the system). I could
- make it WorkBench compatible but why bother?
-
- Thats about it. I sure hope you like it!
-
-
- --------------------
- So How Does It Work?
- --------------------
-
- [This section is for the curious; it may be safely skipped by others.]
-
-
- FixFD scans each line of the input file looking for one of the following:
-
- ##bias xx
-
- Where xx is a decimal number 0-65535. Sets the base from which subsequent
- LVOs are calculated. Defaults to zero. The usual value is 30.
-
- <LVO name> <whatever>
-
- An LVO name is any line that starts with one of these characters:
-
- a-z, A-Z, period ('.'), underline ('_')
-
- When an LVO name is found, the line is scaned for an open paren ('(') or
- space. If one is found, the line is chopped from that point on. In any
- case, the LVO name is written to the dest file with the prefix '_LVO'.
- Following the name is a tab, the word 'equ', another tab, and the decimal
- offset of the LVO.
-
- All other lines (including blank lines, and lines beginning with ';' or '*')
- are ignored.
-
-
- -------------------------
- Send Postcards Not Money!
- -------------------------
-
- The Author enjoys getting mail. Especially picture post cards. If you like
- this program, hate it, or want to see some improvements, please send me a
- post card:
-
- Peter Wyspianski
- 5-10A Brock Cres
- Kingston, Ont
- CANADA K7K 5K6
-
- Don't bother sending money. However, all offers of employment will be
- seriously considered.
-
-
- -----------------
- End of the Manual
- -----------------
-
- Congradulations on having read this far. Current research indicates that
- you are one of only 9.23% of users who bother to read the manual.
-
-
- -------------------------
- Technical Details/Credits
- -------------------------
-
- FixFD is written in M68000 Assembly Language. Total development time was
- about eight hours, including writing this doc file. I had to write most of
- the DOS file code from scratch. I already had the decimal conversion and
- formatting routines.
-
- Some of the better products used in the development of this utility include:
-
- CAPE 68010 Assembler (Inovatronics)
- BLink (Software Distillery)
- Uedit (Rick Stiles)
-
- (The preceeding was an unsolicited endorsement).
-
- Special Thanks: Sharon W.
-
-
-
-