+ implmemented FPC_LONGJMP for i8086

git-svn-id: branches/i8086@24034 -
This commit is contained in:
nickysn 2013-03-28 14:59:57 +00:00
parent 5cda24a0b6
commit 3b2ea4df6c
3 changed files with 19 additions and 3 deletions

View File

@ -31,6 +31,22 @@ asm
end;
Procedure fpc_longJmp (Var S : Jmp_buf; value : longint); assembler;nostackframe;[Public, alias : 'FPC_LONGJMP']; compilerproc;
Procedure fpc_longJmp (Var S : Jmp_buf; value : smallint); assembler;nostackframe;[Public, alias : 'FPC_LONGJMP']; compilerproc;
asm
mov bx, ax
mov ax, dx
test ax, ax
jnz @@L1
inc ax
@@L1:
mov si, word [bx + Jmp_buf.si]
mov di, word [bx + Jmp_buf.di]
mov dx, word [bx + Jmp_buf.pc]
mov bp, word [bx + Jmp_buf.bp]
mov sp, word [bx + Jmp_buf.sp]
mov bx, word [bx + Jmp_buf.bx]
// we should also clear the fpu
// fninit no must be done elsewhere PM
// or we should reset the control word also
jmp dx
end;

View File

@ -21,4 +21,4 @@ Type
PJmp_buf = ^jmp_buf;
Function Setjmp (Var S : Jmp_buf) : smallint; [external name 'FPC_SETJMP'];
Procedure longjmp (Var S : Jmp_buf; value : longint); [external name 'FPC_LONGJMP'];
Procedure longjmp (Var S : Jmp_buf; value : smallint); [external name 'FPC_LONGJMP'];

View File

@ -666,4 +666,4 @@ function fpc_longword_to_double(i: longword): double; compilerproc;
{$endif FPC_INCLUDE_SOFTWARE_LONGWORD_TO_DOUBLE}
function fpc_setjmp(var s : jmp_buf) : {$ifdef CPU16}smallint{$else}longint{$endif}; compilerproc;
procedure fpc_longjmp(var s : jmp_buf; value : longint); compilerproc;
procedure fpc_longjmp(var s : jmp_buf; value : {$ifdef CPU16}smallint{$else}longint{$endif}); compilerproc;