* m68k: Fixed damage caused by r27573 and r28177:

* longjmp: restored loading of function result (d0) which got removed in r28177.
  * While at the point, added test for zero, because longjmp must never return zero values.
  * Assembler reader: 'fp' refers to frame pointer, not the stack pointer.

git-svn-id: trunk@28183 -
This commit is contained in:
sergei 2014-07-08 15:04:54 +00:00
parent 3a7cde492e
commit cfe13734e0
2 changed files with 8 additions and 2 deletions

View File

@ -220,7 +220,7 @@ const
if lower(s)='sp' then
actasmregister:=NR_STACK_POINTER_REG;
if lower(s)='fp' then
actasmregister:=NR_STACK_POINTER_REG;
actasmregister:=NR_FRAME_POINTER_REG;
if actasmregister<>NR_NO then
begin
result:=true;

View File

@ -56,7 +56,13 @@ Procedure fpc_longJmp (Var S : Jmp_buf; value : longint); assembler;nostackframe
asm
// load S to a0
move.l 4(sp),a0
// load 'value' to d0
move.l 8(sp),d0
// don't return zero
tst.l d0
seq d1
and.l #1,d1
or d1,d0
// restore FP
move.l (a0),fp
// restore SP