Browse Source

* Small adaptions to use the ATT parser a little bit more.

daniel 27 years ago
parent
commit
9fcc870caf
1 changed files with 29 additions and 33 deletions
  1. 29 33
      rtl/os2/sysos2.pas

+ 29 - 33
rtl/os2/sysos2.pas

@@ -123,6 +123,7 @@ procedure st1(stack_size:longint);[public,alias: 'STACKCHECK'];
 begin
 begin
     { called when trying to get local stack }
     { called when trying to get local stack }
     { if the compiler directive $S is set   }
     { if the compiler directive $S is set   }
+    {$ASMMODE DIRECT}
     asm
     asm
         movl stack_size,%ebx
         movl stack_size,%ebx
         movl %esp,%eax
         movl %esp,%eax
@@ -130,23 +131,24 @@ begin
 {$ifdef SYSTEMDEBUG}
 {$ifdef SYSTEMDEBUG}
         movl U_SYSOS2_LOWESTSTACK,%ebx
         movl U_SYSOS2_LOWESTSTACK,%ebx
         cmpl %eax,%ebx
         cmpl %eax,%ebx
-        jb   .Lis_not_lowest
+        jb   Lis_not_lowest
         movl %eax,U_SYSOS2_LOWESTSTACK
         movl %eax,U_SYSOS2_LOWESTSTACK
-    .Lis_not_lowest:
+    Lis_not_lowest:
 {$endif SYSTEMDEBUG}
 {$endif SYSTEMDEBUG}
         cmpb $2,U_SYSOS2_OS_MODE
         cmpb $2,U_SYSOS2_OS_MODE
-        jne .Lrunning_in_dos
+        jne Lrunning_in_dos
         movl U_SYSOS2_STACKBOTTOM,%ebx
         movl U_SYSOS2_STACKBOTTOM,%ebx
-        jmp .Lrunning_in_os2
-    .Lrunning_in_dos:
+        jmp Lrunning_in_os2
+    Lrunning_in_dos:
         movl __heap_brk,%ebx
         movl __heap_brk,%ebx
-    .Lrunning_in_os2:
+    Lrunning_in_os2:
         cmpl %eax,%ebx
         cmpl %eax,%ebx
-        jae  .Lshort_on_stack
+        jae  Lshort_on_stack
         leave
         leave
         ret  $4
         ret  $4
-    .Lshort_on_stack:
+    Lshort_on_stack:
     end ['EAX','EBX'];
     end ['EAX','EBX'];
+    {$ASMMODE ATT}
     { this needs a local variable }
     { this needs a local variable }
     { so the function called itself !! }
     { so the function called itself !! }
     { Writeln('low in stack ');}
     { Writeln('low in stack ');}
@@ -170,28 +172,22 @@ begin
     end;
     end;
 end;
 end;
 
 
-function paramcount:longint;
 
 
-begin
-     asm
-        movl _argc,%eax
-        decl %eax
-        leave
-        ret
-     end ['EAX'];
-end;
+{$asmmode direct}
+function paramcount:longint;assembler;
+
+asm
+    movl _argc,%eax
+    decl %eax
+end ['EAX'];
 
 
 function paramstr(l:longint):string;
 function paramstr(l:longint):string;
 
 
-    function args:pointer;
+    function args:pointer;assembler;
 
 
-    begin
-        asm
-            movl _argv,%eax
-            leave
-            ret
-        end ['EAX'];
-    end;
+    asm
+        movl _argv,%eax
+    end ['EAX'];
 
 
 var p:^Pchar;
 var p:^Pchar;
 
 
@@ -204,6 +200,8 @@ begin
      else paramstr:='';
      else paramstr:='';
 end;
 end;
 
 
+{$asmmode att}
+
 procedure randomize;
 procedure randomize;
 
 
 var hl:longint;
 var hl:longint;
@@ -239,15 +237,13 @@ begin
     end;
     end;
 end;
 end;
 
 
-function getheapstart:pointer;
+{$ASMMODE direct}
+function getheapstart:pointer;assembler;
 
 
-begin
-    asm
-        movl __heap_base,%eax
-        leave
-        ret
-    end ['EAX'];
-end;
+asm
+    movl __heap_base,%eax
+end ['EAX'];
+{$ASMMODE att}
 
 
 {$i heap.inc}
 {$i heap.inc}