Last change
on this file since 676 was 1, checked in by vboxsync, 55 years ago |
import
|
-
Property svn:keywords
set to
Id
|
File size:
2.4 KB
|
Line | |
---|
1 | ; $Id: setjmp.asm 1 1970-01-01 00:00:00Z vboxsync $
|
---|
2 | ;; @file
|
---|
3 | ; InnoTek Portable Runtime - No-CRT setjmp & longjmp - AMD64 & X86.
|
---|
4 | ;
|
---|
5 |
|
---|
6 | ;
|
---|
7 | ; Copyright (C) 2006 InnoTek Systemberatung GmbH
|
---|
8 | ;
|
---|
9 | ; This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | ; available from http://www.virtualbox.org. This file is free software;
|
---|
11 | ; you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | ; General Public License as published by the Free Software Foundation,
|
---|
13 | ; in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
|
---|
14 | ; distribution. VirtualBox OSE is distributed in the hope that it will
|
---|
15 | ; be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | ;
|
---|
17 | ; If you received this file as part of a commercial VirtualBox
|
---|
18 | ; distribution, then only the terms of your commercial VirtualBox
|
---|
19 | ; license agreement apply instead of the previous paragraph.
|
---|
20 | ;
|
---|
21 |
|
---|
22 | %include "iprt/asmdefs.mac"
|
---|
23 |
|
---|
24 |
|
---|
25 | BEGINCODE
|
---|
26 |
|
---|
27 |
|
---|
28 | BEGINPROC RT_NOCRT(setjmp)
|
---|
29 | %ifdef __AMD64__
|
---|
30 | mov rax, [rsp]
|
---|
31 | mov [rdi + 00h], rax ; rip
|
---|
32 | lea rcx, [rsp + 8]
|
---|
33 | mov [rdi + 08h], rcx ; rsp
|
---|
34 | mov [rdi + 10h], rbp
|
---|
35 | mov [rdi + 18h], r15
|
---|
36 | mov [rdi + 20h], r14
|
---|
37 | mov [rdi + 28h], r13
|
---|
38 | mov [rdi + 30h], r12
|
---|
39 | mov [rdi + 38h], rbx
|
---|
40 | %else
|
---|
41 | mov edx, [esp + 4h]
|
---|
42 | mov eax, [esp]
|
---|
43 | mov [edx + 00h], eax ; eip
|
---|
44 | lea ecx, [esp + 4h]
|
---|
45 | mov [edx + 04h], ecx ; esp
|
---|
46 | mov [edx + 08h], ebp
|
---|
47 | mov [edx + 0ch], ebx
|
---|
48 | mov [edx + 10h], edi
|
---|
49 | mov [edx + 14h], esi
|
---|
50 | %endif
|
---|
51 | xor eax, eax
|
---|
52 | ret
|
---|
53 | ENDPROC RT_NOCRT(setjmp)
|
---|
54 |
|
---|
55 |
|
---|
56 | BEGINPROC RT_NOCRT(longjmp)
|
---|
57 | %ifdef __AMD64__
|
---|
58 | mov rbx, [rdi + 38h]
|
---|
59 | mov r12, [rdi + 30h]
|
---|
60 | mov r13, [rdi + 28h]
|
---|
61 | mov r14, [rdi + 20h]
|
---|
62 | mov r15, [rdi + 18h]
|
---|
63 | mov rbp, [rdi + 10h]
|
---|
64 | mov eax, esi
|
---|
65 | test eax, eax
|
---|
66 | jnz .fine
|
---|
67 | inc al
|
---|
68 | .fine:
|
---|
69 | mov rsp, [rdi + 08h]
|
---|
70 | jmp qword [rdi + 00h]
|
---|
71 | %else
|
---|
72 | mov edx, [esp + 4h]
|
---|
73 | mov eax, [esp + 8h]
|
---|
74 | mov esi, [edx + 14h]
|
---|
75 | mov edi, [edx + 10h]
|
---|
76 | mov ebx, [edx + 0ch]
|
---|
77 | mov ebp, [edx + 08h]
|
---|
78 | test eax, eax
|
---|
79 | jnz .fine
|
---|
80 | inc al
|
---|
81 | .fine:
|
---|
82 | mov esp, [edx + 04h]
|
---|
83 | jmp dword [edx + 00h]
|
---|
84 | %endif
|
---|
85 | ENDPROC RT_NOCRT(longjmp)
|
---|
86 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.