Página 5 de 7

Recompiling Old Summer87 Program

Enviado: 15 Mai 2012 11:54
por marge0512
I got this:

C:\LET_1902>C:\CLIPPER\BIN\clipper letter.prg -l -m
Clipper (R) 5.2e
Copyright (c) 1985-1995, Computer Associates International, Inc.
Microsoft C Floating Point Support Routines
Copyright (c) Microsoft Corp 1984-1987. All Rights Reserved.
310K available
Compiling LETTER.PRG
Code size 5890, Symbols 2208, Constants 3438

Then, I did what you suggested. I deleted the old .obj, i typed clipper letter -l -m (at the DOS prompt) to create a new .obj then I ran my .BAT file. I changed the line to C:\CLIPPER\BIN\clipper letter -l -m in there also. I still receive the same error in reference to the _Int86.

Recompiling Old Summer87 Program

Enviado: 15 Mai 2012 12:02
por Pablo César
Perfect ! At least...

As your have mentioned in your message before, there is not giving this error:

BLINKER : overlay opsize set to 40 Kb - minimum is 15 Kb (U_SCROLL)

So now is with only this erro missing referance _Int86. Have you included NanFor lib ?

Please, try to include this attached file in your linking thru BLINKER.

Recompiling Old Summer87 Program

Enviado: 15 Mai 2012 12:18
por Pablo César
I do not know if we are in the right way, I means regarding to re-create this function _Int86. But I have found a similar C code but with name FT_Int86(void) in this Nanfor library. If you want to try to make your own lib by this code, would be another attempt.

Código: Selecionar todos

/*
 * File......: CINT86.C
 * Author....: Ted Means
 * Date......: $Date:   15 Aug 1991 23:08:32  $
 * Revision..: $Revision:   1.2  $
 * Log file..: $Logfile:   E:/nanfor/src/cint86.c_v  $
 * 
 * This function is an original work by Ted Means and is placed in the
 * public domain.
 *
 * Modification history:
 * ---------------------
 *
 * $Log:   E:/nanfor/src/cint86.c_v  $
 * 
 *    Rev 1.2   15 Aug 1991 23:08:32   GLENN
 * Forest Belt proofread/edited/cleaned up doc
 * 
 *    Rev 1.1   14 Jun 1991 03:48:42   GLENN
 * Just corrected some typos in the documentation.
 * 
 *    Rev 1.0   27 May 1991 13:22:36   GLENN
 * Initial revision.
 *  
 *

 *  $DOC$
 *  $FUNCNAME$
 *      FT_INT86()
 *  $CATEGORY$
 *      DOS/BIOS
 *  $ONELINER$
 *      Execute a software interrupt
 *  $SYNTAX$
 *      FT_INT86( <nInterruptNumber>, <aRegisterValues> ) -> lResult
 *  $ARGUMENTS$
 *      <nInterruptNumber> is the interrupt to execute.
 *
 *      <aRegisterValues> is an array that contains values to be loaded
 *      into the various CPU registers.  The correspondence between
 *      registers and array elements is as follows:
 *
 *               aElement[1]  ==  AX register
 *               aElement[2]  ==  BX register
 *               aElement[3]  ==  CX register
 *               aElement[4]  ==  DX register
 *               aElement[5]  ==  SI register
 *               aElement[6]  ==  DI register
 *               aElement[7]  ==  BP register
 *               aElement[8]  ==  DS register
 *               aElement[9]  ==  ES register
 *               aElement[10] ==  Flags register
 *  $RETURNS$
 *      .T. if all parameters valid and the function was able
 *          to execute the desired interrupt.
 *      .F. if invalid parameters passed.
 *
 *     In addition, the array elements will contain whatever values were in
 *     the CPU registers immediately after the interrupt was executed.  If
 *     either of the string parameters were altered by the interrupt, these
 *     changes will be reflected as well.
 *  $DESCRIPTION$
 *     It is occasionally useful to be able to call interrupts directly from
 *     Clipper, without having to write a separate routine in C or ASM.  This
 *     function allows you that capability.
 *
 *     Given Clipper's high-level orientation, this function is necessarily
 *     somewhat messy to use.  First, declare an array of ten elements to
 *     hold the eight values for the CPU registers and two string parameters.
 *     Then initialize the array elements with the values that you want the
 *     CPU registers to contain when the interrupt is executed.  You need not
 *     initialize all the elements.  For example, if the interrupt requires
 *     you to specify values for AX, DX, and DS, you would only need to
 *     initialize elements 1, 4, and 8.
 *
 *     Once you have done the required register setup, call FT_INT86(),
 *     passing the interrupt number and the register array as parameters.
 *     The function will load the CPU with your specified values, execute the
 *     interrupt, and then store the contents of the CPU registers back into
 *     your array.  This will allow you to evaluate the results of the
 *     interrupt.
 *
 *     Some interrupt services require you to pass the address of a string in
 *     a pair of registers.  This function is capable of handling these sorts
 *     of situations, but it will take a little work on your part.  If you need
 *     to pass a string that uses the DS register, store the string in element
 *     8;  if you need to pass a string that uses the ES register, store the
 *     string in element 9.  FT_INT86() will detect that you've supplied a
 *     string instead of a numeric value and will behave accordingly.
 *
 *     That takes care of obtaining the segment portion of the pointer.  To
 *     specify which register is to contain the offset, use the values REG_DS
 *     and REG_ES which are defined in the FTINT86.CH file.  When one of these
 *     values is found in an array element, it alerts FT_Int86() to use the
 *     offset portion of a pointer instead of a numeric value.  REG_DS tells
 *     FT_Int86() to use the offset of the string in element 8, while REG_ES
 *     tells FT_Int86() to use the offset of the string in element 9.
 *
 *     All the CPU registers are sixteen bits in size.  Some, however, are
 *     also split into two 8-bit registers.  This function is only capable of
 *     receiving and returning registers that are 16 bits in size.  To split
 *     a 16-bit register into two 8-bit values, you can use the
 *     pseudo-functions HighByte() and LowByte(), contained in the .CH file.
 *
 *     To alter an 8-bit number so it will appear in the high-order byte of a
 *     register when passed to the FT_INT86() function, use the MakeHI()
 *     pseudo-function contained in the .CH file.
 *
 *     This function is a shell for __ftint86(), which is written in assembler
 *     and does the actual work of executing the interrupt.  __ftint86() is
 *     callable from C, so feel free to incorporate it into any C routines
 *     for which it might be useful.  The source for __ftint86() can be found
 *     in the file AINT86.ASM.
 *  $EXAMPLES$
 *
 *     * This example shows how to call the DOS "create file" service.  Take
 *     * special note of how to set up string parameters.
 *
 *     #include "FTINT86.CH"
 *
 *     local aRegs[10]              && Declare the register array
 *     aRegs[ AX ] := makehi(60)    && DOS service, create file
 *     aRegs[ CX ] := 0             && Specify file attribute
 *
 *     * Pay attention here, this is crucial.  Note how to set up the string
 *     * so it appears in DS:DX.
 *
 *     aRegs[ DS ] := "C:\MISC\MYFILE.XXX"
 *     aRegs[ DX ] := REG_DS
 *     FT_INT86( 33, aRegs)         && Make the call to the DOS interrupt
 *
 *
 *     * This example shows how to call the DOS "get current directory"
 *     * service.  This one also uses a string parameter, but note that it
 *     * uses a different offset register.
 *
 *     #include "FTINT86.CH"
 *
 *     local aRegs[10]
 *     aRegs[ AX ] := makehi(71)
 *     aRegs[ DX ] := 0           // Choose default drive
 *
 *     * This service requires a 64-byte buffer whose address is in DS:SI.  DOS
 *     * will fill the buffer with the current directory.
 *
 *     aRegs[ DS ] := space(64)
 *     aRegs[ SI ] := REG_DS
 *     FT_INT86( 33, aRegs)
 *
 *     ? aRegs[ DS ]       // Display the directory name
 *
 *
 *
 *     * For the sake of completeness, here's an example that doesn't use a
 *     * string.  This one changes the video mode.
 *
 *     #include "FTINT86.CH"
 *
 *     local aRegs[10]
 *
 *     aRegs[ AX ] := 16          && Choose hi-res graphics
 *     FT_INT86( 16, aRegs)
 *  $INCLUDE$
 *     FTINT86.CH
 *  $END$
*/

#include "extend.h"
#include "cint86.h"

CLIPPER FT_Int86(void)
{
   auto struct CPUREGS regs;
   auto unsigned int i;
   auto char * dsptr = NULL;
   auto char * esptr = NULL;

   if ( (PCOUNT == 2) && ISNUM(1) && ISARRAY(2) )
   {
      if ( _parinfa(2, 8) & CHARACTER )
      {
         _storclen(NULL, _parclen(2, 8), 2, 8);
         dsptr = _parc(2, 8);
         regs.ds = *((unsigned int *)(&dsptr) + 1);
      }
      else
         regs.ds = _parni(2, 8);

      if ( _parinfa(2, 9) & CHARACTER )
      {
         _storclen(NULL, _parclen(2, 9), 2, 9);
         esptr = _parc(2, 9);
         regs.es = *((unsigned int *)(&esptr) + 1);
      }
      else
         regs.es = _parni(2, 9);

      for (i = 1; i <= 7; i++)
      {
         if ( _parinfa(2, i) & LOGICAL )
            if ( _parl(2, i) )
               *(((unsigned int *)(&regs)) + i - 1) = *(unsigned int *)&dsptr;
            else
               *(((unsigned int *)(&regs)) + i - 1) = *(unsigned int *)&esptr;
         else
            *(((unsigned int *)(&regs)) + i - 1) = _parni(2, i);
      }

      __ftint86( _parni(1), &regs);

      for (i = 1; i <= 7; i++)
         _storni(*(((unsigned int *)(&regs)) + i - 1), 2, i);

      _storni(regs.flags, 2, 10);

      if ( dsptr == NULL )
         _storni(regs.ds, 2, 8);

      if ( esptr == NULL )
         _storni(regs.es, 2, 9);

      _retl(TRUE);
   }
   else
      _retl(FALSE);

   return;
}
FTINT86.CH

Código: Selecionar todos

/*
 * File......: FTINT86.CH - Header file for users of FT_INT86() function
 * Author....: Ted Means
 * Date......: $Date:   01 Jul 1992 01:00:52  $
 * Revision..: $Revision:   1.3  $
 * Log file..: $Logfile:   C:/nanfor/src/ftint86.chv  $
 * 
 * This is an original work by Ted Means and is placed in the
 * public domain.
 *
 * Modification history:
 * ---------------------
 *
 * $Log:   C:/nanfor/src/ftint86.chv  $
 * 
 *    Rev 1.3   01 Jul 1992 01:00:52   GLENN
 * Rodgers Moore submitted some fixes to the highbyte() and lowbyte()
 * macros that take negative numbers into account.  Ted Means and 
 * Glenn Scott added #defines for the Flag registers.  General cleanup
 * of formatting, etc.
 * 
 * 
 *    Rev 1.2   15 Aug 1991 23:08:48   GLENN
 * Forest Belt proofread/edited/cleaned up doc
 * 
 *    Rev 1.1   27 May 1991 13:25:18   GLENN
 * Revised for new version of ft_int86() package, which is written in C
 * (CINT86.C), assembler (AINT86.ASM).  
 * 
 *    Rev 1.0   01 Apr 1991 01:02:38   GLENN
 * Nanforum Toolkit
 *   
 *
 */

#ifndef __FTINT86_CH__
#define __FTINT86_CH__

#define INT86_MAX_REGS       10

#define AX         1
#define BX         2
#define CX         3
#define DX         4
#define SI         5
#define DI         6
#define BP         7
#define DS         8
#define ES         9
#define FLAGS     10

#define FLAG_CARRY     0     // Carry flag
#define FLAG_PARITY    2     // Parity flag
#define FLAG_AUX       4     // Auxillary flag
#define FLAG_ZERO      6     // Zero flag
#define FLAG_SIGN      7     // Sign flag
#define FLAG_TRAP      8     // Trap flag
#define FLAG_INT       9     // Interrupt flag
#define FLAG_DIR      10     // Direction flag
#define FLAG_OFLOW    11     // Overflow flag

#translate makehi( <X> )        => ((<X>) * 256)
#translate REG_DS               => .T.
#translate REG_ES               => .F.
#translate highbyte( <X> )      => (int( (<X>) / 256 ) + iif( (<X>) >= 0,0,255))
#translate lowbyte( <X> )       => (int( (<X>) % 256 ) + iif( (<X>) >= 0,0,256))
#translate carrySet( <XFLAGS> ) => (ft_isbiton((<XFLAGS>), FLAG_CARRY))

#endif // __FTINT86_CH__
These source codes, you can find in Oasis site at http://www.the-oasis.net/files/general/filescan.zip
Another way is trying to search by the string "_Int86" in files, probably in .LIB or even in .OBJ files.

Recompiling Old Summer87 Program

Enviado: 15 Mai 2012 12:29
por marge0512
Thank you, i will try this. I just added the Nanfor.lib but still get the same error. Also, I still getting:

BLINKER : overlay opsize set to 40 Kb - minimum is 15 Kb (U_SCROLL)

Recompiling Old Summer87 Program

Enviado: 15 Mai 2012 12:31
por Pablo César
I had an idea ! This Nanfor.lib has this function called FT_INT86 which could it be similar with your missing _int86. So, you can include Nanfor.lib in your linkng and try to include in your source code this:

#translate _INT86( <nInterruptNumber>, <aRegisterValues> ) => FT_INT86( <nInterruptNumber>, <aRegisterValues> )

If it works, then you will not need to create a new LIB for _INT86

Recompiling Old Summer87 Program

Enviado: 15 Mai 2012 12:38
por Pablo César
Another question. What rdd are you using ? For index files: NTX, CDX or SIX ?

Recompiling Old Summer87 Program

Enviado: 15 Mai 2012 12:48
por marge0512
I really thought that line of code would work but it did not. I may have to create one.
I'm not sure what you mean by RDD. I am using .NTX files though.

Recompiling Old Summer87 Program

Enviado: 15 Mai 2012 13:06
por Pablo César
I really thought that line of code would work but it did not.
IS there any error message at runtime or when try to compile ? What erro appears ?
I may have to create one.
Probably. Do You will create a empty function _INT86 or you will make a new lib in C ?
I'm not sure what you mean by RDD. I am using .NTX files though.
Ahh default rdd. Do not worry, it just a doubt for compile option.

Recompiling Old Summer87 Program

Enviado: 15 Mai 2012 13:10
por marge0512
I still get:

BLINKER : overlay opsize set to 40 Kb - minimum is 15 Kb (U_SCROLL)
BLINKER : 1115 : DGS_UTIL.LIB(COM1_RDY) : '_INT86' : unresolved external
BLINKER : 0 Warning error(s), 1 Fatal error(s)
L04252K.EXE (not created) (0.1 seconds)

I think I may use that code you gave me to try :)

Recompiling Old Summer87 Program

Enviado: 15 Mai 2012 13:34
por Pablo César
DGS_UTIL.LIB(COM1_RDY) : '_INT86' : unresolved external
Certainly _INT86() makes an interrupt in serial port just to check if is ready or not. See more details regarding FT_INT86(): http://www.ousob.com/ng/nanfor/ng97d8.php
BLINKER : overlay opsize set to 40 Kb - minimum is 15 Kb (U_SCROLL)
IMHO, this becaoming by OLD U_SCROLL.OBJ. If you have access to U_SCROLL.prg, please re-compile with Clipper 5.

Recompiling Old Summer87 Program

Enviado: 15 Mai 2012 15:01
por marge0512
Well, I am completely stumped. I did the easy thing first and created an empty function int86. I get no errors and everything compiled. But.......when I open my executable, the system starts to pop up(with nothing in it I might add)
and then disappears. The Int86 would not be causing that would it? I am going to create a new lib with that code in there to see if it helps.

Recompiling Old Summer87 Program

Enviado: 16 Mai 2012 10:45
por marge0512
Hello! Well, I need to debug to find out what's happening. I still can't figure out why the system won't stay up. Can anyone explain how to debug in Clipper 5?? Please say step by step or I won't know what you are talking about. Thanks!!

Recompiling Old Summer87 Program

Enviado: 16 Mai 2012 14:53
por Pablo César
In line command, type:

Clipper Letter -l -m -b
blinker fi letter... (same made before)
cld L04252K or cld Letter
then it will displays a screen linke this:
Imagem
to go step by step use press F8

There is also a way to pass onto (line positioned) with F7

Recompiling Old Summer87 Program

Enviado: 16 Mai 2012 15:26
por marge0512
Thanks! I didn't get very far though. I got this:

Imagem

I'm sorry if that is messy. I couldn't my picture to look like yours! That is the letter program. It's like it doesn't even want to come up. I'm going to research this message. Thanks for the debug lesson!!

Recompiling Old Summer87 Program

Enviado: 16 Mai 2012 16:14
por Pablo César
I'm sorry if that is messy. I couldn't my picture to look like yours!
Press <Alt><Print Screen> keys all at the same time to capture at clipboard then open Print Brush and save png or jpg and put at any host storage site. After this you can paste and put it with tag image here in you message of this forum.

Have you started with F8, step by step ? All prgs must be compiled with option "/b" using Clipper then Blinker normally.