Commit a584e560 authored by John van Groningen's avatar John van Groningen

port to 64 bit linux

parent 1308f139
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 -DLINUX64 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_linux64.s
as copy_graph_to_string_interface_linux64.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 -DLINUX64 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_linux64.s
as copy_string_to_graph_interface_linux64.s -o copy_string_to_graph_interface.o
cp copy_string_to_graph_interface.o "Clean System Files"/copy_string_to_graph_interface.o
......@@ -6,7 +6,7 @@
# define INT_descriptor dINT
# define ARCH_64 1
#else
# ifdef MACH_O64
# if defined (MACH_O64) || defined (LINUX64)
# define Int long long
# define INT_descriptor dINT
# define ARCH_64 1
......@@ -15,8 +15,10 @@
# define INT_descriptor INT
# define ARCH_64 0
# endif
# define __STRING__ _STRING__
# define __ARRAY__ _ARRAY__
# ifndef LINUX64
# define __STRING__ _STRING__
# define __ARRAY__ _ARRAY__
# endif
#endif
extern void *INT_descriptor,*CHAR,*BOOL,*REAL,*__STRING__,*__ARRAY__;
......
.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
call copy_graph_to_string
mov rsp,rbp
mov rcx,qword ptr [rsp]
push rax
mov rdi,rcx
lea rsi,[r13+r15*8]
mov rbp,rsp
and rsp,-8
call remove_forwarding_pointers_from_graph
mov rsp,rbp
pop rcx
mov rsi,r12
mov rdi,r13
test rcx,rcx
jne __copy__graph__to__string_1
pop rcx
lea rbx,1[r15]
sub r15,rbx
call collect_1
add r15,rbx
jmp __copy__graph__to__string
__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
......@@ -6,7 +6,7 @@
# define INT_descriptor dINT
# define ARCH_64 1
#else
# ifdef MACH_O64
# if defined (MACH_O64) || defined (LINUX64)
# define Int long long
# define INT_descriptor dINT
# define ARCH_64 1
......@@ -15,8 +15,10 @@
# define INT_descriptor INT
# define ARCH_64 0
# endif
# define __STRING__ _STRING__
# define __ARRAY__ _ARRAY__
# ifndef LINUX64
# define __STRING__ _STRING__
# define __ARRAY__ _ARRAY__
# endif
#endif
extern void *INT_descriptor,*CHAR,*BOOL,*REAL,*__STRING__,*__ARRAY__;
......
.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
call copy_string_to_graph
mov rsp,rbp
mov rsi,r12
mov rdi,r13
test rax,1
je __copy__string__to__graph_1
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
call remove_forwarding_pointers_from_string
mov rsp,rbp
mov rsi,r12
mov rdi,r13
pop rbx
pop rcx
sub rbx,rdi
sar rbx,3
sub r15,rbx
call collect_1
add r15,rbx
jmp __copy__string__to__graph
__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
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