mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-14 14:09:09 +02:00
+ implemented fpc_setjmp and fpc_longjmp for the Z80
git-svn-id: branches/z80@45095 -
This commit is contained in:
parent
085fdcf3ab
commit
3afdab19a1
@ -16,11 +16,49 @@
|
|||||||
|
|
||||||
function fpc_setjmp(var S : jmp_buf) : shortint;assembler;[Public, alias : 'FPC_SETJMP'];nostackframe;compilerproc;
|
function fpc_setjmp(var S : jmp_buf) : shortint;assembler;[Public, alias : 'FPC_SETJMP'];nostackframe;compilerproc;
|
||||||
asm
|
asm
|
||||||
|
push ix
|
||||||
|
ld ix, 0
|
||||||
|
add ix,sp
|
||||||
|
|
||||||
|
ld l, (ix+4) { (S) }
|
||||||
|
ld h, (ix+5) { (S+1) }
|
||||||
|
|
||||||
|
ld iy, 0
|
||||||
|
add iy, sp
|
||||||
|
push iy
|
||||||
|
pop bc
|
||||||
|
ld (hl), c
|
||||||
|
inc hl
|
||||||
|
ld (hl), b
|
||||||
|
inc hl
|
||||||
|
|
||||||
|
ld l, 0
|
||||||
|
|
||||||
|
pop ix
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure fpc_longjmp(var S : jmp_buf;value : shortint);assembler;[Public, alias : 'FPC_LONGJMP'];compilerproc;
|
procedure fpc_longjmp(var S : jmp_buf;value : shortint);assembler;[Public, alias : 'FPC_LONGJMP'];nostackframe;compilerproc;
|
||||||
asm
|
asm
|
||||||
|
push ix
|
||||||
|
ld ix, 0
|
||||||
|
add ix, sp
|
||||||
|
|
||||||
|
ld d, (ix+6) { (value) }
|
||||||
|
|
||||||
|
ld l, (ix+4) { (S) }
|
||||||
|
ld h, (ix+5) { (S+1) }
|
||||||
|
ld c, (hl)
|
||||||
|
inc hl
|
||||||
|
ld b, (hl)
|
||||||
|
inc hl
|
||||||
|
push bc
|
||||||
|
pop iy
|
||||||
|
ld sp, iy
|
||||||
|
|
||||||
|
ld l, d
|
||||||
|
|
||||||
|
pop ix
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,7 +16,8 @@
|
|||||||
|
|
||||||
type
|
type
|
||||||
jmp_buf = packed record
|
jmp_buf = packed record
|
||||||
f,a,b,c,e,d,l,h,ixlo,ixhi,iylo,iyhi,splo,sphi,pclo,pchi : byte;
|
sp: word;
|
||||||
|
{ f,a,b,c,e,d,l,h,ixlo,ixhi,iylo,iyhi,splo,sphi,pclo,pchi : byte;}
|
||||||
end;
|
end;
|
||||||
pjmp_buf = ^jmp_buf;
|
pjmp_buf = ^jmp_buf;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user