mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-09 16:49:00 +02:00
* m68k: fixed setjmp/longjmp:
* Data registers have to be saved/restored using 'move.l', because 'move' without suffix assumes 16-bit size. * setjmp must behave as a regular function w.r.t. removing its argument from the stack. git-svn-id: trunk@28103 -
This commit is contained in:
parent
847adff94d
commit
23a20f0e50
@ -26,8 +26,9 @@ asm
|
||||
move.l 4(sp), a0
|
||||
// save a0 (now in d0) to offset 40
|
||||
move.l d0, 40(a0)
|
||||
// save return address (PC)
|
||||
move.l (sp), d0
|
||||
// save return address (PC) and pop S off the stack
|
||||
move.l (sp)+, d0
|
||||
move.l d0,(sp)
|
||||
move.l d0, 8(a0)
|
||||
// save FP
|
||||
{$if defined(amiga)}
|
||||
@ -37,7 +38,8 @@ asm
|
||||
{$endif}
|
||||
// save SP
|
||||
move.l sp, d0
|
||||
addq.l #8, d0
|
||||
// 4 bytes already popped, 4 to go.
|
||||
addq.l #4, d0
|
||||
move.l d0, 4(a0)
|
||||
// save a1
|
||||
move.l a1,d0
|
||||
@ -55,13 +57,13 @@ asm
|
||||
move.l a5,d0
|
||||
move.l d0,60(a0)
|
||||
// save d1..d7
|
||||
move d1, 12(a0)
|
||||
move d2, 16(a0)
|
||||
move d3, 20(a0)
|
||||
move d4, 24(a0)
|
||||
move d5, 28(a0)
|
||||
move d6, 32(a0)
|
||||
move d7, 36(a0)
|
||||
move.l d1, 12(a0)
|
||||
move.l d2, 16(a0)
|
||||
move.l d3, 20(a0)
|
||||
move.l d4, 24(a0)
|
||||
move.l d5, 28(a0)
|
||||
move.l d6, 32(a0)
|
||||
move.l d7, 36(a0)
|
||||
// restore a0
|
||||
move.l 40(a0), a0
|
||||
|
||||
@ -90,13 +92,13 @@ asm
|
||||
move.l 60(a0),d0
|
||||
move.l d0,a5
|
||||
// restore d1..d7
|
||||
move 12(a0),d1
|
||||
move 16(a0),d2
|
||||
move 20(a0),d3
|
||||
move 24(a0),d4
|
||||
move 28(a0),d5
|
||||
move 32(a0),d6
|
||||
move 36(a0),d7
|
||||
move.l 12(a0),d1
|
||||
move.l 16(a0),d2
|
||||
move.l 20(a0),d3
|
||||
move.l 24(a0),d4
|
||||
move.l 28(a0),d5
|
||||
move.l 32(a0),d6
|
||||
move.l 36(a0),d7
|
||||
|
||||
// load value to d0
|
||||
move.l 8(sp),d0
|
||||
|
Loading…
Reference in New Issue
Block a user