Skip to content

Conversation

delphi-coder
Copy link
Contributor

@delphi-coder delphi-coder commented Apr 22, 2023

NASM 64 bit assembly - x86 architecture - Linux OS
I rewrite the whole code and also changed the SQRT part to use SSE commands (this is the same thing that gcc/g++ does) and finally could gain a time lower than C/C++

NASM 64 bit assembly - x86 architecture - Linux OS
Dependency to C library such as printf and exit removed. Now it use services provided by OS via syscall.
@ali77gh ali77gh merged commit 3070e4e into ali77gh:master Apr 24, 2023
@ali77gh
Copy link
Owner

ali77gh commented Apr 27, 2023

I have problem with compiling prime.asm

nasm -f elf prime.asm && gcc prime.o -o prime

output:

prime.asm:24: warning: 64-bit unsigned relocation zero-extended from 32 bits [-w+zext-reloc]
prime.asm:73: warning: 64-bit unsigned relocation zero-extended from 32 bits [-w+zext-reloc]
prime.asm:96: warning: 64-bit unsigned relocation zero-extended from 32 bits [-w+zext-reloc]
/usr/bin/ld: prime.o: in function `_start':
prime.asm:(.text+0x0): multiple definition of `_start'; /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/Scrt1.o:(.text+0x0): first defined here
/usr/bin/ld: i386 architecture of input file `prime.o' is incompatible with i386:x86-64 output
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status

I don't really know asm but it seems there is a problem with multiple definition of `_start'.
Or am I doing something Wrong?

@delphi-coder
Copy link
Contributor Author

try compiling as mentioned in line 10&11 of source code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants