Saturday, November 5, 2011

Machine Language

So I have my first machine language program under my belt. I was pretty happy when I turned it in, I felt like I was on my way to being a real computer scientist. I'd heard about machine language, about how the only language that computers really understand was all ones and zeros. And it is just ones and zeros. High volts and low. But it's not like they learn it from their mothers. They really are machines, not even slightly sentient. A coherent instruction set architecture has to be hard-wired into place or there is no machine language. That being said, I am more and more astonished by computers, the complexity of the hardware, the equal complexity and depth of the software running on it and operating the protocols running between them. The engineering underlying all our daily computing just astonishes me. Of course I still shake my fist at them when I can't get something to work.
Writing a program in machine language isn't as tough as it sounds, even though the instructions are pretty limited. I've learned that there's a lot you can do with Load, Store, Add, And, and Not. But debugging was really tedious. Every time I needed to change a line in the code, I had to go back and recalculate the offset positions of all the memory addresses I was using, from hexadecimal to decimal and then back to binary. Wheew! Even Assembly languages do that for you. Could be worse though, I could be writing my program by punching holes into paper cards, feeding them into the computer, looking at the holes punched into other cards by the computer, and then trying to debug that. It's a marvellous modern world we live in.

No comments:

Post a Comment