Posts

Showing posts from September, 2024

The Dumbest Program in the World! Lesson 1

Image
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...

Let's learn together.

As a teen in the 80s, I had an interest in computer programming. The only computers I had access to was TRS-80 Model IIIs, a few Commodore 64s, and a few Apple IIs at school. Computers were fairly expensive back then, so there was little oppurtunity for me to own my own computer. My dad's car cost less than many computers of the day. So, I graduated high school. Started working in local resturaunts in Branson, Missouri. My interests gradually diverged from the 8-bit computers of the day. In the late 90s, something happened that renewed my interest in owning a computer. I got a girlfriend who wanted to e-mail, mySpace, and ICQ with me. I started looking for computers. They weren't terribly cheap, even then, but the computers of the 90s were a little less expensive than the 8-bit beasts of the 80. They were orders of magnitude more capable than the 80s models too. So, I bought an IBM Aptiva from a catalog. Ever since, I've been online. Long story short, I've renewed an in...