浏览代码

* force att or direct assembling
* cleanup of some files

peter 27 年之前
父节点
当前提交
7edd9b8a1e

+ 6 - 2
rtl/dos/crt.pp

@@ -161,8 +161,8 @@ var
 
 
 
 
     procedure screensetcursor(row,col : longint);
     procedure screensetcursor(row,col : longint);
-      var
 {$ifdef GO32V2}
 {$ifdef GO32V2}
+      var
          regs : trealregs;
          regs : trealregs;
 {$endif GO32V2}
 {$endif GO32V2}
       begin
       begin
@@ -869,7 +869,11 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.4  1998-05-28 10:21:38  pierre
+  Revision 1.5  1998-05-31 14:18:12  peter
+    * force att or direct assembling
+    * cleanup of some files
+
+  Revision 1.4  1998/05/28 10:21:38  pierre
     * Handles of input and output restored
     * Handles of input and output restored
 
 
   Revision 1.3  1998/05/27 00:19:16  peter
   Revision 1.3  1998/05/27 00:19:16  peter

+ 21 - 15
rtl/dos/dos.pp

@@ -4,7 +4,7 @@
     Copyright (c) 1993,97 by the Free Pascal development team.
     Copyright (c) 1993,97 by the Free Pascal development team.
 
 
     Dos unit for BP7 compatible RTL
     Dos unit for BP7 compatible RTL
-    
+
     See the file COPYING.FPC, included in this distribution,
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
     for details about the copyright.
 
 
@@ -167,9 +167,10 @@ Procedure Keep(exitcode: word);
 implementation
 implementation
 
 
 uses
 uses
-
   strings;
   strings;
 
 
+{$ASMMODE ATT}
+
 {******************************************************************************
 {******************************************************************************
                            --- Dos Interrupt ---
                            --- Dos Interrupt ---
 ******************************************************************************}
 ******************************************************************************}
@@ -193,6 +194,7 @@ var
       end;
       end;
 
 
 {$else GO32V2}
 {$else GO32V2}
+{$ASMMODE DIRECT}
     procedure intr(intno : byte;var regs : registers);
     procedure intr(intno : byte;var regs : registers);
 
 
       begin
       begin
@@ -247,6 +249,7 @@ var
             // FS and GS too
             // FS and GS too
          end;
          end;
       end;
       end;
+{$ASMMODE ATT}
 {$endif GO32V2}
 {$endif GO32V2}
 
 
 procedure msdos(var regs : registers);
 procedure msdos(var regs : registers);
@@ -497,7 +500,7 @@ begin
         leal    b,%ebx
         leal    b,%ebx
         movw    $0xff07,%ax
         movw    $0xff07,%ax
         int     $0x21
         int     $0x21
-        movw    %ax,_LASTDOSEXITCODE
+        movw    %ax,LastDosExitCode
   end;
   end;
 end;
 end;
 
 
@@ -639,15 +642,15 @@ end;
            for i:=0 to strlen(path) do
            for i:=0 to strlen(path) do
              if path[i]='/' then path[i]:='\';
              if path[i]='/' then path[i]:='\';
            asm
            asm
-              movl 18(%ebp),%edx
+              movl f,%edx
               movb $0x1a,%ah
               movb $0x1a,%ah
               int $0x21
               int $0x21
-              movl 12(%ebp),%edx
-              movzwl 16(%ebp),%ecx
+              movl path,%edx
+              movzwl attr,%ecx
               movb $0x4e,%ah
               movb $0x4e,%ah
               int $0x21
               int $0x21
               jnc .LFF
               jnc .LFF
-              movw %ax,U_DOS_DOSERROR
+              movw %ax,DosError
            .LFF:
            .LFF:
            end;
            end;
         end;
         end;
@@ -695,7 +698,7 @@ end;
               movb $0x4f,%ah
               movb $0x4f,%ah
               int $0x21
               int $0x21
               jnc .LFN
               jnc .LFN
-              movw %ax,U_DOS_DOSERROR
+              movw %ax,DosError
            .LFN:
            .LFN:
            end;
            end;
         end;
         end;
@@ -711,12 +714,11 @@ end;
       end;
       end;
 
 
     procedure swapvectors;
     procedure swapvectors;
-
 {$ifdef go32v2}
 {$ifdef go32v2}
-{ uses four global symbols from v2prt0.as
-  to be able to know the current exception state
-  without using dpmiexcp unit }
-      begin
+{ uses four global symbols from v2prt0.as to be able to know the current
+  exception state without using dpmiexcp unit }
+{$ASMMODE DIRECT}
+    begin
          asm
          asm
             movl _exception_exit,%eax
             movl _exception_exit,%eax
             orl  %eax,%eax
             orl  %eax,%eax
@@ -733,9 +735,9 @@ end;
          .Lno_excep:
          .Lno_excep:
          end;
          end;
       end;
       end;
+{$ASMMODE ATT}
 {$else not go32v2}
 {$else not go32v2}
       begin
       begin
-         { only a dummy }
       end;
       end;
 {$endif go32v2}
 {$endif go32v2}
 
 
@@ -1009,7 +1011,11 @@ End;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.4  1998-05-22 00:39:22  peter
+  Revision 1.5  1998-05-31 14:18:13  peter
+    * force att or direct assembling
+    * cleanup of some files
+
+  Revision 1.4  1998/05/22 00:39:22  peter
     * go32v1, go32v2 recompiles with the new objects
     * go32v1, go32v2 recompiles with the new objects
     * remake3 works again with go32v2
     * remake3 works again with go32v2
     - removed some "optimizes" from daniel which were wrong
     - removed some "optimizes" from daniel which were wrong

+ 67 - 36
rtl/dos/go32v1/objinc.inc

@@ -1,3 +1,21 @@
+{
+    $Id$
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 1993-98 by the Free Pascal development team.
+
+    Includefile for objects.pp implementing OS-dependent file routines
+    for Go32V1
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************
+}
+
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
 {  FileClose -> Platforms DOS              - Not checked                    }
 {  FileClose -> Platforms DOS              - Not checked                    }
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
@@ -39,6 +57,38 @@ begin
 end;
 end;
 
 
 
 
+{***************************************************************************}
+{  DosSetFilePtr -> Platforms DOS          - Checked 05May1998 CEC          }
+{***************************************************************************}
+FUNCTION SetFilePos (Handle: THandle; Pos: LongInt; MoveType: Word;
+Var Actual: LongInt): Word;
+BEGIN
+  asm
+     movw MoveType, %ax;                              { Load move type }
+     movb $0x42, %ah;
+     movl pos, %edx;                              { Load file position }
+     andl $0xffff,%edx                            { Only keep low word }
+     movl pos, %ecx
+     shrl $16,%ecx;
+     movw Handle, %bx;                              { Load file handle }
+     pushl %ebp;
+     int $0x21;                                         { Position the file }
+     popl %ebp;
+     jc .Lexit4
+     movl Actual,%edi                                { New position address }
+     movw %ax, %bx;
+     movw %dx, %ax;
+     shll $0x10, %eax;                                   { Roll to high part }
+     movw %bx, %ax;
+     movl %eax, (%edi);                               { Update new position }
+     xorl %eax, %eax;
+   .Lexit4:
+     movw %ax, DosStreamError                         { DOS error returned }
+   END;
+   SetFilePos := DosStreamError;                   { Return any error }
+END;
+
+
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
 {  FileRead -> Platforms DOS              - Checked 05May1998 CEC           }
 {  FileRead -> Platforms DOS              - Checked 05May1998 CEC           }
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
@@ -62,7 +112,6 @@ BEGIN
 end;
 end;
 
 
 
 
-
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
 {  FileWrite -> Platforms DOS              - Checked 05May1998 CEC          }
 {  FileWrite -> Platforms DOS              - Checked 05May1998 CEC          }
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
@@ -86,49 +135,31 @@ BEGIN
   FileWrite:=DosStreamError;
   FileWrite:=DosStreamError;
 end;
 end;
 
 
+
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
 {  SetFileSize -> Platforms DOS          - Not Checked                      }
 {  SetFileSize -> Platforms DOS          - Not Checked                      }
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
 FUNCTION SetFileSize (Handle: THandle; FileSize: LongInt): Word;
 FUNCTION SetFileSize (Handle: THandle; FileSize: LongInt): Word;
 VAR Actual, Buf: LongInt;
 VAR Actual, Buf: LongInt;
 BEGIN
 BEGIN
-   If (Actual = FileSize) Then Begin                  { No position error }
-     Actual := FileWrite(Handle, Pointer(@Buf), 0,Actual);   { Truncate the file }
-     If (Actual <> -1) Then SetFileSize := 0 Else     { No truncate error }
+   SetFilePos(Handle,FileSize,0,Actual);
+   If (Actual = FileSize) Then
+    Begin
+      Actual := FileWrite(Handle, Pointer(@Buf), 0,Actual);   { Truncate the file }
+      If (Actual <> -1) Then
+       SetFileSize := 0
+      Else
        SetFileSize := 103;                            { File truncate error }
        SetFileSize := 103;                            { File truncate error }
-   End Else SetFileSize := 103;                       { File truncate error }
-END;
-
-{***************************************************************************}
-{  DosSetFilePtr -> Platforms DOS          - Checked 05May1998 CEC          }
-{***************************************************************************}
-FUNCTION SetFilePos (Handle: THandle; Pos: LongInt; MoveType: Word;
-Var Actual: LongInt): Word;
-BEGIN
-  asm
-     movw MoveType, %ax;                              { Load move type }
-     movb $0x42, %ah;
-     movl pos, %edx;                              { Load file position }
-     andl $0xffff,%edx                            { Only keep low word }
-     movl pos, %ecx
-     shrl $16,%ecx;
-     movw Handle, %bx;                              { Load file handle }
-     pushl %ebp;
-     int $0x21;                                         { Position the file }
-     popl %ebp;
-     jc .Lexit4
-     movl Actual,%edi                                { New position address }
-     movw %ax, %bx;
-     movw %dx, %ax;
-     shll $0x10, %eax;                                   { Roll to high part }
-     movw %bx, %ax;
-     movl %eax, (%edi);                               { Update new position }
-     xorl %eax, %eax;
-   .Lexit4:
-     movw %ax, DosStreamError                         { DOS error returned }
-   END;
-   SetFilePos := DosStreamError;                   { Return any error }
+    End
+   Else
+    SetFileSize := 103;                       { File truncate error }
 END;
 END;
 
 
+{
+  $Log$
+  Revision 1.2  1998-05-31 14:18:18  peter
+    * force att or direct assembling
+    * cleanup of some files
 
 
+}
 
 

+ 7 - 3
rtl/dos/go32v1/system.pp

@@ -97,6 +97,7 @@ implementation
 
 
 {$I system.inc}
 {$I system.inc}
 
 
+{$ASMMODE DIRECT}
 procedure int_stackcheck(stack_size:longint);[public,alias: 'STACKCHECK'];
 procedure int_stackcheck(stack_size:longint);[public,alias: 'STACKCHECK'];
 begin
 begin
 { called when trying to get local stack
 { called when trying to get local stack
@@ -132,10 +133,9 @@ begin
   end['EAX','EBX'];
   end['EAX','EBX'];
   RunError(202);
   RunError(202);
 end;
 end;
+{$ASMMODE ATT}
 
 
 
 
-{$I386_ATT}
-
 procedure halt(errnum : byte);
 procedure halt(errnum : byte);
 begin
 begin
   do_exit;
   do_exit;
@@ -582,7 +582,11 @@ Begin
 End.
 End.
 {
 {
   $Log$
   $Log$
-  Revision 1.3  1998-05-22 00:39:33  peter
+  Revision 1.4  1998-05-31 14:18:19  peter
+    * force att or direct assembling
+    * cleanup of some files
+
+  Revision 1.3  1998/05/22 00:39:33  peter
     * go32v1, go32v2 recompiles with the new objects
     * go32v1, go32v2 recompiles with the new objects
     * remake3 works again with go32v2
     * remake3 works again with go32v2
     - removed some "optimizes" from daniel which were wrong
     - removed some "optimizes" from daniel which were wrong

+ 107 - 190
rtl/dos/go32v2/dpmiexcp.pp

@@ -51,19 +51,19 @@ type texception_state = record
 
 
 { /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ }
 { /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ }
 {#define __djgpp_exception_state (*__djgpp_exception_state_ptr) }
 {#define __djgpp_exception_state (*__djgpp_exception_state_ptr) }
-const SIGABRT	= 288;
-const SIGFPE	= 289;
-const SIGILL	= 290;
-const SIGSEGV	= 291;
-const SIGTERM	= 292;
+const SIGABRT   = 288;
+const SIGFPE    = 289;
+const SIGILL    = 290;
+const SIGSEGV   = 291;
+const SIGTERM   = 292;
 const SIGINT   = 295;
 const SIGINT   = 295;
 
 
 {const SIG_DFL  = 0;}
 {const SIG_DFL  = 0;}
 function SIG_DFL( x: longint) : longint;
 function SIG_DFL( x: longint) : longint;
 function SIG_ERR( x: longint) : longint;
 function SIG_ERR( x: longint) : longint;
 function SIG_IGN( x: longint) : longint;
 function SIG_IGN( x: longint) : longint;
-{const SIG_ERR	= -1;
-const SIG_IGN	= -1;}
+{const SIG_ERR  = -1;
+const SIG_IGN   = -1;}
 
 
 { __DJ_pid_t
 { __DJ_pid_t
 #undef __DJ_pid_t
 #undef __DJ_pid_t
@@ -71,41 +71,41 @@ const __DJ_pid_t
 
 
 typedef int sig_atomic_t;
 typedef int sig_atomic_t;
 
 
-int	raise(int _sig);
-void	(*signal(int _sig, void (*_func)(int)))(int); }
-  
+int     raise(int _sig);
+void    (*signal(int _sig, void (*_func)(int)))(int); }
+
 { #ifndef __STRICT_ANSI__
 { #ifndef __STRICT_ANSI__
 
 
-const SA_NOCLDSTOP	1
+const SA_NOCLDSTOP      1
 
 
-const SIGALRM	293
-const SIGHUP	294
+const SIGALRM   293
+const SIGHUP    294
 /* SIGINT is ansi */}
 /* SIGINT is ansi */}
-const SIGKILL	= 296;
-const SIGPIPE	= 297;
-const SIGQUIT	= 298;
-const SIGUSR1	= 299;
-const SIGUSR2	= 300;
+const SIGKILL   = 296;
+const SIGPIPE   = 297;
+const SIGQUIT   = 298;
+const SIGUSR1   = 299;
+const SIGUSR2   = 300;
 {
 {
-const SIG_BLOCK	1
-const SIG_SETMASK	2
-const SIG_UNBLOCK	3 }
+const SIG_BLOCK 1
+const SIG_SETMASK       2
+const SIG_UNBLOCK       3 }
 
 
 const SIGNOFP = 301;
 const SIGNOFP = 301;
 const SIGTRAP = 302;
 const SIGTRAP = 302;
-const SIGTIMR = 303;	{/* Internal for setitimer (SIGALRM, SIGPROF) */ }
+const SIGTIMR = 303;    {/* Internal for setitimer (SIGALRM, SIGPROF) */ }
 const SIGPROF = 304;
 const SIGPROF = 304;
 const SIGMAX  = 320;
 const SIGMAX  = 320;
 
 
 
 
 
 
 { extern unsigned short __djgpp_our_DS;
 { extern unsigned short __djgpp_our_DS;
-extern unsigned short __djgpp_app_DS;	/* Data selector invalidated by HW ints */
-extern unsigned short __djgpp_ds_alias;	/* Data selector always valid */
-extern unsigned short __djgpp_dos_sel;	/* Linear mem selector copy in locked mem */
+extern unsigned short __djgpp_app_DS;   /* Data selector invalidated by HW ints */
+extern unsigned short __djgpp_ds_alias; /* Data selector always valid */
+extern unsigned short __djgpp_dos_sel;  /* Linear mem selector copy in locked mem */
 extern unsigned short __djgpp_hwint_flags; /* 1 = Disable Ctrl-C; 2 = Count Ctrl-Break (don't kill) */
 extern unsigned short __djgpp_hwint_flags; /* 1 = Disable Ctrl-C; 2 = Count Ctrl-Break (don't kill) */
-extern unsigned __djgpp_cbrk_count;	/* Count of CTRL-BREAK hits */
-extern int __djgpp_exception_inprog;	/* Nested exception count */ }
+extern unsigned __djgpp_cbrk_count;     /* Count of CTRL-BREAK hits */
+extern int __djgpp_exception_inprog;    /* Nested exception count */ }
 
 
 type SignalHandler = function (v : longint) : longint;
 type SignalHandler = function (v : longint) : longint;
 
 
@@ -115,7 +115,7 @@ function _raise(sig : longint) : longint;
 
 
 procedure djgpp_exception_toggle;
 procedure djgpp_exception_toggle;
 
 
-function  djgpp_set_ctrl_c(enable : boolean) : boolean; {	/* On by default */}
+function  djgpp_set_ctrl_c(enable : boolean) : boolean; {       /* On by default */}
 
 
 procedure djgpp_exception_setup;
 procedure djgpp_exception_setup;
 
 
@@ -131,6 +131,8 @@ procedure longjmp({const}var rec : tjmprec;return_value : longint);
 
 
 implementation
 implementation
 
 
+{$ASMMODE DIRECT}
+
 {$L exceptn.o}
 {$L exceptn.o}
 
 
 const exceptions_on : boolean = false;
 const exceptions_on : boolean = false;
@@ -166,7 +168,7 @@ end;
 #include <crt0.h>
 #include <crt0.h>
 #include <pc.h>
 #include <pc.h>
 #include <sys/exceptn.h>
 #include <sys/exceptn.h>
-#include <sys/nearptr.h>		/* For DS base/limit info */
+#include <sys/nearptr.h>                /* For DS base/limit info */
 #include <libc/internal.h> }
 #include <libc/internal.h> }
 
 
 { const newline = #13#10; }
 { const newline = #13#10; }
@@ -185,7 +187,7 @@ end;
 
 
 { extern unsigned end __asm__ ('end'); }
 { extern unsigned end __asm__ ('end'); }
 const cbrk_vect : byte = $1b;
 const cbrk_vect : byte = $1b;
-{	/* May be $06 for PC98 */ }
+{       /* May be $06 for PC98 */ }
 
 
 { /* These are all defined in exceptn.S and only used here */
 { /* These are all defined in exceptn.S and only used here */
 extern int __djgpp_exception_table;
 extern int __djgpp_exception_table;
@@ -213,7 +215,7 @@ function except_to_sig(excep : longint) : longint;
         7                 : exit(SIGNOFP);
         7                 : exit(SIGNOFP);
         else
         else
            begin
            begin
-              if(excep = $75)	then	{/* HW int to fake exception values hardcoded in exceptn.S */}
+              if(excep = $75)   then    {/* HW int to fake exception values hardcoded in exceptn.S */}
                 exit(SIGFPE)
                 exit(SIGFPE)
               else if (excep = $78) then
               else if (excep = $78) then
                 exit(SIGTIMR)
                 exit(SIGTIMR)
@@ -278,12 +280,12 @@ procedure dump_selector(const name : string; sel : word);
   if (sel<>0) then
   if (sel<>0) then
     begin
     begin
        base:=get_segment_base_address(sel);
        base:=get_segment_base_address(sel);
-   
+
        {
        {
          err('  invalid');
          err('  invalid');
        }
        }
        { else }
        { else }
-   
+
        err('  base='); itox(base, 8);
        err('  base='); itox(base, 8);
        limit:=get_segment_limit(sel);
        limit:=get_segment_limit(sel);
        err('  limit='); itox(limit, 8);
        err('  limit='); itox(limit, 8);
@@ -391,7 +393,7 @@ function do_faulting_finish_message : integer;
 end;
 end;
 
 
 var  signal_list : Array[0..SIGMAX] of SignalHandler;
 var  signal_list : Array[0..SIGMAX] of SignalHandler;
- {	/* SIG_DFL = 0 */ }
+ {      /* SIG_DFL = 0 */ }
 
 
 function signal(sig : longint;func : SignalHandler) : SignalHandler;
 function signal(sig : longint;func : SignalHandler) : SignalHandler;
   var temp : SignalHandler;
   var temp : SignalHandler;
@@ -436,7 +438,7 @@ function _raise(sig : longint) : longint;
     exit(-1);
     exit(-1);
   temp:=signal_list[sig - 1];
   temp:=signal_list[sig - 1];
   if (temp = SignalHandler(@SIG_IGN)) then
   if (temp = SignalHandler(@SIG_IGN)) then
-    exit(0); {			/* Ignore it */ }
+    exit(0); {                  /* Ignore it */ }
   if (temp = SignalHandler(@SIG_DFL)) then
   if (temp = SignalHandler(@SIG_DFL)) then
     begin
     begin
       traceback_exit:
       traceback_exit:
@@ -452,7 +454,7 @@ function _raise(sig : longint) : longint;
         end;
         end;
       errln('');
       errln('');
       { if(djgpp_exception_state<>nil) then }
       { if(djgpp_exception_state<>nil) then }
-        do_faulting_finish_message();	{/* Exits, does not return */ }
+        do_faulting_finish_message();   {/* Exits, does not return */ }
       exit(-1);
       exit(-1);
     end;
     end;
   if ((longint(temp) < longint(starttext)) or (longint(temp) > longint(endtext))) then
   if ((longint(temp) < longint(starttext)) or (longint(temp) > longint(endtext))) then
@@ -513,8 +515,8 @@ function _raise(sig : longint) : longint;
             movw %gs,48(%edi)
             movw %gs,48(%edi)
             movw %ss,50(%edi)
             movw %ss,50(%edi)
 
 
-	    movl ___djgpp_exception_state_ptr, %eax
-	    movl %eax, 60(%edi)
+            movl ___djgpp_exception_state_ptr, %eax
+            movl %eax, 60(%edi)
 
 
             { restore EDI }
             { restore EDI }
             pop %edi
             pop %edi
@@ -540,65 +542,65 @@ const exception_level : longint = 0;
             popl %ebp
             popl %ebp
 {/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */}
 {/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */}
 {/* This is file LONGJMP.S */}
 {/* This is file LONGJMP.S */}
-	movl	4(%esp),%edi	{/* get jmp_buf */}
-	movl	8(%esp),%eax	{/* store retval in j->eax */}
-	movl	%eax,0(%edi)
-
-	movw	46(%edi),%fs
-	movw	48(%edi),%gs
-	movl	4(%edi),%ebx
-	movl	8(%edi),%ecx
-	movl	12(%edi),%edx
-	movl	24(%edi),%ebp
-
-	{/* Now for some uglyness.  The jmp_buf structure may be ABOVE the
-	   point on the new SS:ESP we are moving to.  We don't allow overlap,
-	   but do force that it always be valid.  We will use ES:ESI for
-	   our new stack before swapping to it.  */}
-
-	movw	50(%edi),%es
-	movl	28(%edi),%esi
-	subl	$28,%esi	{/* We need 7 working longwords on stack */}
-
-	movl	60(%edi),%eax
-	es
-	movl	%eax,(%esi)	{/* Exception pointer */}
-
-	movzwl	42(%edi),%eax
-	es
-	movl	%eax,4(%esi)	{/* DS */}
-
-	movl	20(%edi),%eax
-	es
-	movl	%eax,8(%esi)	{/* EDI */}
-
-	movl	16(%edi),%eax
-	es
-	movl	%eax,12(%esi)	{/* ESI */}
-
-	movl	32(%edi),%eax
-	es
-	movl	%eax,16(%esi)	{/* EIP - start of IRET frame */}
-
-	movl	40(%edi),%eax
-	es
-	movl	%eax,20(%esi)	{/* CS */}
-
-	movl	36(%edi),%eax
-	es
-	movl	%eax,24(%esi)	{/* EFLAGS */}
-
-	movl	0(%edi),%eax
-	movw	44(%edi),%es
-
-	movw	50(%edi),%ss
-	movl	%esi,%esp
-
-	popl	___djgpp_exception_state_ptr
-	popl	%ds
-	popl	%edi
-	popl	%esi
-	iret			{/* actually jump to new cs:eip loading flags */}
+        movl    4(%esp),%edi    {/* get jmp_buf */}
+        movl    8(%esp),%eax    {/* store retval in j->eax */}
+        movl    %eax,0(%edi)
+
+        movw    46(%edi),%fs
+        movw    48(%edi),%gs
+        movl    4(%edi),%ebx
+        movl    8(%edi),%ecx
+        movl    12(%edi),%edx
+        movl    24(%edi),%ebp
+
+        {/* Now for some uglyness.  The jmp_buf structure may be ABOVE the
+           point on the new SS:ESP we are moving to.  We don't allow overlap,
+           but do force that it always be valid.  We will use ES:ESI for
+           our new stack before swapping to it.  */}
+
+        movw    50(%edi),%es
+        movl    28(%edi),%esi
+        subl    $28,%esi        {/* We need 7 working longwords on stack */}
+
+        movl    60(%edi),%eax
+        es
+        movl    %eax,(%esi)     {/* Exception pointer */}
+
+        movzwl  42(%edi),%eax
+        es
+        movl    %eax,4(%esi)    {/* DS */}
+
+        movl    20(%edi),%eax
+        es
+        movl    %eax,8(%esi)    {/* EDI */}
+
+        movl    16(%edi),%eax
+        es
+        movl    %eax,12(%esi)   {/* ESI */}
+
+        movl    32(%edi),%eax
+        es
+        movl    %eax,16(%esi)   {/* EIP - start of IRET frame */}
+
+        movl    40(%edi),%eax
+        es
+        movl    %eax,20(%esi)   {/* CS */}
+
+        movl    36(%edi),%eax
+        es
+        movl    %eax,24(%esi)   {/* EFLAGS */}
+
+        movl    0(%edi),%eax
+        movw    44(%edi),%es
+
+        movw    50(%edi),%ss
+        movl    %esi,%esp
+
+        popl    ___djgpp_exception_state_ptr
+        popl    %ds
+        popl    %edi
+        popl    %esi
+        iret                    {/* actually jump to new cs:eip loading flags */}
          end;
          end;
       end;
       end;
 
 
@@ -844,8 +846,8 @@ procedure djgpp_exception_setup;
 
 
       for i:=0 to EXCEPTIONCOUNT-1 do
       for i:=0 to EXCEPTIONCOUNT-1 do
         begin
         begin
-           except_ori[i] := _except;	{/* New value to set */}
-           _except.offset:=_except.offset + 4;	{/* This is the size of push n, jmp */}
+           except_ori[i] := _except;    {/* New value to set */}
+           _except.offset:=_except.offset + 4;  {/* This is the size of push n, jmp */}
         end;
         end;
 
 
       kbd_ori.segment := _except.segment;
       kbd_ori.segment := _except.segment;
@@ -875,7 +877,7 @@ procedure djgpp_exception_setup;
               leal _except,%eax
               leal _except,%eax
               movl $___djgpp_iret,(%eax)
               movl $___djgpp_iret,(%eax)
            end;
            end;
-           {_except.offset32 = (unsigned) &__djgpp_iret;		/* TDPMI98 bug */}
+           {_except.offset32 = (unsigned) &__djgpp_iret;                /* TDPMI98 bug */}
            set_pm_interrupt($23,_except);
            set_pm_interrupt($23,_except);
         end;
         end;
      asm
      asm
@@ -892,7 +894,7 @@ procedure djgpp_exception_setup;
         rep
         rep
         movsb
         movsb
      end;
      end;
-     djgpp_exception_toggle;	{/* Set new values & save old values */}
+     djgpp_exception_toggle;    {/* Set new values & save old values */}
 
 
      {/* get original video mode and save */}
      {/* get original video mode and save */}
      old_video_mode := farpeekb(dosmemselector, $449);
      old_video_mode := farpeekb(dosmemselector, $449);
@@ -937,96 +939,11 @@ djgpp_exception_setup;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.2  1998-04-21 14:46:33  pierre
-    + debug info better output
-      no normal code changed
-
-  Revision 1.1.1.1  1998/03/25 11:18:42  root
-  * Restored version
-
-  Revision 1.9  1998/03/18 15:34:46  pierre
-    + fpu state is restaured in excep_exit
-      less risk of problems
-
-  Revision 1.8  1998/03/01 18:18:53  carl
-    * bugfix of wrong vector initialization because of incorrect
-      error indexes (were starting at 1 instead of zero in some places).
-
-  Revision 1.7  1998/02/05 17:04:58  pierre
-    * emulation is working with wmemu387.dxe
+  Revision 1.3  1998-05-31 14:18:23  peter
+    * force att or direct assembling
+    * cleanup of some files
 
 
-  Revision 1.6  1998/02/03 15:52:49  pierre
-    * swapvectors really disable exception handling
-      and interrupt redirection with go32v2
-    * in dos.pp bug if arg path from fsearch had a directory part fixed
-
-  Revision 1.5  1998/01/26 11:57:25  michael
-  + Added log at the end
-
-  Revision 1.4  1998/01/16 16:49:12  pierre
-    * Crtl-C did not break the program
-
-}
-
-
-{
-  $Log$
-  Revision 1.2  1998-04-21 14:46:33  pierre
+  Revision 1.2  1998/04/21 14:46:33  pierre
     + debug info better output
     + debug info better output
       no normal code changed
       no normal code changed
-
-  Revision 1.1.1.1  1998/03/25 11:18:42  root
-  * Restored version
-
-  Revision 1.9  1998/03/18 15:34:46  pierre
-    + fpu state is restaured in excep_exit
-      less risk of problems
-
-  Revision 1.8  1998/03/01 18:18:53  carl
-    * bugfix of wrong vector initialization because of incorrect
-      error indexes (were starting at 1 instead of zero in some places).
-
-  Revision 1.7  1998/02/05 17:04:58  pierre
-    * emulation is working with wmemu387.dxe
-
-  Revision 1.6  1998/02/03 15:52:49  pierre
-    * swapvectors really disable exception handling
-      and interrupt redirection with go32v2
-    * in dos.pp bug if arg path from fsearch had a directory part fixed
-
-  Revision 1.5  1998/01/26 11:57:25  michael
-  + Added log at the end
-
-
-  
-  Working file: rtl/dos/go32v2/dpmiexcp.pp
-  description:
-  ----------------------------
-  revision 1.4
-  date: 1998/01/16 16:49:12;  author: pierre;  state: Exp;  lines: +8 -3
-    * Crtl-C did not break the program
-  ----------------------------
-  revision 1.3
-  date: 1997/12/12 13:14:38;  author: pierre;  state: Exp;  lines: +40 -4
-     + added handling of swap_vectors if under exceptions
-       i.e. swapvector is not dummy under go32v2
-     * bug in output, exceptions where not allways reset correctly
-       now the code in dpmiexcp is called from v2prt0.as exit routine
-     * in crt.pp corrected init_delay calibration loop
-       and added it for go32v2 also (was disabled before due to crashes !!)
-       the previous code did a wrong assumption on the time need to call
-       get_ticks compared to an internal loop without call
-  ----------------------------
-  revision 1.2
-  date: 1997/12/01 12:26:08;  author: michael;  state: Exp;  lines: +14 -3
-  + added copyright reference in header.
-  ----------------------------
-  revision 1.1
-  date: 1997/11/27 08:33:52;  author: michael;  state: Exp;
-  Initial revision
-  ----------------------------
-  revision 1.1.1.1
-  date: 1997/11/27 08:33:52;  author: michael;  state: Exp;  lines: +0 -0
-  FPC RTL CVS start
-  =============================================================================
 }
 }

+ 69 - 117
rtl/dos/go32v2/dxeload.pp

@@ -4,6 +4,8 @@
     Copyright (c) 1993,97 by Pierre Muller,
     Copyright (c) 1993,97 by Pierre Muller,
     member of the Free Pascal development team.
     member of the Free Pascal development team.
 
 
+    Unit to Load DXE files for Go32V2
+
     See the file COPYING.FPC, included in this distribution,
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
     for details about the copyright.
 
 
@@ -11,132 +13,82 @@
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 
- **********************************************************************}
-{ Translated to FPK pascal by Pierre Muller,
-without changing the fpu.s file }
-{
-/* Copyright (C) 1994, 1995 Charles Sandmann ([email protected])
- * FPU setup and emulation hooks for DJGPP V2.0
- * This file maybe freely distributed, no warranty. */
-this file has been translated from
-  dxe.h
-  dxeload.c
-  npxsetup.c
-  it uses fpu.as unchanged from fpu.s in DJGPP/SRC/LIBC/}
-
-{/* Copyright (C) 1995 Charles Sandmann ([email protected])
-   This software may be freely distributed with above copyright, no warranty.
-   Based on code by DJ Delorie, it's really his, enhanced, bugs fixed. */}
-
-
+ **********************************************************************
+}
 Unit dxeload;
 Unit dxeload;
+interface
 
 
-  interface
-
-    type
-       dxe_header = record
-                      magic : longint;
-                      symbol_offset : longint;
-                      element_size : longint;
-                      nrelocs : longint;
-                    end;
-
-    const
-       DXE_MAGIC  = $31455844;
-
-{/* data stored after dxe_header in file; then relocs, 4 bytes each */}
-
-    function dxe_load(filename : string) : pointer;
-
-  implementation
-
-    function dxe_load(filename : string) : pointer;
+const
+   DXE_MAGIC  = $31455844;
+type
+  dxe_header = record
+     magic,
+     symbol_offset,
+     element_size,
+     nrelocs       : longint;
+  end;
 
 
-      type
-          pointer_array = array[0..0] of pointer;
-          tpa = ^pointer_array;
-          plongint = ^longint;
-          ppointer = ^pointer;
-      var
-         dh : dxe_header;
-         data : pchar;
-         f : file;
-         relocs : tpa;
-         i : longint;
-	      addr : plongint;
+function dxe_load(filename : string) : pointer;
 
 
-      begin
-         dxe_load:=nil;
-         assign(f,filename);
-         reset(f,1);
-         blockread(f,@dh,sizeof(dxe_header));
-         if dh.magic<>DXE_MAGIC then
-           begin
-              close(f);
-              exit;
-           end;
-
-         { get memory for code }
-         getmem(data,dh.element_size);
-         if data=nil then
-           exit;
-         { get memory for relocations }
-         getmem(relocs,dh.nrelocs*sizeof(pointer));
-         if relocs=nil then
-           begin
-              freemem(data,dh.element_size);
-              exit;
-           end;
-         { copy code }
-         blockread(f,data^,dh.element_size);
-         blockread(f,relocs^,dh.nrelocs*sizeof(pointer));
-
-         { relocate internal references }
-         for i:=0 to dh.nrelocs-1 do
-           begin
-              cardinal(addr):=cardinal(data)+cardinal(relocs^[i]);
-              addr^:=addr^+pointer(data);
-           end;
-         dxe_load:=pointer( dh.symbol_offset + cardinal(data));
-      end;
-end.
+implementation
 
 
+function dxe_load(filename : string) : pointer;
 {
 {
-  $Log$
-  Revision 1.1  1998-03-25 11:18:42  root
-  Initial revision
-
-  Revision 1.3  1998/01/26 11:57:29  michael
-  + Added log at the end
-
-  Revision 1.2  1998/01/19 17:04:39  pierre
-    * bug in dxe loading corrected, emu still does not work !!
-
-  Revision 1.1  1998/01/16 16:50:49  pierre
-      dxeload is a pascal version of the DJGPP C dxe loader
-
+  Copyright (C) 1995 Charles Sandmann ([email protected])
+  translated to Free Pascal by Pierre Muller
 }
 }
+type
+  pointer_array = array[0..0] of pointer;
+  tpa = ^pointer_array;
+  plongint = ^longint;
+  ppointer = ^pointer;
+var
+  dh     : dxe_header;
+  data   : pchar;
+  f      : file;
+  relocs : tpa;
+  i      : longint;
+  addr   : plongint;
+begin
+   dxe_load:=nil;
+{ open the file }
+   assign(f,filename);
+   reset(f,1);
+{ load the header }
+   blockread(f,@dh,sizeof(dxe_header),i);
+   if (i<>sizeof(dxe_header)) or (dh.magic<>DXE_MAGIC) then
+     begin
+        close(f);
+        exit;
+     end;
+{ get memory for code }
+   getmem(data,dh.element_size);
+   if data=nil then
+     exit;
+{ get memory for relocations }
+   getmem(relocs,dh.nrelocs*sizeof(pointer));
+   if relocs=nil then
+     begin
+        freemem(data,dh.element_size);
+        exit;
+     end;
+{ copy code }
+   blockread(f,data^,dh.element_size);
+   blockread(f,relocs^,dh.nrelocs*sizeof(pointer));
+{ relocate internal references }
+   for i:=0 to dh.nrelocs-1 do
+     begin
+        cardinal(addr):=cardinal(data)+cardinal(relocs^[i]);
+        addr^:=addr^+pointer(data);
+     end;
+   dxe_load:=pointer( dh.symbol_offset + cardinal(data));
+end;
 
 
-
+end.
 {
 {
   $Log$
   $Log$
-  Revision 1.1  1998-03-25 11:18:42  root
-  Initial revision
-
-  Revision 1.3  1998/01/26 11:57:29  michael
-  + Added log at the end
-
+  Revision 1.2  1998-05-31 14:18:24  peter
+    * force att or direct assembling
+    * cleanup of some files
 
 
-  
-  Working file: rtl/dos/go32v2/dxeload.pp
-  description:
-  ----------------------------
-  revision 1.2
-  date: 1998/01/19 17:04:39;  author: pierre;  state: Exp;  lines: +7 -3
-    * bug in dxe loading corrected, emu still does not work !!
-  ----------------------------
-  revision 1.1
-  date: 1998/01/16 16:50:49;  author: pierre;  state: Exp;
-      dxeload is a pascal version of the DJGPP C dxe loader
-  =============================================================================
 }
 }

+ 167 - 253
rtl/dos/go32v2/emu387.pp

@@ -4,6 +4,8 @@
     Copyright (c) 1993,97 by Pierre Muller,
     Copyright (c) 1993,97 by Pierre Muller,
     member of the Free Pascal development team.
     member of the Free Pascal development team.
 
 
+    Loads the emu387 Fpu emulator
+
     See the file COPYING.FPC, included in this distribution,
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
     for details about the copyright.
 
 
@@ -12,204 +14,200 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 
  **********************************************************************}
  **********************************************************************}
-{ Translated to FPK pascal by Pierre Muller,
-without changing the fpu.s file }
-{
-/* Copyright (C) 1994, 1995 Charles Sandmann ([email protected])
- * FPU setup and emulation hooks for DJGPP V2.0
- * This file maybe freely distributed, no warranty. */
-this file has been translated from
-  npxsetup.c  }
-
 unit emu387;
 unit emu387;
+interface
 
 
-  interface
+procedure npxsetup(prog_name : string);
 
 
-    procedure npxsetup(prog_name : string);
+implementation
 
 
-  implementation
+uses
+  dxeload,dpmiexcp;
 
 
-    uses dxeload, dpmiexcp;
+{$ASMMODE ATT}
 
 
-  type
-     emu_entry_type = function(exc : pexception_state) : longint;
+const
+  defaultdxe = 'wmemu387.dxe';
 
 
-  var
-     _emu_entry : emu_entry_type;
+type
+  emu_entry_type = function(exc : pexception_state) : longint;
 
 
+var
+  _emu_entry : emu_entry_type;
 
 
-  procedure _control87(mask1,mask2 : word);
 
 
-    begin
-{/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */}
+function getenv(const envvar:string):string;
+{ Copied here, preserves uses Dos (PFV) }
+var
+  hp      : ppchar;
+  hs,
+  _envvar : string;
+  eqpos   : longint;
+begin
+  _envvar:=upcase(envvar);
+  hp:=envp;
+  getenv:='';
+  while assigned(hp^) do
+   begin
+     hs:=strpas(hp^);
+     eqpos:=pos('=',hs);
+     if copy(hs,1,eqpos-1)=_envvar then
+      begin
+        getenv:=copy(hs,eqpos+1,255);
+        exit;
+      end;
+     hp:=hp+4;
+   end;
+end;
+
+
+procedure _control87(mask1,mask2 : word);
+{ Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details }
 { from file cntrl87.s in src/libc/pc_hw/fpu }
 { from file cntrl87.s in src/libc/pc_hw/fpu }
-        asm
-           { make room on stack }
-           pushl   %eax
-           fstcw   (%esp)
-           fwait
-           popl    %eax
-           andl    $0xffff, %eax
-           { OK;  we have the old value ready }
-
-           movl    mask2, %ecx
-           notl    %ecx
-           andl    %eax, %ecx      /* the bits we want to keep */
-
-           movl    mask2, %edx
-           andl    mask1, %edx      /* the bits we want to change */
-
-           orl     %ecx, %edx      /* the new value */
-           pushl   %edx
-           fldcw   (%esp)
-           popl    %edx
-        end;
-    end;
+begin
+  asm
+      { make room on stack }
+        pushl   %eax
+        fstcw   (%esp)
+        fwait
+        popl    %eax
+        andl    $0xffff, %eax
+      { OK;  we have the old value ready }
+        movl    mask2, %ecx
+        notl    %ecx
+        andl    %eax, %ecx       { the bits we want to keep }
+        movl    mask2, %edx
+        andl    mask1, %edx      { the bits we want to change }
+        orl     %ecx, %edx       { the new value }
+        pushl   %edx
+        fldcw   (%esp)
+        popl    %edx
+  end;
+end;
+
+
+function emu_entry(exc : pexception_state) : longint;
+{
+  the problem with the stack that is not cleared
+}
+begin
+  emu_entry:=_emu_entry(exc);
+end;
 
 
-     { the problem with the stack that is not cleared }
-  function emu_entry(exc : pexception_state) : longint;
 
 
+function nofpsig( sig : longint) : longint;
+var
+  res : longint;
+const
+ last_eip : longint = 0;
+begin
+  {if last_eip=djgpp_exception_state^.__eip then
     begin
     begin
-       emu_entry:=_emu_entry(exc);
-    end;
-
-  function nofpsig( sig : longint) : longint;
-    var res : longint;
-    const
-       last_eip : longint = 0;
+       writeln('emu call two times at same address');
+       dpmi_set_coprocessor_emulation(1);
+       _raise(SIGFPE);
+       exit(0);
+    end; }
 
 
+  last_eip:=djgpp_exception_state^.__eip;
+  res:=emu_entry(djgpp_exception_state);
+  if res<>0 then
     begin
     begin
-       {if last_eip=djgpp_exception_state^.__eip then
-         begin
-            writeln('emu call two times at same address');
-            dpmi_set_coprocessor_emulation(1);
-            _raise(SIGFPE);
-            exit(0);
-         end; }
-
-       last_eip:=djgpp_exception_state^.__eip;
-       res:=emu_entry(djgpp_exception_state);
-       if res<>0 then
-         begin
-            writeln('emu call failed. res = ',res);
-            dpmi_set_coprocessor_emulation(1);
-            _raise(SIGFPE);
-            exit(0);
-         end;
-       longjmp(pjmprec(djgpp_exception_state)^, djgpp_exception_state^.__eax);
-       nofpsig:=0;
+       writeln('emu call failed. res = ',res);
+       dpmi_set_coprocessor_emulation(1);
+       _raise(SIGFPE);
+       exit(0);
     end;
     end;
+  longjmp(pjmprec(djgpp_exception_state)^, djgpp_exception_state^.__eax);
+  nofpsig:=0;
+end;
 
 
-  var
-     prev_exit : pointer;
 
 
-  procedure restore_DPMI_fpu_state;
-    begin
-       exitproc:=prev_exit;
-       dpmi_set_coprocessor_emulation(1);
-       { writeln('Coprocessor restored '); }
-       {/* Enable Coprocessor, no exceptions */}
-    end;
+var
+  prev_exit : pointer;
+procedure restore_DPMI_fpu_state;
+begin
+  exitproc:=prev_exit;
+  dpmi_set_coprocessor_emulation(1);
+{ writeln('Coprocessor restored '); }
+{ Enable Coprocessor, no exceptions }
+end;
 
 
- { function _detect_80387 : boolean;[C];
-  not used because of the underscore problem }
 
 
 {$L fpu.o }
 {$L fpu.o }
 
 
-
-  function getenv(const envvar:string):string;
-  { Copied here, preserves uses Dos (PFV) }
-    var
-      hp      : ppchar;
-      hs,
-      _envvar : string;
-      eqpos   : longint;
+procedure npxsetup(prog_name : string);
+const
+   veryfirst : boolean = True;
+var
+   cp         : string;
+   i          : byte;
+   have_80387 : boolean;
+   emu_p      : pointer;
+begin
+  cp:=getenv('387');
+  if (cp<>'') and (upcase(cp[1])='N') then
+    have_80387:=False
+  else
     begin
     begin
-      _envvar:=upcase(envvar);
-      hp:=envp;
-      getenv:='';
-      while assigned(hp^) do
-       begin
-         hs:=strpas(hp^);
-         eqpos:=pos('=',hs);
-         if copy(hs,1,eqpos-1)=_envvar then
-          begin
-            getenv:=copy(hs,eqpos+1,255);
-            exit;
-          end;
-         hp:=hp+4;
+       dpmi_set_coprocessor_emulation(1);
+{$ASMMODE DIRECT}
+       asm
+          call __detect_80387
+          movb %al,have_80387
        end;
        end;
+{$ASMMODE ATT}
+    end;
+  if (cp<>'') and (upcase(cp[1])='Q') then
+    begin
+       if not have_80387 then
+         write(stderr,'No ');
+       writeln(stderr,'80387 detected.');
     end;
     end;
 
 
-  procedure npxsetup(prog_name : string);
-
-    var
-       cp : string;
-       i : byte;
-       have_80387 : boolean;
-       emu_p : pointer;
-    const
-       veryfirst : boolean = True;
-
+  if have_80387 then
     begin
     begin
-      cp:=getenv('387');
-      if (length(cp)>0) and (upcase(cp[1])='N') then
-        have_80387:=False
-      else
-        begin
-           dpmi_set_coprocessor_emulation(1);
-           asm
-              call __detect_80387
-              movb %al,have_80387
-           end;
-        end;
-      if (length(cp)>0) and (upcase(cp[1])='Q') then
+    { mask all exceptions, except invalid operation }
+       _control87($033e, $ffff);
+    end
+  else
+    begin
+    { Flags value 3 means coprocessor emulation, exceptions to us */}
+       if (dpmi_set_coprocessor_emulation(3)<>0) then
         begin
         begin
-           if not have_80387 then
-             write(stderr,'No ');
-           writeln(stderr,'80387 detected.');
-        end;
-
-      if have_80387 then
-      {/* mask all exceptions, except invalid operation */}
-        _control87($033e, $ffff)
-      else
+          writeln(stderr,'Warning: Coprocessor not present and DPMI setup failed!');
+          writeln(stderr,'         If application attempts floating operations system may hang!');
+        end
+       else
         begin
         begin
-           {/* Flags value 3 means coprocessor emulation, exceptions to us */}
-           if (dpmi_set_coprocessor_emulation(3)<>0) then
-             begin
-                writeln(stderr,'Warning: Coprocessor not present and DPMI setup failed!');
-                writeln(stderr,'         If application attempts floating operations system may hang!');
-             end
-           else
-             begin
-                cp:=getenv('EMU387');
-                if length(cp)=0 then
-                  begin
-                     for i:=length(prog_name) downto 1 do
-                       if (prog_name[i]='\') or (prog_name[i]='/') then
-                         break;
-                     if i>1 then
-                       cp:=copy(prog_name,1,i);
-                     cp:=cp+'wmemu387.dxe';
-                  end;
-                emu_p:=dxe_load(cp);
-                _emu_entry:=emu_entry_type(emu_p);
-                if (emu_p=nil) then
-                  begin
-                     writeln(cp+' load failed !');
-                     halt;
-                  end;
-                if veryfirst then
-                  begin
-                     veryfirst:=false;
-                     prev_exit:=exitproc;
-                     exitproc:=@restore_DPMI_fpu_state;
-                  end;
-                signal(SIGNOFP,@nofpsig);
-             end;
+          cp:=getenv('EMU387');
+          if cp='' then
+            begin
+               for i:=length(prog_name) downto 1 do
+                 if (prog_name[i]='\') or (prog_name[i]='/') then
+                   break;
+               if i>1 then
+                 cp:=copy(prog_name,1,i);
+               cp:=cp+defaultdxe
+            end;
+          emu_p:=dxe_load(cp);
+          _emu_entry:=emu_entry_type(emu_p);
+          if (emu_p=nil) then
+            begin
+               writeln(cp+' load failed !');
+               halt;
+            end;
+          if veryfirst then
+            begin
+               veryfirst:=false;
+               prev_exit:=exitproc;
+               exitproc:=@restore_DPMI_fpu_state;
+            end;
+          signal(SIGNOFP,@nofpsig);
         end;
         end;
     end;
     end;
+end;
+
 
 
 begin
 begin
    npxsetup(paramstr(0));
    npxsetup(paramstr(0));
@@ -217,92 +215,8 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.4  1998-05-21 19:30:51  peter
-    * objects compiles for linux
-    + assign(pchar), assign(char), rename(pchar), rename(char)
-    * fixed read_text_as_array
-    + read_text_as_pchar which was not yet in the rtl
-
-  Revision 1.3  1998/03/31 10:18:55  florian
-    * exit message removed
-
-  Revision 1.2  1998/03/26 12:23:17  peter
-    * emu387 doesn't uses dos anymore (getenv copied local)
-    * makefile compilation order changed
-
-  Revision 1.1.1.1  1998/03/25 11:18:42  root
-  * Restored version
-
-  Revision 1.6  1998/03/18 15:34:46  pierre
-    + fpu state is restaured in excep_exit
-      less risk of problems
-
-  Revision 1.5  1998/02/05 17:24:09  pierre
-    * bug in assembler code
-    * changed default name to wmemu387.dxe
-
-  Revision 1.4  1998/02/05 17:04:59  pierre
-    * emulation is working with wmemu387.dxe
-
-  Revision 1.3  1998/01/26 11:57:34  michael
-  + Added log at the end
-
-  Revision 1.2  1998/01/19 17:04:40  pierre
-    * bug in dxe loading corrected, emu still does not work !!
-
-  Revision 1.1  1998/01/16 16:53:15  pierre
-      emu387 is a program based on npxset from DJGPP
-      that loads the emu387.dxe if no FPU is present
-      or if the env var 387 is set to N
-
-}
-
-
-{
-  $Log$
-  Revision 1.4  1998-05-21 19:30:51  peter
-    * objects compiles for linux
-    + assign(pchar), assign(char), rename(pchar), rename(char)
-    * fixed read_text_as_array
-    + read_text_as_pchar which was not yet in the rtl
-
-  Revision 1.3  1998/03/31 10:18:55  florian
-    * exit message removed
-
-  Revision 1.2  1998/03/26 12:23:17  peter
-    * emu387 doesn't uses dos anymore (getenv copied local)
-    * makefile compilation order changed
-
-  Revision 1.1.1.1  1998/03/25 11:18:42  root
-  * Restored version
-
-  Revision 1.6  1998/03/18 15:34:46  pierre
-    + fpu state is restaured in excep_exit
-      less risk of problems
-
-  Revision 1.5  1998/02/05 17:24:09  pierre
-    * bug in assembler code
-    * changed default name to wmemu387.dxe
-
-  Revision 1.4  1998/02/05 17:04:59  pierre
-    * emulation is working with wmemu387.dxe
-
-  Revision 1.3  1998/01/26 11:57:34  michael
-  + Added log at the end
-
-
+  Revision 1.5  1998-05-31 14:18:25  peter
+    * force att or direct assembling
+    * cleanup of some files
 
 
-  Working file: rtl/dos/go32v2/emu387.pp
-  description:
-  ----------------------------
-  revision 1.2
-  date: 1998/01/19 17:04:40;  author: pierre;  state: Exp;  lines: +11 -2
-    * bug in dxe loading corrected, emu still does not work !!
-  ----------------------------
-  revision 1.1
-  date: 1998/01/16 16:53:15;  author: pierre;  state: Exp;
-      emu387 is a program based on npxset from DJGPP
-      that loads the emu387.dxe if no FPU is present
-      or if the env var 387 is set to N
-  =============================================================================
 }
 }

+ 76 - 49
rtl/dos/go32v2/objinc.inc

@@ -1,3 +1,21 @@
+{
+    $Id$
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 1993-98 by the Free Pascal development team.
+
+    Includefile for objects.pp implementing OS-dependent file routines
+    for Go32V2
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************
+}
+
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
 {  FileClose -> Platforms DOS              - Not checked                    }
 {  FileClose -> Platforms DOS              - Not checked                    }
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
@@ -11,13 +29,14 @@ begin
   FileClose := 0;
   FileClose := 0;
 end;
 end;
 
 
+
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
 {  FileOpen -> Platforms DOS              - Checked 05May1998 CEC           }
 {  FileOpen -> Platforms DOS              - Checked 05May1998 CEC           }
 {  Returns 0 on failure                                                     }
 {  Returns 0 on failure                                                     }
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
 FUNCTION FileOpen (Var FileName: AsciiZ; Mode: Word): THandle;
 FUNCTION FileOpen (Var FileName: AsciiZ; Mode: Word): THandle;
 Var
 Var
-var regs : trealregs;
+  regs : trealregs;
 BEGIN
 BEGIN
          DosStreamError:=0;
          DosStreamError:=0;
          syscopytodos(longint(@FileName),256);
          syscopytodos(longint(@FileName),256);
@@ -38,28 +57,34 @@ BEGIN
             FileOpen:=regs.realeax and $ffff;
             FileOpen:=regs.realeax and $ffff;
 END;
 END;
 
 
-{---------------------------------------------------------------------------}
-{  FileWrite -> Platforms DOS              - Checked 05May1998 CEC          }
-{---------------------------------------------------------------------------}
-FUNCTION FileWrite (Handle: THandle; Var Buf; Count: Sw_Word; Var Actual: Sw_Word): Word;
-BEGIN
- system.do_write(longint(Handle),longint(@Buf),Count);
- Actual:=Count;
- FileWrite:=InOutRes;
-End;
-
 
 
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
-{  SetFileSize -> Platforms DOS          - Not Checked                      }
+{  SetFilePos -> Platforms DOS             - Checked 05May1998 CEC          }
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
-FUNCTION SetFileSize (Handle: THandle; FileSize: LongInt): Word;
-VAR Actual, Buf: LongInt;
+{
+  Calls the operating system to move the file denoted by the handle to
+  to the requested position. The move method can be: 0 = absolute offset;
+  1 = offset from present location; 2 = offset from end of file;
+  Any error is held in DosErrorStream and returned from the call.
+  If the return is zero (ie no error) NewPos contains the new absolute
+  file position.
+}
+FUNCTION SetFilePos (Handle: THandle; Pos: LongInt; MoveType: Word;Var Actual: LongInt): Word;
+Var
+ regs: Trealregs;
+const
+ CarryFlag = $001;
 BEGIN
 BEGIN
-   If (Actual = FileSize) Then Begin                  { No position error }
-     Actual := FileWrite(Handle, Pointer(@Buf), 0,Actual);   { Truncate the file }
-     If (Actual <> -1) Then SetFileSize := 0 Else     { No truncate error }
-       SetFileSize := 103;                            { File truncate error }
-   End Else SetFileSize := 103;                       { File truncate error }
+  regs.realeax := ($42 shl 8) + Byte(MoveType);
+  regs.realedx := pos and $ffff;   { keep low word }
+  regs.realecx := pos shr 16;
+  regs.realebx := longint(Handle);
+  sysrealintr($21,regs);
+  if (regs.RealFlags and CarryFlag = 0) then { no error }
+     Actual:=(regs.realeax and $ffff) + ((regs.realedx and $ffff) shl 16)
+  else
+     DosStreamError:=word(regs.realeax);
+  SetFilePos := DosStreamError;                   { Return any error }
 END;
 END;
 
 
 
 
@@ -74,38 +99,40 @@ BEGIN
 End;
 End;
 
 
 
 
+{---------------------------------------------------------------------------}
+{  FileWrite -> Platforms DOS              - Checked 05May1998 CEC          }
+{---------------------------------------------------------------------------}
+FUNCTION FileWrite (Handle: THandle; Var Buf; Count: Sw_Word; Var Actual: Sw_Word): Word;
+BEGIN
+ system.do_write(longint(Handle),longint(@Buf),Count);
+ Actual:=Count;
+ FileWrite:=InOutRes;
+End;
 
 
-{***************************************************************************}
-{  DosSetFilePtr -> Platforms DOS          - Checked 05May1998 CEC          }
-{***************************************************************************}
-{=DosSetFilePtr======================================================
-Calls the operating system to move the file denoted by the handle to
-to the requested position. The move method can be: 0 = absolute offset;
-1 = offset from present location; 2 = offset from end of file;
-Any error is held in DosErrorStream and returned from the call.
-If the return is zero (ie no error) NewPos contains the new absolute
-file position.
--> Platforms DOS/DPMI/WIN - Checked 16May96 LdB}
 
 
-FUNCTION SetFilePos (Handle: THandle; Pos: LongInt; MoveType: Word;
-Var Actual: LongInt): Word;
-Var
- regs: Trealregs;
-const
- CarryFlag = $001;
+{---------------------------------------------------------------------------}
+{  SetFileSize -> Platforms DOS          - Not Checked                      }
+{---------------------------------------------------------------------------}
+FUNCTION SetFileSize (Handle: THandle; FileSize: LongInt): Word;
+VAR Actual, Buf: LongInt;
 BEGIN
 BEGIN
-  regs.realeax := ($42 shl 8) + Byte(MoveType);
-{  regs.realah := $42;
-  regs.realal := Byte(MoveType); }
-  regs.realedx := pos and $ffff;   { keep low word }
-  regs.realecx := pos shr 16;
-  regs.realebx := longint(Handle);
-  sysrealintr($21,regs);
-  if (regs.RealFlags and CarryFlag = 0) then { no error }
-     Actual:=(regs.realeax and $ffff) + ((regs.realedx and $ffff) shl 16)
-  else
-     DosStreamError:=word(regs.realeax);
-
-  SetFilePos := DosStreamError;                   { Return any error }
+   SetFilePos(Handle,FileSize,0,Actual);
+   If (Actual = FileSize) Then
+    Begin
+      Actual := FileWrite(Handle, Pointer(@Buf), 0,Actual);   { Truncate the file }
+      If (Actual <> -1) Then
+       SetFileSize := 0
+      Else
+       SetFileSize := 103;                            { File truncate error }
+    End
+   Else
+    SetFileSize := 103;                       { File truncate error }
 END;
 END;
 
 
+{
+  $Log$
+  Revision 1.2  1998-05-31 14:18:26  peter
+    * force att or direct assembling
+    * cleanup of some files
+
+}

+ 4 - 23
rtl/dos/go32v2/os.inc

@@ -11,7 +11,7 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 
  **********************************************************************}
  **********************************************************************}
-{$undef dos}
+{$undef go32v1}
 {$define go32v2}
 {$define go32v2}
 {$undef os2}
 {$undef os2}
 {$undef linux}
 {$undef linux}
@@ -19,27 +19,8 @@
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.1  1998-03-25 11:18:42  root
-  Initial revision
+  Revision 1.2  1998-05-31 14:18:27  peter
+    * force att or direct assembling
+    * cleanup of some files
 
 
-  Revision 1.3  1998/01/26 11:57:12  michael
-  + Added log at the end
-
-
-  
-  Working file: rtl/dos/go32v2/os.inc
-  description:
-  ----------------------------
-  revision 1.2
-  date: 1997/12/01 15:35:00;  author: michael;  state: Exp;  lines: +13 -0
-  + Added copyright reference in header.
-  ----------------------------
-  revision 1.1
-  date: 1997/11/27 08:33:52;  author: michael;  state: Exp;
-  Initial revision
-  ----------------------------
-  revision 1.1.1.1
-  date: 1997/11/27 08:33:52;  author: michael;  state: Exp;  lines: +0 -0
-  FPC RTL CVS start
-  =============================================================================
 }
 }

+ 143 - 216
rtl/dos/go32v2/profile.pp

@@ -1,9 +1,11 @@
 {
 {
     $Id$
     $Id$
     This file is part of the Free Pascal run time library.
     This file is part of the Free Pascal run time library.
-    Copyright (c) 1993,97 by Pierre Muller,
+    Copyright (c) 1993-98 by Pierre Muller,
     member of the Free Pascal development team.
     member of the Free Pascal development team.
 
 
+    Profiling support for Go32V2
+
     See the file COPYING.FPC, included in this distribution,
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
     for details about the copyright.
 
 
@@ -11,105 +13,99 @@
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 
- **********************************************************************}
-
+ **********************************************************************
+}
 Unit profile;
 Unit profile;
-
-{$I os.inc}
-
 interface
 interface
 
 
-uses go32,dpmiexcp;
-
-type header = record
-             low,high,nbytes : longint;
-             end;
+type
+  header = record
+    low,high,nbytes : longint;
+  end;
 
 
-{/* entry of a GPROF type file
-*/}
-type MTABE = record
-             from,_to,count : longint;
-             end;
+{ entry of a GPROF type file }
+  ppMTABE = ^pMTABE;
+  pMTABE = ^MTABE;
+  MTABE = record
+    from,_to,count : longint;
+  end;
 
 
-     pMTABE = ^MTABE;
-     ppMTABE = ^pMTABE;
-{/* internal form - sizeof(MTAB) is 4096 for efficiency
-*/ }
-type
+{ internal form - sizeof(MTAB) is 4096 for efficiency }
   PMTAB = ^M_TAB;
   PMTAB = ^M_TAB;
   M_TAB  = record
   M_TAB  = record
-          calls : array [0..340] of MTABE;
-          prev : PMTAB;
-          end;
-var
-   h : header;
-   histogram : ^integer;
-const
-   mcount_skip : longint = 1;
-var
-   histlen : longint;
-   oldexitproc : pointer;
+    calls : array [0..340] of MTABE;
+    prev  : PMTAB;
+  end;
 
 
 const
 const
-   mtab : PMTAB = nil;
-
-{/* called by functions.  Use the pointer it provides to cache
-** the last used MTABE, so that repeated calls to/from the same
-** pair works quickly - no lookup.
-*/ }
+  mcount_skip : longint = 1;
+  mtab        : PMTAB = nil;
+var
+  h           : header;
+  histogram   : ^integer;
+  histlen     : longint;
+  oldexitproc : pointer;
+
+{ called by functions.  Use the pointer it provides to cache the last used
+  MTABE, so that repeated calls to/from the same pair works quickly -
+  no lookup. }
 procedure mcount;
 procedure mcount;
 
 
-implementation
-
-type plongint = ^longint;
 
 
-var starttext, endtext : longint;
+implementation
 
 
-const cache : pMTABE = nil;
+uses
+  go32,dpmiexcp;
 
 
-  { ebp contains the frame of mcount)
-    (ebp) the frame of calling (to_)
-    ((ebp)) the frame of from }
+{$ASMMODE ATT}
 
 
-    { problem how to avoid mcount calling itself !! }
-  procedure mcount;  [public, alias : 'MCOUNT'];
-    var
-       m : pmtab;
-       i,to_,ebp,from,mtabi : longint;
+type
+  plongint = ^longint;
+var
+  starttext, endtext : longint;
+const
+  cache : pMTABE = nil;
 
 
-    begin
-       { optimisation !! }
-       asm
-          pushal
-          movl 4(%ebp),%eax
-          movl %eax,to_
-          movl (%ebp),%eax
-          movl 4(%eax),%eax
-          movl %eax,from
-       end;
-       if endtext=0 then
-         asm
-            popal
-            leave
-            ret
-         end;
-       mcount_skip := 1;
-       if (to_ > endtext) or (from > endtext) then runerror(255);
-       if ((cache<>nil) and
-         (cache^.from=from) and
-         (cache^._to=to_)) then
-         begin
-       {/* cache paid off - works quickly */}
+{ problem how to avoid mcount calling itself !! }
+procedure mcount;  [public, alias : 'MCOUNT'];
+{
+  ebp contains the frame of mcount (ebp) the frame of calling (to_)
+  ((ebp)) the frame of from
+}
+var
+   m : pmtab;
+   i,to_,ebp,from,mtabi : longint;
+begin
+   { optimisation !! }
+   asm
+      pushal
+      movl 4(%ebp),%eax
+      movl %eax,to_
+      movl (%ebp),%eax
+      movl 4(%eax),%eax
+      movl %eax,from
+   end;
+   if endtext=0 then
+     asm
+        popal
+        leave
+        ret
+     end;
+   mcount_skip := 1;
+   if (to_ > endtext) or (from > endtext) then
+     runerror(255);
+   if ((cache<>nil) and (cache^.from=from) and (cache^._to=to_)) then
+     begin
+     { cache paid off - works quickly }
        inc(cache^.count);
        inc(cache^.count);
        mcount_skip:=0;
        mcount_skip:=0;
        asm
        asm
-          popal
-          leave
-          ret
+         popal
+         leave
+         ret
        end;
        end;
-    end;
-
-  {/* no cache hit - search all mtab tables for a match, or an empty slot */}
+     end;
+{ no cache hit - search all mtab tables for a match, or an empty slot }
   mtabi := -1;
   mtabi := -1;
   m:=mtab;
   m:=mtab;
   while m<>nil do
   while m<>nil do
@@ -118,14 +114,13 @@ const cache : pMTABE = nil;
          begin
          begin
            if m^.calls[i].from=0 then
            if m^.calls[i].from=0 then
              begin
              begin
-                {/* empty slot - end of table */ }
+              { empty slot - end of table }
                 mtabi := i;
                 mtabi := i;
                 break;
                 break;
              end;
              end;
-           if ((m^.calls[i].from = from) and
-               (m^.calls[i]._to = to_)) then
+           if ((m^.calls[i].from = from) and (m^.calls[i]._to = to_)) then
              begin
              begin
-                {/* found a match - bump count and return */}
+              { found a match - bump count and return }
                 inc(m^.calls[i].count);
                 inc(m^.calls[i].count);
                 cache:=@(m^.calls[i]);
                 cache:=@(m^.calls[i]);
                 mcount_skip:=0;
                 mcount_skip:=0;
@@ -140,7 +135,7 @@ const cache : pMTABE = nil;
    end;
    end;
   if (mtabi<>-1) then
   if (mtabi<>-1) then
     begin
     begin
-       {/* found an empty - fill it in */}
+     { found an empty - fill it in }
        mtab^.calls[mtabi].from := from;
        mtab^.calls[mtabi].from := from;
        mtab^.calls[mtabi]._to := to_;
        mtab^.calls[mtabi]._to := to_;
        mtab^.calls[mtabi].count := 1;
        mtab^.calls[mtabi].count := 1;
@@ -152,7 +147,7 @@ const cache : pMTABE = nil;
           ret
           ret
        end;
        end;
     end;
     end;
-  {/* lob off another page of memory and initialize the new table */}
+{ lob off another page of memory and initialize the new table }
   getmem(m,sizeof(M_TAB));
   getmem(m,sizeof(M_TAB));
   fillchar(m^, sizeof(M_TAB),#0);
   fillchar(m^, sizeof(M_TAB),#0);
   m^.prev := mtab;
   m^.prev := mtab;
@@ -167,31 +162,40 @@ const cache : pMTABE = nil;
      leave
      leave
      ret
      ret
   end;
   end;
-  end;
+end;
 
 
-  var new_timer,old_timer : tseginfo;
 
 
-{ from itimer.c
-/* Copyright (C) 1995 Charles Sandmann ([email protected])
-   setitimer implmentation - used for profiling and alarm
-   BUGS: ONLY ONE AT A TIME, first pass code
-   This software may be freely distributed, no warranty. */ }
+var
+  new_timer,
+  old_timer       : tseginfo;
+  invalid_mcount_call,
+  mcount_nb,
+  doublecall,
+  reload          : longint; {=0}
 
 
-{ static void timer_action(int signum) }
-{
-  if(reload)
-    __djgpp_timer_countdown = reload;
-  else
-    stop_timer();
-  raise(sigtype);
-}
-var reload : longint;
-const invalid_mcount_call : longint = 0;
-      mcount_nb : longint = 0;
-      doublecall : longint = 0;
+function mcount_tick(x : longint) : longint;
+var
+  bin : longint;
+begin
+   if mcount_skip=0 then
+     begin
+        bin := djgpp_exception_state^.__eip;
+        if (djgpp_exception_state^.__cs=get_cs) and (bin >= starttext) and (bin <= endtext) then
+          begin
+             bin := (bin - starttext) div 16;
+             inc(histogram[bin]);
+          end
+        else
+          inc(invalid_mcount_call);
+        inc(mcount_nb);
+     end
+   else
+     inc(doublecall);
+   mcount_tick:=0;
+end;
 
 
-function mcount_tick(x : longint) : longint;forward;
 
 
+{$ASMMODE DIRECT}
 function timer(x : longint) : longint;
 function timer(x : longint) : longint;
 begin
 begin
    if reload>0 then
    if reload>0 then
@@ -199,28 +203,20 @@ begin
        movl _RELOAD,%eax
        movl _RELOAD,%eax
        movl %eax,___djgpp_timer_countdown
        movl %eax,___djgpp_timer_countdown
      end;
      end;
-
    mcount_tick(x);
    mcount_tick(x);
    { _raise(SIGPROF); }
    { _raise(SIGPROF); }
 end;
 end;
 
 
-{/* this is called during program exit (installed by atexit). */}
+
 procedure mcount_write;
 procedure mcount_write;
- var m : PMTAB;
-     i : longint;
-     f : file;
 {
 {
-  MTAB *m;
-  int i, f;
-  struct itimerval new_values;
-
-  mcount_skip = 1;
-
-  /* disable timer */
-  new_values.it_value.tv_usec = new_values.it_interval.tv_usec = 0;
-  new_values.it_value.tv_sec = new_values.it_interval.tv_sec = 0;
-  setitimer(ITIMER_PROF, &new_values, NULL); }
-  begin
+  this is called during program exit
+}
+var
+  m : PMTAB;
+  i : longint;
+  f : file;
+begin
   mcount_skip:=1;
   mcount_skip:=1;
   signal(SIGTIMR,@SIG_IGN);
   signal(SIGTIMR,@SIG_IGN);
   signal(SIGPROF,@SIG_IGN);
   signal(SIGPROF,@SIG_IGN);
@@ -257,41 +253,11 @@ procedure mcount_write;
   close(f);
   close(f);
 end;
 end;
 
 
-(* extern unsigned start __asm__ ("start");
-#define START (unsigned)&start
-extern int etext;
-
-/* ARGSUSED */
-static void *)
 
 
-
-function mcount_tick(x : longint) : longint;
-  var bin : longint;
-begin
-   if mcount_skip=0 then
-     begin
-        {bin = __djgpp_exception_state->__eip;}
-        bin := djgpp_exception_state^.__eip;
-        if (djgpp_exception_state^.__cs=get_cs) and
-           (bin >= starttext) and (bin <= endtext) then
-          begin
-             {bin := (bin - starttext) div 4;}	{/* 4 EIP's per bin */}
-             bin := (bin - starttext) div 16;
-             inc(histogram[bin]);
-          end
-        else
-          inc(invalid_mcount_call);
-        inc(mcount_nb);
-     end
-   else
-     inc(doublecall);
-   mcount_tick:=0;
-end;
-
-{/* this is called to initialize profiling before the program starts */}
-procedure _mcount_init;
-
-{struct itimerval new_values;}
+procedure mcount_init;
+{
+  this is called to initialize profiling before the program starts
+}
 
 
   function djgpp_timer_hdlr : pointer;
   function djgpp_timer_hdlr : pointer;
     begin
     begin
@@ -311,14 +277,13 @@ procedure _mcount_init;
           movw 4(%eax),%ax
           movw 4(%eax),%ax
           movw %ax,4(%ebx)
           movw %ax,4(%ebx)
        end;
        end;
-
     end;
     end;
-begin
 
 
-       asm
-          movl $_etext,_ENDTEXT
-          movl $start,_STARTTEXT
-       end;
+begin
+  asm
+        movl    $_etext,_ENDTEXT
+        movl    $start,_STARTTEXT
+  end;
   h.low := starttext;
   h.low := starttext;
   h.high := endtext;
   h.high := endtext;
   histlen := ((h.high-h.low) div 16) * 2; { must be even }
   histlen := ((h.high-h.low) div 16) * 2; { must be even }
@@ -329,79 +294,41 @@ begin
   oldexitproc:=exitproc;
   oldexitproc:=exitproc;
   exitproc:=@mcount_write;
   exitproc:=@mcount_write;
 
 
-  {/* here, do whatever it takes to initialize the timer interrupt */}
+{ here, do whatever it takes to initialize the timer interrupt }
   signal(SIGPROF,@mcount_tick);
   signal(SIGPROF,@mcount_tick);
   signal(SIGTIMR,@timer);
   signal(SIGTIMR,@timer);
 
 
   get_pm_interrupt($8,old_timer);
   get_pm_interrupt($8,old_timer);
   set_old_timer_handler;
   set_old_timer_handler;
 {$ifdef DEBUG}
 {$ifdef DEBUG}
-       writeln(stderr,'ori pm int8  '+hexstr(old_timer.segment,4)+':'
-           +hexstr(longint(old_timer.offset),8));
-       flush(stderr);
+  writeln(stderr,'ori pm int8  '+hexstr(old_timer.segment,4)+':'+hexstr(longint(old_timer.offset),8));
+  flush(stderr);
 {$endif DEBUG}
 {$endif DEBUG}
   new_timer.segment:=get_cs;
   new_timer.segment:=get_cs;
   new_timer.offset:=djgpp_timer_hdlr;
   new_timer.offset:=djgpp_timer_hdlr;
   reload:=3;
   reload:=3;
 {$ifdef DEBUG}
 {$ifdef DEBUG}
-       writeln(stderr,'new pm int8  '+hexstr(new_timer.segment,4)+':'
-           +hexstr(longint(new_timer.offset),8));
-       flush(stderr);
+  writeln(stderr,'new pm int8  '+hexstr(new_timer.segment,4)+':'+hexstr(longint(new_timer.offset),8));
+  flush(stderr);
 {$endif DEBUG}
 {$endif DEBUG}
   set_pm_interrupt($8,new_timer);
   set_pm_interrupt($8,new_timer);
   reload:=1;
   reload:=1;
-     asm
-       movl _RELOAD,%eax
-       movl %eax,___djgpp_timer_countdown
-     end;
-  mcount_skip := 0;
+  asm
+        movl    _RELOAD,%eax
+        movl    %eax,___djgpp_timer_countdown
   end;
   end;
+  mcount_skip := 0;
+end;
+{$ASMMODE ATT}
+
 
 
 begin
 begin
-_mcount_init;
+  mcount_init;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.1  1998-03-25 11:18:42  root
-  Initial revision
-
-  Revision 1.4  1998/01/26 11:57:39  michael
-  + Added log at the end
+  Revision 1.2  1998-05-31 14:18:28  peter
+    * force att or direct assembling
+    * cleanup of some files
 
 
-  Revision 1.3  1998/01/16 16:54:22  pierre
-    + logs added at end
-    + dxeload and emu387 added in makefile
-
-}
-
-{
-  $Log$
-  Revision 1.1  1998-03-25 11:18:42  root
-  Initial revision
-
-  Revision 1.4  1998/01/26 11:57:39  michael
-  + Added log at the end
-
-
-  
-  Working file: rtl/dos/go32v2/profile.pp
-  description:
-  ----------------------------
-  revision 1.3
-  date: 1998/01/16 16:54:22;  author: pierre;  state: Exp;  lines: +5 -2
-    + logs added at end
-    + dxeload and emu387 added in makefile
-  ----------------------------
-  revision 1.2
-  date: 1997/12/01 12:26:09;  author: michael;  state: Exp;  lines: +14 -3
-  + added copyright reference in header.
-  ----------------------------
-  revision 1.1
-  date: 1997/11/27 08:33:52;  author: michael;  state: Exp;
-  Initial revision
-  ----------------------------
-  revision 1.1.1.1
-  date: 1997/11/27 08:33:52;  author: michael;  state: Exp;  lines: +0 -0
-  FPC RTL CVS start
-  =============================================================================
 }
 }

+ 48 - 37
rtl/dos/go32v2/system.pp

@@ -124,13 +124,24 @@ implementation
 
 
 const
 const
   carryflag = 1;
   carryflag = 1;
-
 type
 type
   plongint = ^longint;
   plongint = ^longint;
-
 var
 var
   doscmd : string[128];  { Dos commandline copied from PSP, max is 128 chars }
   doscmd : string[128];  { Dos commandline copied from PSP, max is 128 chars }
 
 
+{$ASMMODE DIRECT}
+
+procedure halt(errnum : byte);
+begin
+  do_exit;
+  flush(stderr);
+  asm
+        movzbw  errnum,%ax
+        pushw   %ax
+        call    ___exit         {frees all dpmi memory !!}
+  end;
+end;
+
 
 
 procedure int_stackcheck(stack_size:longint);[public,alias: 'STACKCHECK'];
 procedure int_stackcheck(stack_size:longint);[public,alias: 'STACKCHECK'];
 {
 {
@@ -168,6 +179,28 @@ __short_on_stack:
 end;
 end;
 
 
 
 
+function far_strlen(selector : word;linear_address : longint) : longint;
+begin
+asm
+        movl linear_address,%edx
+        movl %edx,%ecx
+        movw selector,%gs
+.Larg19:
+        movb %gs:(%edx),%al
+        testb %al,%al
+        je .Larg20
+        incl %edx
+        jmp .Larg19
+.Larg20:
+        movl %edx,%eax
+        subl %ecx,%eax
+        movl %eax,__RESULT
+end;
+end;
+
+{$ASMMODE ATT}
+
+
 function tb : longint;
 function tb : longint;
 begin
 begin
   tb:=go32_info_block.linear_address_of_transfer_buffer;
   tb:=go32_info_block.linear_address_of_transfer_buffer;
@@ -260,25 +293,6 @@ end;
            end ['ESI','EDI','ECX'];
            end ['ESI','EDI','ECX'];
       end;
       end;
 
 
-function far_strlen(selector : word;linear_address : longint) : longint;
-begin
-asm
-        movl linear_address,%edx
-        movl %edx,%ecx
-        movw selector,%gs
-.Larg19:
-        movb %gs:(%edx),%al
-        testb %al,%al
-        je .Larg20
-        incl %edx
-        jmp .Larg19
-.Larg20:
-        movl %edx,%eax
-        subl %ecx,%eax
-        movl %eax,__RESULT
-end;
-end;
-
 
 
 function atohex(s : pchar) : longint;
 function atohex(s : pchar) : longint;
 var rv : longint;
 var rv : longint;
@@ -384,10 +398,12 @@ getmem(argv,argc shl 2);
 for i := 0 to argc-1  do
 for i := 0 to argc-1  do
    argv[i] := largs[i];
    argv[i] := largs[i];
   tempargv:=argv;
   tempargv:=argv;
+{$ASMMODE DIRECT}
   asm
   asm
      movl tempargv,%eax
      movl tempargv,%eax
      movl %eax,_args
      movl %eax,_args
   end;
   end;
+{$ASMMODE ATT}
 end;
 end;
 
 
 
 
@@ -425,10 +441,12 @@ var env_selector : word;
     dos_env,cp : pchar;
     dos_env,cp : pchar;
     stubaddr : p_stub_info;
     stubaddr : p_stub_info;
 begin
 begin
+{$ASMMODE DIRECT}
    asm
    asm
    movl __stubinfo,%eax
    movl __stubinfo,%eax
    movl %eax,stubaddr
    movl %eax,stubaddr
    end;
    end;
+{$ASMMODE ATT}
    stub_info:=stubaddr;
    stub_info:=stubaddr;
    getmem(dos_env,stub_info^.env_size);
    getmem(dos_env,stub_info^.env_size);
    env_count:=0;
    env_count:=0;
@@ -489,21 +507,6 @@ end;
          end;
          end;
       end;
       end;
 
 
-    procedure halt(errnum : byte);
-
-    var regs : trealregs;
-      begin
-         do_exit;
-         flush(stderr);
-         {regs.realeax:=$4c00+errnum;
-         sysrealintr($21,regs);}
-         asm
-         movzbw errnum,%ax
-         pushw  %ax
-         call   ___exit
-         {call ___exit frees all dpmi memory !!}
-         end;
-      end;
 
 
 function paramcount : longint;
 function paramcount : longint;
 begin
 begin
@@ -535,6 +538,8 @@ end;
                               Heap Management
                               Heap Management
 *****************************************************************************}
 *****************************************************************************}
 
 
+{$ASMMODE DIRECT}
+
 function Sbrk(size : longint):longint;assembler;
 function Sbrk(size : longint):longint;assembler;
 asm
 asm
         movl    size,%eax
         movl    size,%eax
@@ -543,6 +548,8 @@ asm
         addl    $4,%esp
         addl    $4,%esp
 end;
 end;
 
 
+{$ASMMODE ATT}
+
 { include standard heap management }
 { include standard heap management }
 {$I heap.inc}
 {$I heap.inc}
 
 
@@ -1006,7 +1013,11 @@ Begin
 End.
 End.
 {
 {
   $Log$
   $Log$
-  Revision 1.5  1998-05-21 19:30:52  peter
+  Revision 1.6  1998-05-31 14:18:29  peter
+    * force att or direct assembling
+    * cleanup of some files
+
+  Revision 1.5  1998/05/21 19:30:52  peter
     * objects compiles for linux
     * objects compiles for linux
     + assign(pchar), assign(char), rename(pchar), rename(char)
     + assign(pchar), assign(char), rename(pchar), rename(char)
     * fixed read_text_as_array
     * fixed read_text_as_array

+ 48 - 42
rtl/dos/graph.pp

@@ -5,7 +5,7 @@
     members of the Free Pascal development team.
     members of the Free Pascal development team.
 
 
     Graph unit for BP7 compatible RTL
     Graph unit for BP7 compatible RTL
-    
+
     See the file COPYING.FPC, included in this distribution,
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
     for details about the copyright.
 
 
@@ -95,7 +95,7 @@ procedure SetBkColor(Color : longint);
 { FILL.PPI }
 { FILL.PPI }
 procedure FloodFill(x,y:integer; Border:longint);
 procedure FloodFill(x,y:integer; Border:longint);
 procedure GetFillSettings(var FillInfo : FillSettingsType);
 procedure GetFillSettings(var FillInfo : FillSettingsType);
-procedure GetFillPattern(var FillPattern : FillPatternType); 
+procedure GetFillPattern(var FillPattern : FillPatternType);
 procedure SetFillStyle(pattern : word;color : longint);
 procedure SetFillStyle(pattern : word;color : longint);
 procedure SetFillPattern(pattern : FillPatternType;color : longint);
 procedure SetFillPattern(pattern : FillPatternType;color : longint);
 
 
@@ -128,12 +128,14 @@ function  Convert(color:longint):longint;
 
 
 implementation
 implementation
 
 
+{$ASMMODE DIRECT}
+
 type
 type
   PString=^String;
   PString=^String;
   PInteger=^integer;
   PInteger=^integer;
   PWord=^word;
   PWord=^word;
   PLong=^longint;
   PLong=^longint;
-  
+
   VgaInfoBlock = record
   VgaInfoBlock = record
     VESASignature: array[1..4]of Char;
     VESASignature: array[1..4]of Char;
     VESAloVersion: Byte;
     VESAloVersion: Byte;
@@ -186,19 +188,19 @@ type
     OffscreenMem   : word;
     OffscreenMem   : word;
     reserved2      : Array[1..458]of Byte;
     reserved2      : Array[1..458]of Byte;
    end;
    end;
-    
+
 {$I MODES.PPI}
 {$I MODES.PPI}
 
 
 const
 const
      CheckRange    : Boolean=true;
      CheckRange    : Boolean=true;
      isVESA2       : Boolean=false;
      isVESA2       : Boolean=false;
      core          : longint=$E0000000;
      core          : longint=$E0000000;
-     
-var    { X/Y Verhaeltnis des Bildschirm }               
+
+var    { X/Y Verhaeltnis des Bildschirm }
        AspectRatio  : real;
        AspectRatio  : real;
        XAsp , YAsp  : Word;
        XAsp , YAsp  : Word;
        { Zeilen & Spalten des aktuellen Graphikmoduses }
        { Zeilen & Spalten des aktuellen Graphikmoduses }
-       _maxx,_maxy : longint; 
+       _maxx,_maxy : longint;
        { aktuell eingestellte Farbe }
        { aktuell eingestellte Farbe }
        aktcolor : longint;
        aktcolor : longint;
        { Hintegrundfarbe }
        { Hintegrundfarbe }
@@ -237,20 +239,20 @@ var    { X/Y Verhaeltnis des Bildschirm }
        { in diesem Puffer werden bei SetFillStyle bereits die Pattern in der }
        { in diesem Puffer werden bei SetFillStyle bereits die Pattern in der }
        { zu verwendenden Farbe abgelegt }
        { zu verwendenden Farbe abgelegt }
        PatternBuffer : Array[0..63]of LongInt;
        PatternBuffer : Array[0..63]of LongInt;
-       
+
        X_Array         : array[0..1280]of LongInt;
        X_Array         : array[0..1280]of LongInt;
        Y_Array         : array[0..1024]of LongInt;
        Y_Array         : array[0..1024]of LongInt;
 
 
-       Sel,Seg      : word;    
+       Sel,Seg      : word;
        VGAInfo      : VGAInfoBlock;
        VGAInfo      : VGAInfoBlock;
        VESAInfo     : VESAInfoBlock;
        VESAInfo     : VESAInfoBlock;
    { Selectors for Protected Mode }
    { Selectors for Protected Mode }
-       seg_WRITE    : word;    
-       seg_READ     : word;   
+       seg_WRITE    : word;
+       seg_READ     : word;
    { Registers for RealModeInterrupts in DPMI-Mode }
    { Registers for RealModeInterrupts in DPMI-Mode }
        dregs        : TRealRegs;
        dregs        : TRealRegs;
        AW_Bank      : longint;
        AW_Bank      : longint;
-       AR_Bank      : Longint;
+{       AR_Bank      : Longint;}
    { Variables for Bankswitching }
    { Variables for Bankswitching }
        BytesPerLine : longint;
        BytesPerLine : longint;
        BytesPerPixel: Word;
        BytesPerPixel: Word;
@@ -289,7 +291,7 @@ end;
 
 
 procedure Oh_Kacke(ErrString:String);
 procedure Oh_Kacke(ErrString:String);
 begin
 begin
-  CloseGraph; 
+  CloseGraph;
   writeln('Error in Unit VESA: ',ErrString);
   writeln('Error in Unit VESA: ',ErrString);
   halt;
   halt;
 end;
 end;
@@ -301,7 +303,7 @@ procedure WaitRetrace;
 begin
 begin
   asm
   asm
     cli
     cli
-    movw  $0x03Da,%dx 
+    movw  $0x03Da,%dx
 WaitNotHSyncLoop:
 WaitNotHSyncLoop:
     inb   %dx,%al
     inb   %dx,%al
     testb $0x8,%al
     testb $0x8,%al
@@ -313,7 +315,7 @@ WaitHSyncLoop:
     sti
     sti
   end;
   end;
 end;
 end;
-    
+
 procedure getmem(var p : pointer;size : longint);
 procedure getmem(var p : pointer;size : longint);
 begin
 begin
   asm
   asm
@@ -362,7 +364,7 @@ procedure graphdefaults;
          aktviewport.y2:=_maxy-1;
          aktviewport.y2:=_maxy-1;
 
 
          aktscreen:=aktviewport;
          aktscreen:=aktviewport;
-         
+
          { normaler Schreibmodus }
          { normaler Schreibmodus }
          setwritemode(normalput);
          setwritemode(normalput);
 
 
@@ -372,7 +374,7 @@ procedure graphdefaults;
          akttextinfo.charsize:=1;
          akttextinfo.charsize:=1;
          akttextinfo.horiz:=LeftText;
          akttextinfo.horiz:=LeftText;
          akttextinfo.vert:=TopText;
          akttextinfo.vert:=TopText;
-         
+
          { VergrӇerungsfaktoren}
          { VergrӇerungsfaktoren}
          XAsp:=10000; YAsp:=10000;
          XAsp:=10000; YAsp:=10000;
          aspectratio:=1;
          aspectratio:=1;
@@ -426,7 +428,7 @@ begin
     end;
     end;
   GetGraphMode:=GetVesaMode;
   GetGraphMode:=GetVesaMode;
 end;
 end;
-  
+
 procedure ClearViewport;
 procedure ClearViewport;
 var bank1,bank2,diff,c:longint;
 var bank1,bank2,diff,c:longint;
     ofs1,ofs2         :longint;
     ofs1,ofs2         :longint;
@@ -445,17 +447,17 @@ begin
   begin
   begin
     bank1:=ofs1 shr winshift;
     bank1:=ofs1 shr winshift;
     bank2:=ofs2 shr winshift;
     bank2:=ofs2 shr winshift;
-    if bank1 <> AW_BANK then 
-    begin 
-      Switchbank(bank1); 
+    if bank1 <> AW_BANK then
+    begin
+      Switchbank(bank1);
       AW_BANK:=bank1;
       AW_BANK:=bank1;
     end;
     end;
-    if bank1 <> bank2 then 
+    if bank1 <> bank2 then
     begin
     begin
       diff:=((bank2 shl winshift)-ofs1) div BytesPerPixel;
       diff:=((bank2 shl winshift)-ofs1) div BytesPerPixel;
       horizontalline(aktviewport.x1, aktviewport.x1+diff-1, y);
       horizontalline(aktviewport.x1, aktviewport.x1+diff-1, y);
       Switchbank(bank2); AW_BANK:=bank2;
       Switchbank(bank2); AW_BANK:=bank2;
-      horizontalline(aktviewport.x1+diff, aktviewport.x2, y); 
+      horizontalline(aktviewport.x1+diff, aktviewport.x2, y);
     end else horizontalline(aktviewport.x1, aktviewport.x2, y);
     end else horizontalline(aktviewport.x1, aktviewport.x2, y);
     ofs1:=ofs1 + BytesPerLine;
     ofs1:=ofs1 + BytesPerLine;
     ofs2:=ofs2 + BytesPerLine;
     ofs2:=ofs2 + BytesPerLine;
@@ -473,9 +475,9 @@ begin
     end;
     end;
     _XAsp:=XAsp; _YAsp:=YAsp;
     _XAsp:=XAsp; _YAsp:=YAsp;
 end;
 end;
-    
+
 procedure SetAspectRatio(_Xasp, _Yasp : word);
 procedure SetAspectRatio(_Xasp, _Yasp : word);
-begin     
+begin
   _graphresult:=grOk;
   _graphresult:=grOk;
     if not isgraphmode then
     if not isgraphmode then
       begin
       begin
@@ -483,8 +485,8 @@ begin
         exit;
         exit;
       end;
       end;
     Xasp:=_XAsp; YAsp:=_YAsp;
     Xasp:=_XAsp; YAsp:=_YAsp;
-end; 
-    
+end;
+
 
 
 procedure ClearDevice;
 procedure ClearDevice;
 var Viewport:ViewportType;
 var Viewport:ViewportType;
@@ -527,12 +529,12 @@ begin
   origcolor:=aktcolor;
   origcolor:=aktcolor;
   aktlineinfo.linestyle:=solidln;
   aktlineinfo.linestyle:=solidln;
   aktlineinfo.thickness:=normwidth;
   aktlineinfo.thickness:=normwidth;
-  case aktfillsettings.pattern of 
+  case aktfillsettings.pattern of
      0 : begin
      0 : begin
            aktcolor:=aktbackcolor;
            aktcolor:=aktbackcolor;
            for y:=y1 to y2 do line(x1,y,x2,y);
            for y:=y1 to y2 do line(x1,y,x2,y);
          end;
          end;
-     1 : begin 
+     1 : begin
            aktcolor:=aktfillsettings.color;
            aktcolor:=aktfillsettings.color;
            for y:=y1 to y2 do line(x1,y,x2,y);
            for y:=y1 to y2 do line(x1,y,x2,y);
          end;
          end;
@@ -540,7 +542,7 @@ begin
   end;
   end;
   aktcolor:=origcolor;
   aktcolor:=origcolor;
   aktlineinfo:=origlinesettings;
   aktlineinfo:=origlinesettings;
-end;  
+end;
 
 
 procedure bar3D(x1, y1, x2, y2 : integer;depth : word;top : boolean);
 procedure bar3D(x1, y1, x2, y2 : integer;depth : word;top : boolean);
 begin
 begin
@@ -630,7 +632,7 @@ end;
 
 
 procedure SetGraphMode(GraphMode:Integer);
 procedure SetGraphMode(GraphMode:Integer);
 
 
-var i,index:Integer;
+var index:Integer;
 begin
 begin
    _graphresult:=grOk;
    _graphresult:=grOk;
    if not isgraphmode then
    if not isgraphmode then
@@ -667,16 +669,16 @@ end;
 function GetMaxMode:Integer;
 function GetMaxMode:Integer;
 var i:Byte;
 var i:Byte;
 begin
 begin
-  for i:=VESANumber downto 0 do 
-    if GetVesaInfo(VESAModes[i]) then 
-    begin 
+  for i:=VESANumber downto 0 do
+    if GetVesaInfo(VESAModes[i]) then
+    begin
        GetMaxMode:=VESAModes[i];
        GetMaxMode:=VESAModes[i];
        Exit;
        Exit;
     end;
     end;
 end;
 end;
 
 
 function GetMaxX:Integer;
 function GetMaxX:Integer;
-begin 
+begin
   if not isgraphmode then
   if not isgraphmode then
     begin
     begin
       _graphresult:=grNoInitGraph;
       _graphresult:=grNoInitGraph;
@@ -724,7 +726,7 @@ begin
   if not isgraphmode then
   if not isgraphmode then
     begin
     begin
       _graphresult:=grNoInitGraph;
       _graphresult:=grNoInitGraph;
-      exit;                                          
+      exit;
     end;
     end;
   { Daten �berpr�fen }
   { Daten �berpr�fen }
   if (x1<0) or (y1<0) or (x2>=_maxx) or (y2>=_maxy) then exit;
   if (x1<0) or (y1<0) or (x2>=_maxx) or (y2>=_maxy) then exit;
@@ -734,7 +736,7 @@ begin
   aktviewport.y2:=y2;
   aktviewport.y2:=y2;
   aktviewport.clip:=clip;
   aktviewport.clip:=clip;
 end;
 end;
-      
+
 procedure GetViewSettings(var viewport : ViewPortType);
 procedure GetViewSettings(var viewport : ViewPortType);
 
 
 begin
 begin
@@ -772,7 +774,7 @@ procedure SetActivePage(page : word);
           exit;
           exit;
        end;
        end;
   end;
   end;
-    
+
 procedure SetWriteMode(WriteMode : integer);
 procedure SetWriteMode(WriteMode : integer);
 begin
 begin
   _graphresult:=grOk;
   _graphresult:=grOk;
@@ -785,7 +787,7 @@ begin
    begin
    begin
       _graphresult:=grError;
       _graphresult:=grError;
       exit;
       exit;
-   end; 
+   end;
   aktwritemode:=writemode;
   aktwritemode:=writemode;
 end;
 end;
 
 
@@ -807,7 +809,7 @@ end;
 
 
 begin
 begin
   InitVESA;
   InitVESA;
-  if not DetectVESA then Oh_Kacke('VESA-BIOS not found...'); 
+  if not DetectVESA then Oh_Kacke('VESA-BIOS not found...');
   startmode:=GetVESAMode;
   startmode:=GetVESAMode;
   bankswitchptr:=@switchbank;
   bankswitchptr:=@switchbank;
   GraphGetMemPtr:[email protected];
   GraphGetMemPtr:[email protected];
@@ -817,7 +819,7 @@ begin
    wrbuffer:=pointer($D0000000);
    wrbuffer:=pointer($D0000000);
    rbuffer:=pointer($D0200000);
    rbuffer:=pointer($D0200000);
    wbuffer:=pointer($D0200000);
    wbuffer:=pointer($D0200000);
-  end else begin 
+  end else begin
    wrbuffer:=pointer($0);
    wrbuffer:=pointer($0);
    rbuffer:=pointer($0);
    rbuffer:=pointer($0);
    wbuffer:=pointer($0);
    wbuffer:=pointer($0);
@@ -826,7 +828,11 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.3  1998-05-22 00:39:23  peter
+  Revision 1.4  1998-05-31 14:18:14  peter
+    * force att or direct assembling
+    * cleanup of some files
+
+  Revision 1.3  1998/05/22 00:39:23  peter
     * go32v1, go32v2 recompiles with the new objects
     * go32v1, go32v2 recompiles with the new objects
     * remake3 works again with go32v2
     * remake3 works again with go32v2
     - removed some "optimizes" from daniel which were wrong
     - removed some "optimizes" from daniel which were wrong