print, fopen, fread, ...). Similarly, the Qedit calculator makes calls to both the Robelle low-level library and the MPE library.
Object-code format
We had a theory that object-code files were the same on MPE/iX and HP-UX, but we needed to verify that. To show this was the case we compiled a small
SPLash! program on MPE, copied the object-code to HP-UX, linked the object-code, and ran the resulting program. Our first test program just called the HP-UX “puts” routine to print a string.
We compiled the program using SPLash! and copied the resulting object-code to
HP-UX with these commands:
:splash testsrc,testobj
:dscopy testobj to /users/bob/test.o:hpuxdev[user:pass]
The HP-UX command for linking is called ld. To link our example program, we used the command $ ld /lib/crt0.o test.o /lib/libc.a
This linked the three files /lib/crt0.o, test.o, and /lib/libc.a. The first file is /lib/crt zero dot oh (don’t mix up the zero and the oh), which is the C run-time startup library. The test.o file is the SPLash! object-code generated on MPE. The /lib/libc.a file is one of the HP-UX run-time libraries. Like most HP-UX command names and commands, everything must be in lower case
By default, the ld command creates a program file called a.out. To run this program, we only had to type its name (like using implied run on MPE/iX). We tried running the resulting program and got:
$ a.out {run our sample program}
Hello, World! {result of running a.out}
This was exactly what we expected. The buffer that we initialized with “Hello,
World!” was printed out on stdlist and the program stopped. We had now answered one of our most basic questions — we could compile programs on MPE, copy the object-code to HP-UX, link the object-code into a program and run it on HP-UX.
Floating-Point Numbers
In MPE, we use the compiler-library routines hpinext and hpextin to convert floating-point numbers from human-readable form to the internal IEEE format and vice versa. These routines have many options and handle different sizes of floatingpoint numbers. Rewriting these routines would be a lot of work.
Qedit does not use floating-point numbers very often, except in the calculator.
In order to implement the calculator, we would need the functionality of the hpinext and hpextin routines. A search of the man pages revealed no documentation for either routine, although there were other routines to handle floating-point
Migrating a 3000 Application
• 293
HP 3000 Evolution