mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 13:59:28 +02:00
* implemented several i8086 procs, some are stubs/not yet implemented
git-svn-id: branches/i8086@23862 -
This commit is contained in:
parent
8cb0f96200
commit
d2cd13a5c9
@ -17,3 +17,75 @@
|
||||
procedure fpc_cpuinit;
|
||||
begin
|
||||
end;
|
||||
|
||||
{$define FPC_SYSTEM_HAS_SPTR}
|
||||
Function Sptr : Pointer;assembler;nostackframe;
|
||||
asm
|
||||
mov ax, sp
|
||||
end;
|
||||
|
||||
{$define FPC_SYSTEM_HAS_GET_CALLER_ADDR}
|
||||
function get_caller_addr(framebp:pointer;addr:pointer=nil):pointer;nostackframe;assembler;
|
||||
asm
|
||||
or ax, ax
|
||||
jz @@Lg_a_null
|
||||
xchg ax, bx
|
||||
mov bx, [bx+2]
|
||||
xchg ax, bx
|
||||
@@Lg_a_null:
|
||||
end;
|
||||
|
||||
{$define FPC_SYSTEM_HAS_GET_CALLER_FRAME}
|
||||
function get_caller_frame(framebp:pointer;addr:pointer=nil):pointer;nostackframe;assembler;
|
||||
asm
|
||||
or ax, ax
|
||||
jz @@Lgnf_null
|
||||
xchg ax, bx
|
||||
mov bx, [bx]
|
||||
xchg ax, bx
|
||||
@@Lgnf_null:
|
||||
end;
|
||||
|
||||
{TODO: fix, use smallint?}
|
||||
function InterLockedDecrement (var Target: longint) : longint; assembler;
|
||||
asm
|
||||
push bx
|
||||
mov bx, ax
|
||||
sub word [bx], 1
|
||||
sbb word [bx+2], 0
|
||||
mov ax, [bx]
|
||||
mov dx, [bx+2]
|
||||
pop bx
|
||||
end;
|
||||
|
||||
{TODO: fix, use smallint?}
|
||||
function InterLockedIncrement (var Target: longint) : longint; assembler;
|
||||
asm
|
||||
push bx
|
||||
mov bx, ax
|
||||
add word [bx], 1
|
||||
adc word [bx+2], 0
|
||||
mov ax, [bx]
|
||||
mov dx, [bx+2]
|
||||
pop bx
|
||||
end;
|
||||
|
||||
{TODO: fix, use smallint?}
|
||||
function InterLockedExchange (var Target: longint;Source : longint) : longint;
|
||||
begin
|
||||
InterLockedExchange := Target;
|
||||
Target := Source;
|
||||
end;
|
||||
|
||||
{TODO: implement}
|
||||
function InterLockedExchangeAdd (var Target: longint;Source : longint) : longint;
|
||||
begin
|
||||
runerror(304);
|
||||
end;
|
||||
|
||||
{TODO: implement}
|
||||
function InterlockedCompareExchange(var Target: longint; NewValue: longint; Comperand: longint): longint;
|
||||
begin
|
||||
runerror(304);
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user