title: Phar Lap Assembler: I Need information/documentation and binaries if possible
body: <p>I've <a href="https://stackoverflow.com/questions/688241/reverse-engineering-old-paint-programs">inherited</a> a rather old big and complex codebase for a program originally targeted at MSDOS. It turns out that some sections of this program are written in an obscure dialect of x86 assembler called "Phar Lap assembler", after the company and product that produced the assembler program. I've done a fairly deep google search and I'm unable to find either the original assembler program, or any information or documentation about it. (Though I have found some rather frustrating pages on Experts Exchange of people asking similar questions). </p>
  
  <p>So basically, I won't be able to get this thing to compile until I can either find a copy of PharLap Assembler (386asm.exe), or find enough information about the dialect to translate it to a more "standard" MASM like dialect. Either that, or try to muscle through just figuring it out by reading it.</p>
  
  <p>Alternatively, if none of this is possible, then I just need some help with this problem, and I should at least be able to get one section of the program to compile.</p>
  
  <p>There's a struct declaration in a .c file that looks like this:</p>
  
  <pre><code>//static struct bhash *bhash;
  
  typedef struct bhash_control {
   void   *cachedata;
   Rgb3   *ctab;
   int    rederr;
   int    grnerr;
   int    bluerr;
   ULONG  drgb;   // temp var used by dithering, blackbox to us here
  #ifdef SHOW_STATS
   int calls, hits1, hits2, fhits, misses;
  #endif
   } BhashCtl;
  
  BhashCtl bhashctl;   // global so assembler code can see it.
  </code></pre>
  
  <p>and then there's some assembler that looks like this, which is presumably trying to make the same type declaration so that some assembler code can use the same type:</p>
  
  <pre><code>BhashCtl struct
   cachedata  dd ?   ; pointer to alloc'd cache data area
  ctab    dd ?   ; contains vb.pencel-&gt;cmap-&gt;ctab
  rederr    dd ?   ; error diffusion dithering variables...
  grnerr    dd ?
  bluerr    dd ?
  drgb    dd ?   ; rgb value with dithering rolled in
  
  ;calls     dd  ?    ; cache stats...
  ;hits1     dd  ?    ;   to use these, you also need to
  ;hits2     dd  ?    ;   uncomment a few lines below.
  ;fhits     dd  ?    ;   search for 'bhashctl.' to find them.
  ;misses     dd  ?
  
  BhashCtl ends
  
   extern bhashctl:BhashCtl ; the one-and-only lives in bhash.c
  </code></pre>
  
  <p>this compiles with an error on the last line which looks like this (watcom assembler):</p>
  
  <pre><code>Error! E518: External definition different from previous one
  </code></pre>
  
  <p>So basically, I think what this is saying is that the assembler version of this struct doesn't match the C version of this struct. I've tried a number of different combinations of WORD and DWORD in place of dd in the assembler, but I can't get past this little thing.  Maybe if I could find a way to get these two declarations to match perfectly, my need for information about pharlap would be diminished.</p>
  
  <p>Also, if anyone can think of a better title for this sprawling question, I'm open to ideas.</p>
  
  <p>Edit: Okay it turns out I skimmed over some important info. This is a file originally written for a Phar Lap assembler (which I don't have), that I'm trying to assemble using the watcom assember (wasm). The problem with that particular error, it turns out, is it seems Phar Lap is case sensitive, while watcom isn't. So it sees bhashctl as the same as BhashCtl. Figured this out with the help of my brother in law. I never would have thought of case insensitivity being the cause of that one.</p>