Browse Source

+ new stack checking implemented
+ IOCheck for chdir , getdir , mkdir and rmdir

carl 27 years ago
parent
commit
f7f3dfabaf
1 changed files with 14 additions and 16 deletions
  1. 14 16
      rtl/atari/sysatari.pas

+ 14 - 16
rtl/atari/sysatari.pas

@@ -44,22 +44,19 @@ const
        plongint = ^longint;
        plongint = ^longint;
 
 
 {$S-}
 {$S-}
-    procedure st1(stack_size : longint);[public,alias: 'STACKCHECK'];
-
-      begin
-         { called when trying to get local stack }
-         { if the compiler directive $S is set   }
-         { it must preserve all registers !!     }
+    procedure Stack_Check; assembler;
+    { Check for local variable allocation }
+    { On Entry -> d0 : size of local stack we are trying to allocate }
          asm
          asm
-           move.l   sp,d0
-           sub.l    stack_size,d0
-           cmp.l    __BREAK,d0
+          XDEF STACKCHECK
+           move.l  sp,d1            { get value of stack pointer            }
+           sub.l   d0,d1            {  sp - stack_size                      }
+           cmp.l    __BREAK,d1
            bgt      @st1nosweat
            bgt      @st1nosweat
            move.l   #202,d0
            move.l   #202,d0
            jsr      HALT_ERROR
            jsr      HALT_ERROR
          @st1nosweat:
          @st1nosweat:
          end;
          end;
-      end;
 
 
 
 
     procedure halt(errnum : byte);
     procedure halt(errnum : byte);
@@ -455,25 +452,25 @@ begin
 end;
 end;
 
 
 
 
-procedure mkdir(const s : string);
+procedure mkdir(const s : string);[IOCheck];
 begin
 begin
   DosDir($39,s);
   DosDir($39,s);
 end;
 end;
 
 
 
 
-procedure rmdir(const s : string);
+procedure rmdir(const s : string);[IOCheck];
 begin
 begin
   DosDir($3a,s);
   DosDir($3a,s);
 end;
 end;
 
 
 
 
-procedure chdir(const s : string);
+procedure chdir(const s : string);[IOCheck];
 begin
 begin
   DosDir($3b,s);
   DosDir($3b,s);
 end;
 end;
 
 
 
 
-procedure getdir(drivenr : byte;var dir : string);
+procedure getdir(drivenr : byte;var dir : string);[IOCheck];
 var
 var
   temp : array[0..255] of char;
   temp : array[0..255] of char;
   sof  : pchar;
   sof  : pchar;
@@ -567,8 +564,9 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.2  1998-05-25 12:13:51  carl
-   * bugfix of all routines with pea
+  Revision 1.3  1998-07-01 14:40:20  carl
+    + new stack checking implemented
+    + IOCheck for chdir , getdir , mkdir and rmdir
 
 
   Revision 1.1.1.1  1998/03/25 11:18:47  root
   Revision 1.1.1.1  1998/03/25 11:18:47  root
   * Restored version
   * Restored version