It ain’t rocket science

The author has been quiet of late (although he might be spreading his bile through comment spam again without it being noticed at this end) so your correspondent has decided to take it upon himself to post something without being directly prompted again; following on from the previous post, the topic this time is machine code and the basis for what follows is a comment in one of the author’s previous posts where he talks about your correspondent, saying:

I rejected ONE comment from him, because it said something like if he could program the Commodore 64, then anyone could do it […] Of course, absolutely anything is possible for some people but wouldn’t be possible for the vast majority. I get the distinct impression that he’s brilliant at maths and can probably do differential calculus and quadratic equations, whatever they are.

Ignoring the fact that it was all fiction (as explained a little more fully in the appropriate response) and lightly skipping over author’s attempt at what we’ll have to call insults for want of a better word (because wouldn’t the world be a truly horrific place if some people out there were different to the author and did things like maths for their own amusement) it should be noted that your correspondent hasn’t touched quadratic equations since GCSE maths at school over a quarter of a century ago and has never been directly exposed to differential calculus, at least not knowingly. This is because machine code isn’t about complicated maths and doesn’t require a Sheldon Cooper-esque mindset to work with either.

In fact machine code only really has addition and subtraction on the maths front, although it can be “persuaded” to do simple multiplication and division). We’ll take a fairly common “real world” example; we have a hardware sprite on screen and want to move it downwards by three pixels, the fastest way to do this is to add 3 directly to that hardware sprite’s current vertical position, so assuming it’s the first of the eight on the C64, that’s merely a case of…

LDA 53249
ADC #3
STA 53249

…and bingo, one sprite moved down without a single complicated formula! The equivalent in Commodore BASIC for this would be…


…and yes, it really is that similar. This is one of the reasons your correspondent simply doesn’t agree with the author that POKE (and indeed PEEK) are somehow heinous crimes against humanity; anybody who has done some actual programming will be aware that these two commands translate reasonably directly into machine code whilst extensions to BASIC don’t. Using a command like BORDER or MOVSPR teaches a novice absolutely nothing about how the machine actually works whilst POKEing to the colour or sprite registers does and it doesn’t really get much more complicated after that point than understanding how binary or logic gates work, both of which were taught as part of the GCSE computer studies curriculum when your correspondent was still in school. It really isn’t the rocket science that the author tells himself it is in order to excuse his own inability to learn it.

This entry was posted in Meta Discussion and tagged , , , , , . Bookmark the permalink.