mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 18:29:28 +02:00
* fpc_setjmp and fpc_longjmp updated to support far code memory models
git-svn-id: trunk@24878 -
This commit is contained in:
parent
0de550c2c9
commit
70cd05caa8
@ -23,8 +23,12 @@ asm
|
||||
mov bx, ss:[bp + 4 + extra_param_offset] // S
|
||||
mov word [bx + Jmp_buf.bp], ax
|
||||
mov word [bx + Jmp_buf.sp], di
|
||||
mov di, word ss:[di]
|
||||
mov word [bx + Jmp_buf.ip], di
|
||||
mov cx, word ss:[di]
|
||||
mov word [bx + Jmp_buf.ip], cx
|
||||
{$ifdef FPC_X86_CODE_FAR}
|
||||
mov cx, word ss:[di + 2]
|
||||
mov word [bx + Jmp_buf.cs], cx
|
||||
{$endif FPC_X86_CODE_FAR}
|
||||
|
||||
xor ax, ax
|
||||
pop bp
|
||||
@ -47,5 +51,11 @@ asm
|
||||
// we should also clear the fpu
|
||||
// fninit no must be done elsewhere PM
|
||||
// or we should reset the control word also
|
||||
{$ifdef FPC_X86_CODE_NEAR}
|
||||
jmp word [bx + Jmp_buf.ip]
|
||||
{$else FPC_X86_CODE_NEAR}
|
||||
// the inline asm doesn't support jmp far yet, so we use db for now
|
||||
// jmp far [bx + Jmp_buf.ip]
|
||||
db 0FFh, 06Fh, Jmp_buf.ip
|
||||
{$endif FPC_X86_CODE_NEAR}
|
||||
end;
|
||||
|
@ -18,6 +18,9 @@ Type
|
||||
// bx,si,di: Word;
|
||||
bp,sp: Word;
|
||||
ip: Word;
|
||||
{$ifdef FPC_X86_CODE_FAR}
|
||||
cs: Word;
|
||||
{$endif FPC_X86_CODE_FAR}
|
||||
end;
|
||||
PJmp_buf = ^jmp_buf;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user