Suppose I have the following asm program, exit.s
:
.section .text
.globl _start
_start:
movl $1, %eax
movl $0, %ebx
int $0x80
When I run the following command to build the object file:
$ as exit.s -o exit.o
What exactly is this doing, and why is this needed? From the book "Programming from the ground up":
An object file is code that is in the machine's language, but has not been completely put together.
I thought that was the whole point of the assembly language itself? What then is the difference between an assembly program (exit.s) and an object file (exit.o). Couldn't both be read by a computer, for example doing hexdump on the first line:
0000000 2e 73 65 63 74 69 6f 6e 20 2e 74 65 78 74 0a
000000f
Why couldn't the computer understand that directly?