Skip to content
Snippets Groups Projects
Commit 242856cf authored by Markus Siemens's avatar Markus Siemens
Browse files

Fixed problems with nlx86.S on Linux

Fixed '#ifdef's so Linux would compile again and added
.scl and .type for Windows.
parent 19ccc6bd
No related branches found
No related tags found
No related merge requests found
...@@ -5,13 +5,14 @@ ...@@ -5,13 +5,14 @@
.text .text
/* uint nlr_push(4(%esp)=nlr_buf_t *nlr) */ /* uint nlr_push(4(%esp)=nlr_buf_t *nlr) */
#ifdef __apple_build_version__ #ifdef _WIN32
.globl _nlr_push
.def _nlr_push; .scl 2; .type 32; .endef
_nlr_push:
#else
.globl nlr_push .globl nlr_push
.type nlr_push, @function .type nlr_push, @function
nlr_push: nlr_push:
#else
.globl _nlr_push
_nlr_push:
#endif #endif
mov 4(%esp), %edx # load nlr_buf mov 4(%esp), %edx # load nlr_buf
mov (%esp), %eax # load return %ip mov (%esp), %eax # load return %ip
...@@ -26,35 +27,37 @@ _nlr_push: ...@@ -26,35 +27,37 @@ _nlr_push:
mov %edx, nlr_top # stor new nlr_buf (to make linked list) mov %edx, nlr_top # stor new nlr_buf (to make linked list)
xor %eax, %eax # return 0, normal return xor %eax, %eax # return 0, normal return
ret # return ret # return
#ifdef __apple_build_version__ #ifndef _WIN32
.size nlr_push, .-nlr_push .size nlr_push, .-nlr_push
#endif #endif
/* void nlr_pop() */ /* void nlr_pop() */
#ifdef __apple_build_version__ #ifdef _WIN32
.globl _nlr_pop
.def _nlr_pop; .scl 2; .type 32; .endef
_nlr_pop:
#else
.globl nlr_pop .globl nlr_pop
.type nlr_pop, @function .type nlr_pop, @function
nlr_pop: nlr_pop:
#else
.globl _nlr_pop
_nlr_pop:
#endif #endif
mov nlr_top, %eax # load nlr_top mov nlr_top, %eax # load nlr_top
mov (%eax), %eax # load prev nlr_buf mov (%eax), %eax # load prev nlr_buf
mov %eax, nlr_top # store nlr_top (to unlink list) mov %eax, nlr_top # store nlr_top (to unlink list)
ret # return ret # return
#ifdef __apple_build_version__ #ifndef _WIN32
.size nlr_pop, .-nlr_pop .size nlr_pop, .-nlr_pop
#endif #endif
/* void nlr_jump(4(%esp)=uint val) */ /* void nlr_jump(4(%esp)=uint val) */
#ifdef __apple_build_version__ #ifdef _WIN32
.globl _nlr_jump
.def _nlr_jump; .scl 2; .type 32; .endef
_nlr_jump:
#else
.globl nlr_jump .globl nlr_jump
.type nlr_jump, @function .type nlr_jump, @function
nlr_jump: nlr_jump:
#else
.globl _nlr_jump
_nlr_jump:
#endif #endif
mov nlr_top, %edx # load nlr_top mov nlr_top, %edx # load nlr_top
mov 4(%esp), %eax # load return value mov 4(%esp), %eax # load return value
...@@ -71,12 +74,13 @@ nlr_jump: ...@@ -71,12 +74,13 @@ nlr_jump:
xor %eax, %eax # clear return register xor %eax, %eax # clear return register
inc %al # increase to make 1, non-local return inc %al # increase to make 1, non-local return
ret # return ret # return
#ifdef __apple_build_version__ #ifndef _WIN32
.size nlr_jump, .-nlr_jump .size nlr_jump, .-nlr_jump
#endif #endif
#ifdef __apple_build_version__ #ifndef _WIN32
.local nlr_top .local nlr_top
#endif #endif
.comm nlr_top,4,4 .comm nlr_top,4,4
#endif
#endif /* __i386__ */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment