I am currently studying X86_Intel 64-bit assembly and I want to run my assembly code on macOS. I have my code compiling and linking correctly on an Ubuntu VM using:
yasm -f elf64 -g dwarf2 -l div.lst div.asm
ld -o div div.o
However, when I use the same commands above I run into issues on macOS. Is there anything blatantly obvious that I am missing?
Jonathans-MacBook-Pro:Practical 2 jonathancopeland$ yasm --version
yasm 1.3.0
Compiled on Sep 15 2017.Copyright (c) 2001-2014 Peter Johnson and other Yasm developers.
Run yasm --license for licensing overview and summary.
Jonathans-MacBook-Pro:Practical 2 jonathancopeland$ yasm -f elf64 -g dwarf2 -l div.lst div.asm
Jonathans-MacBook-Pro:Practical 2 jonathancopeland$ ld -o div div.o
**ld: warning: -arch not specified
ld: warning: -macosx_version_min not specified, assuming 10.11ld: warning: ignoring file div.o, file was built for unsupportedfile format ( 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 ) which is not the architecture being linked (x86_64): div.o
Undefined symbols for architecture x86_64:
"start", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for inferred architecture x86_64
Jonathans-MacBook-Pro:Practical 2 jonathancopeland$**
Here is a screenshot of my code, file structure and terminal