	.386
	.model use32 small
	PUBLIC _setjmp,_longjmp
	.code
_setjmp:
	mov	eax,[esp+4]
	mov	[eax],ecx
	mov	[eax+4],edx
	mov	[eax+8],ebx
	mov	[eax+12],esp
	add	dword ptr [eax+12],4
	mov	[eax+16],ebp
	mov	[eax+20],esi
	mov	[eax+24],edi
	mov	ecx,[esp]
	mov	[eax+32],ecx
	mov	ecx,eax
	sub	eax,eax
	lahf
	mov	[ecx+28],eax
	sub	eax,eax
	ret
_longjmp:
	mov	eax,[esp+4]
	mov	ecx,[esp+8]
	mov	esp,[eax+12]
	push	ecx
	mov	ecx,[eax+32]
	xchg	[esp],ecx
	push	ecx
	mov	ecx,[eax]
	mov	edx,[eax+4]
	mov	ebx,[eax+8]
	mov	ebp,[eax+16]
	mov	esi,[eax+20]
	mov	edi,[eax+24]
	mov	eax,[eax+28]
	sahf
	pop	eax
	ret
	end