The Dumbest Program in the World! Lesson 1
We're going to write our first program together. It's going to be the best program at doing nothing that has ever been programed. Type this into your terminal. What this does is create a file with nothing in it. Believe it or not, it will assemble. It won't link, though. We'll see why in a bit. If you enter that command again, it'll just update the time stamp on it. Even if there's something in the file, now. So let's look at it. As you can see, it is zero bytes long. Let's assemble it and see nothing happen. When NASM runs, the only time it will output any text is when something is wrong. So if it doesn't say anything, that's good. GCC, GAS, TCC, and LD all do that, too. The -f elf64 argument tells the assembler to target a 64 bit executable. That's what we want. nothing.asm is our source file. -o nothing.o is the output file. So, if we ls -l again we should see the .o file. There it is. 304 bytes of nothing. Let's try to li...