[comp.lang.modula2] Logitech->JPI

peter@umecs.cs.umu.se (Wladyslaw M. Turski) (05/17/89)

I'm about to start translating a graphics package from Logitech 
Modula 2 to JPI Modula 2 and there are a couple of things that 
bother me. So I thought i'd try my luck with the people of netland
to see if you have some good answers to a couple of questions.

1. Registers seems to be implemented in a different way. Does this mean
   that i have to code the routines SETREG and GETREG in assembler OR
   could I (SETREG) set the registers (AX BX ..), issue an interrupt 1C
   and hope that after the return the registers will be unchanged?

2. This won't work with GETREG, will it?

3. The SYSTEM module exports AX,BX,CX,DX,ES,DI. This should be Constants
   but what are their values?

4. Is the Display module compatible with the JPI IO module?

5. Witch other routines are there in the module Keyboard except Read?

6. Is there a general way around the CODE routine or do I really have to 
   do it the way JPI have in their PROCESS module?

7. Would it be easier for me to simply buy a logitech compiler and then
   try to link the whole @$$%"# ?

8. Is there anything else I should know about except "Don't do it"?

9. Is there anyone outthere who's done this already?



Any source code ang suggestions for interface modules between JPI and Logitech
would be greatly appreciated.

Many thanks.

Peter Lundberg
peter@umecs.cs.umu.se

MSRS002@ECNCDC.BITNET ("THE DOCTOR.") (05/20/89)

Translating the graphics package should be pretty easy to do.
JPI includes all you need for interrupt calls, port manipulation
and manipulating memory.  I don't know Logitech at all, but
here's answers to questions 1-3.

I think you will have to recode all the interrupt calls.  The
module Lib has a procedure Intr, which is passed a data structure
( SYSTEM.Registers ), and an interrupt number.  Before the
interrupt is taken, it sets all the registers according to the
data structure.  When it returns, the data structure will reflect
the registers returned.  See page 165 of the TopSpeed User's
Manual.  Your code will look something like this:

   VAR
      R : SYSTEM.Registers ;

   BEGIN
      R.AH := ( whatever ) ;
      R.AL := ( something else ) ;
      R.CX := ( some 16 bit quantity ) ;
      ...  and so on ...
      Lib.Intr( R, 1CH ) ;
      ( you can now inspect R.whatever to see what happened )

Do you have the TopSpeed manuals?  I have modified their Graph
module to support EGA ( and therefore VGA ) a little better to
allow you to use the second page in graphic modes.  If you
already have it, I don't think they would mind me sending it to
you, even though I would be violating the copyright.

.

+---------------------+---------------------------------------+
   Tom Ruby              Any resemblance between reality and
   MSRS002@ECNCDC        my concept of reality is strictly
                         coincidental.
+---------------------+---------------------------------------+

MSRS002@ECNCDC.BITNET ("THE DOCTOR.") (05/20/89)

I hope my last message is legible, it got sent before I could look
at it.

Tom Ruby
MSRS002@ECNCDC

No disclaimers, I'm guilty.