



        X.      Convert.

CONVERT



NAME
        convert - convert assembly code to use "fpsim"
SYNOPSIS
        convert file
        -------
DESCRIPTION
        CONVERT edits  <file>.s  (which  should  be  an  assembly
language  program).   Specifically,  It  precedes  all  (assembly
language)  floating  point  instructions  by  "  jsr   pc,fpsim".
"fpsim"   is   an  entry  point  in  subfile  "fp.o"  of  archive
"/lib/liba.a".  Fpsim interprets the word  following  the  "  jsr
pc,fpsim"  as   a  floating  point  instruction and simulates the
action of that instruction.  The simulation uses the "fp.o"  code
that  would  have been used anyway if the floating point instruc-
tion were executed on a pdp 11/40 (causing a trap to that code).
Notes:
        The  resulting  file  is  written  onto  the  input  file
(<file>.s).
        Mnemonics will only be acted upon if  preceded  and  fol-
lowed  by:  <a  space>  or  <a tab> or <the beginning or end of a
line>.

FILES
        fort/commands/convert
        fort/s3/fp.s

SEE ALSO

BUGS
        DISCLAIMER:  this program was written under the
assumption that it's use would be a one-shot affair
upon a specific program style.
Therefore,
no attempts were made to smooth out bugs that could be lived with.
However, it was felt that this code might at least set
on the right track anyone
with a lot of conversions to make.
        1.  If <file>.s contains no ".globl" statements
(may occur if a large file is broken into several subfiles for
ease of editing)
then the search for "?.globl?" fails,
terminating the command file.
To catch this problem, look for a "?" in the output of the convert
run.
If one relies upon an examination of <file>.s,
one should be aware that the header may have been added to the file,








yet the " jsr pc,fpsim" statements will not actually have been
inserted.
        2.  It is possible for a " br ..." statement
to become too far away from its destination due to the added
" jsr pc,fpsim"s.
When such a file is assembled,
the assembler will respond with a "b" error.
Caution:  an executable "a.out"
WILL be produced (but the branch address will be 0),
so the existence of "a.out" is  no guarantee of success.
The solution is to convert such " br"s to " jbr"s.
        3.  Mnemonics used elsewhere will be acted upon.
Watch out for comments in program--if a comment becomes preceded by
" jsr pc,fpsim", disaster could occur.
        4.  If there are two instructions on one source line,
the second won't be checked.








































