delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/14/05:24:30

Date: Tue, 14 Jan 1997 10:02:19 GMT
Message-Id: <199701141002.KAA02711@mailhost.sm.ic.ac.uk>
Mime-Version: 1.0
To: arthur DOT jones AT nottingham DOT ac DOT uk
From: p DOT dixon AT ic DOT ac DOT uk (Paul Dixon)
Subject: DJGPP for ADC control
Cc: djgpp AT delorie DOT com

Arthur,

I am making this sort of port for doing just this sort of thing myself
(though using an ISA card for A/D rather than the parallel port variant).
You WILL need to port the assembler subroutines to 32 bit protected mode
which is not necessarily trivial. If you have the sources it should not be
impossible - which vendor's AD are you using ? (I have experience with the
real-mode libraries from CED, Data Translation and Amplicon) - you will need
to understand 32 bit protected mode but I guess for parallel port connection
it is polled mode so you dont have to worry about DMA or IRQ.

Basically you will need to rewrite the assembler sources into AT&T syntax
(DJGPP does not directly support the Intel variant used by most
Microsoft-taught programmers) and at the same time amend any bits required
to fit the 32 bit protected mode model (ie strip all references to segment
registers, make all pointers 32 bit, use the extended (32 bit) versions of
registers,...

The function prototypes can then remain (although you should be aware that
for example the size of an 'int' differs between DJGPP and Microsoft ...) If
you need help rewriting the header files let me know - but this is NOT the
largest part of the job!

Email me privately if you want more help,

All the best

Paul Dixon

>As something of a raw recruit to DJGPP and RHIDE (and very impressed
>with both of these!) I am trying to find whether I can use DJGPP to write
>some software to control an item of laboratory equipment which involves
>some plug-in hardware (an analog-to-digital converter) which plugs into
>the parallel port of the PC.  The ADC comes with a disk of driver 
>functions written (I am told) in assembler and callable from Microsoft C.
>The header file for these subroutines consists of two function prototypes
>of the form
>
>extern far function1( int, int, .... )
>
>I've tried loading the object code into a RHIDE project and compiling/
>linking the program, but it gives something like "parse error before ("
>when it gets to the header file and doesn't compile.
>
>Is it fundamentally possible to link MS-C object code into DJGPP? Am I 
>missing the obvious, or am I trying to do the impossible?
>
>Any help would be greatly appreciated.
>
>Arthur Jones
>
------------------------------------------------------------------------
Paul Dixon                                   Email: p DOT dixon AT ic DOT ac DOT uk
Software Engineer                              tel:   +44 (171) 725 1098
Academic Dept of Paediatrics                   fax:   +44 (171) 725 6284
St Mary's Hospital Medical School
 (a constituent college of 
                     Imperial College of Science, Technology & Medicine)
Norfolk Place, London W2 1PG, UK
------------------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019