Commit 517c66bb authored by John van Groningen's avatar John van Groningen

port to mac os x

parent 724e0efd
all: copy_graph_to_string.o copy_graph_to_string_interface.o copy_string_to_graph.o copy_string_to_graph_interface.o
copy_graph_to_string.o: copy_graph_to_string.c
gcc -S -O -DMACH_O64 copy_graph_to_string.c -o copy_graph_to_string.a
sed -f s2.sed copy_graph_to_string.a > copy_graph_to_string.s
as copy_graph_to_string.s -o copy_graph_to_string.o
cp copy_graph_to_string.o "Clean System Files"/copy_graph_to_string.o
copy_graph_to_string_interface.o: copy_graph_to_string_interface_macho.s
as copy_graph_to_string_interface_macho.s -o copy_graph_to_string_interface.o
cp copy_graph_to_string_interface.o "Clean System Files"/copy_graph_to_string_interface.o
copy_string_to_graph.o: copy_string_to_graph.c
gcc -S -O -DMACH_O64 copy_string_to_graph.c -o copy_string_to_graph.a
sed -f s2.sed copy_string_to_graph.a > copy_string_to_graph.s
as copy_string_to_graph.s -o copy_string_to_graph.o
cp copy_string_to_graph.o "Clean System Files"/copy_string_to_graph.o
copy_string_to_graph_interface.o: copy_string_to_graph_interface_macho.s
as copy_string_to_graph_interface_macho.s -o copy_string_to_graph_interface.o
cp copy_string_to_graph_interface.o "Clean System Files"/copy_string_to_graph_interface.o
......@@ -5,8 +5,13 @@
# define Int __int64
# define INT_descriptor dINT
#else
# define Int int
# define INT_descriptor INT
# ifdef MACH_O64
# define Int long long
# define INT_descriptor dINT
# else
# define Int int
# define INT_descriptor INT
# endif
# define __STRING__ _STRING__
# define __ARRAY__ _ARRAY__
#endif
......
.globl _copy_graph_to_string
.globl _remove_forwarding_pointers_from_graph
.globl collect_1
.text
.intel_syntax noprefix
.globl __copy__graph__to__string
__copy__graph__to__string:
push rcx
mov r12,rsi
mov r13,rdi
mov rdi,rcx
mov rsi,r13
lea rdx,[r13+r15*8]
mov rbp,rsp
and rsp,-8
.att_syntax
call _copy_graph_to_string
.intel_syntax noprefix
mov rsp,rbp
mov rcx,qword ptr [rsp]
push rax
mov rdi,rcx
lea rsi,[r13+r15*8]
mov rbp,rsp
and rsp,-8
.att_syntax
call _remove_forwarding_pointers_from_graph
.intel_syntax noprefix
mov rsp,rbp
pop rcx
mov rsi,r12
mov rdi,r13
test rcx,rcx
.att_syntax
jne __copy__graph__to__string_1
.intel_syntax noprefix
pop rcx
lea rbx,1[r15]
sub r15,rbx
.att_syntax
call collect_1
.intel_syntax noprefix
add r15,rbx
.att_syntax
jmp __copy__graph__to__string
.intel_syntax noprefix
__copy__graph__to__string_1:
add rsp,8
mov rax,qword ptr 8[rcx]
add rax,16+7
and rax,-8
add rdi,rax
sar rax,3
sub r15,rax
ret
......@@ -5,8 +5,13 @@
# define Int __int64
# define INT_descriptor dINT
#else
# define Int int
# define INT_descriptor INT
# ifdef MACH_O64
# define Int long long
# define INT_descriptor dINT
# else
# define Int int
# define INT_descriptor INT
# endif
# define __STRING__ _STRING__
# define __ARRAY__ _ARRAY__
#endif
......
.globl collect_1
.globl _copy_string_to_graph
.globl _remove_forwarding_pointers_from_string
.text
.intel_syntax noprefix
.globl __copy__string__to__graph
__copy__string__to__graph:
push rcx
sub rsp,8
mov r12,rsi
mov r13,rdi
mov rdi,rcx
mov rsi,r13
lea rdx,[r13+r15*8]
mov rcx,rsp
mov rbp,rsp
and rsp,-8
.att_syntax
call _copy_string_to_graph
.intel_syntax noprefix
mov rsp,rbp
mov rsi,r12
mov rdi,r13
test rax,1
.att_syntax
je __copy__string__to__graph_1
.intel_syntax noprefix
mov rcx,qword ptr 8[rsp]
and rax,-8
mov r12,rsi
mov r13,rdi
mov rdi,rcx
mov rsi,rax
mov rbp,rsp
and rsp,-8
.att_syntax
call _remove_forwarding_pointers_from_string
.intel_syntax noprefix
mov rsp,rbp
mov rsi,r12
mov rdi,r13
pop rbx
pop rcx
sub rbx,rdi
sar rbx,3
sub r15,rbx
.att_syntax
call collect_1
.intel_syntax noprefix
add r15,rbx
.att_syntax
jmp __copy__string__to__graph
.intel_syntax noprefix
__copy__string__to__graph_1:
mov rbx,rdi
mov rdi,qword ptr [rsp]
mov rcx,rax
sub rbx,rdi
sar rbx,3
add r15,rbx
add rsp,16
ret
s/_dINT/dINT/
s/_CHAR/CHAR/
s/_BOOL/BOOL/
s/_REAL/REAL/
s/_static_characters/static_characters/
s/_small_integers/small_integers/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment