mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 16:09:25 +02:00
* setne operand size fixed
This commit is contained in:
parent
a01b4a31ee
commit
e24d5ca616
@ -86,10 +86,10 @@ type Tos=(osDOS,osOS2,osDPMI);
|
|||||||
var os_mode:Tos;
|
var os_mode:Tos;
|
||||||
first_meg:pointer;
|
first_meg:pointer;
|
||||||
|
|
||||||
type PSysThreadIB=^TSysThreadIB;
|
type Psysthreadib=^Tsysthreadib;
|
||||||
PThreadInfoBlock=^Tthreadinfoblock;
|
Pthreadinfoblock=^Tthreadinfoblock;
|
||||||
PPThreadInfoBlock=^PThreadInfoBlock;
|
PPThreadInfoBlock=^PThreadInfoBlock;
|
||||||
PProcessInfoBlock=^TProcessInfoBlock;
|
Pprocessinfoblock=^Tprocessinfoblock;
|
||||||
PPProcessInfoBlock=^PProcessInfoBlock;
|
PPProcessInfoBlock=^PProcessInfoBlock;
|
||||||
|
|
||||||
Tbytearray=array[0..$ffff] of byte;
|
Tbytearray=array[0..$ffff] of byte;
|
||||||
@ -170,6 +170,8 @@ procedure syscall; external name '___SYSCALL';
|
|||||||
|
|
||||||
{$S-}
|
{$S-}
|
||||||
procedure st1(stack_size:longint); assembler; [public,alias: 'FPC_STACKCHECK'];
|
procedure st1(stack_size:longint); assembler; [public,alias: 'FPC_STACKCHECK'];
|
||||||
|
{ called when trying to get local stack }
|
||||||
|
{ if the compiler directive $S is set }
|
||||||
|
|
||||||
asm
|
asm
|
||||||
movl stack_size,%ebx
|
movl stack_size,%ebx
|
||||||
@ -691,8 +693,8 @@ end;
|
|||||||
procedure MkDir (const S: string);
|
procedure MkDir (const S: string);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
If (s='') or (InOutRes <> 0) then
|
If (s='') or (InOutRes <> 0) then
|
||||||
exit;
|
exit;
|
||||||
DosDir ($39, S);
|
DosDir ($39, S);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -700,8 +702,8 @@ end;
|
|||||||
procedure rmdir(const s : string);
|
procedure rmdir(const s : string);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
If (s='') or (InOutRes <> 0) then
|
If (s='') or (InOutRes <> 0) then
|
||||||
exit;
|
exit;
|
||||||
DosDir ($3A, S);
|
DosDir ($3A, S);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -713,8 +715,8 @@ var RC: longint;
|
|||||||
Buffer: array [0..255] of char;
|
Buffer: array [0..255] of char;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
If (s='') or (InOutRes <> 0) then
|
If (s='') or (InOutRes <> 0) then
|
||||||
exit;
|
exit;
|
||||||
(* According to EMX documentation, EMX has only one current directory
|
(* According to EMX documentation, EMX has only one current directory
|
||||||
for all processes, so we'll use native calls under OS/2. *)
|
for all processes, so we'll use native calls under OS/2. *)
|
||||||
if os_Mode = osOS2 then
|
if os_Mode = osOS2 then
|
||||||
@ -868,41 +870,41 @@ var tib:Pthreadinfoblock;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
{Determine the operating system we are running on.}
|
{Determine the operating system we are running on.}
|
||||||
|
{$ASMMODE INTEL}
|
||||||
asm
|
asm
|
||||||
movl $0,os_mode
|
mov os_mode, 0
|
||||||
movw $0x7f0a,%ax
|
mov ax, 7F0Ah
|
||||||
call syscall
|
call syscall
|
||||||
testw $512,%bx {Bit 9 is OS/2 flag.}
|
test bx, 512 {Bit 9 is OS/2 flag.}
|
||||||
setnzb os_mode
|
setne byte ptr os_mode
|
||||||
testw $4096,%bx
|
test bx, 4096
|
||||||
jz .LnoRSX
|
jz @noRSX
|
||||||
movl $2,os_mode
|
mov os_mode, 2
|
||||||
.LnoRSX:
|
@noRSX:
|
||||||
{ end;}
|
|
||||||
|
|
||||||
{Enable the brk area by initializing it with the initial heap size.}
|
{Enable the brk area by initializing it with the initial heap size.}
|
||||||
{ asm}
|
|
||||||
movw $0x7f01,%ax
|
mov ax, 7F01h
|
||||||
movl HeapSize,%edx
|
mov edx, HeapSize
|
||||||
addl heap_base,%edx
|
add edx, heap_base
|
||||||
call syscall
|
call syscall
|
||||||
cmpl $-1,%eax
|
cmp eax, -1
|
||||||
jnz .Lheapok
|
jnz @heapok
|
||||||
pushl $204
|
push dword 204
|
||||||
call HandleError
|
call HandleError
|
||||||
.Lheapok:
|
@heapok:
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{Now request, if we are running under DOS,
|
{Now request, if we are running under DOS,
|
||||||
read-access to the first meg. of memory.}
|
read-access to the first meg. of memory.}
|
||||||
if os_mode in [osDOS,osDPMI] then
|
if os_mode in [osDOS,osDPMI] then
|
||||||
asm
|
asm
|
||||||
movw $0x7f13,%ax
|
mov ax, 7F13h
|
||||||
xorl %ebx,%ebx
|
xor ebx, ebx
|
||||||
movl $0xfff,%ecx
|
mov ecx, 0FFFh
|
||||||
xorl %edx,%edx
|
xor edx, edx
|
||||||
call syscall
|
call syscall
|
||||||
movl %eax,first_meg
|
mov first_meg, eax
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -956,7 +958,10 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.11 2001-03-21 23:29:40 florian
|
Revision 1.12 2001-04-20 19:05:11 hajny
|
||||||
|
* setne operand size fixed
|
||||||
|
|
||||||
|
Revision 1.11 2001/03/21 23:29:40 florian
|
||||||
+ sLineBreak and misc. stuff for Kylix compatiblity
|
+ sLineBreak and misc. stuff for Kylix compatiblity
|
||||||
|
|
||||||
Revision 1.10 2001/03/21 21:08:20 hajny
|
Revision 1.10 2001/03/21 21:08:20 hajny
|
||||||
|
Loading…
Reference in New Issue
Block a user