The best way to learn about low-level programming is to do it! (At least an emulated version of it using a tool such as the fantastic Little Man Computer simulator available here.)

The LMC instruction set is simpler to the one used in the Cambridge A Level Computer Science 9608 syllabus, but it is similar enough to make a great first step, and you also have the benefit of the animation and visualisation tools from the simulator.

So start with the LMC instructions, which look like this:

ATTACHMENT DETAILS  GCSE-and-A-Level-Computer-Science-Little-Man-Computer-Instructions

An example program, say for adding two numbers, looks like this:

This article is not about learning LMC per se – I have covered that in other articles. If the above code looks daunting, try running it in the LMC simulator and see if you can follow what is happening. If it’s too difficult to understand at this stage, come back when you’ve studied the basics of LMC a bit more.

The above code in the Cambridge 9608 instruction set (see image below) looks like this:

Cambridge A Level Computer Science Low Level Programming Instructions

As you can see, the only differences are trivial variations in spelling.

The difference is more significant in the next example. This LMC program accepts input until 0 is entered:

The Cambridge 9608 version uses an alternative system for branching. We have JMP instead of BZA for unconditional jumping, but then we have JPE and JPN for jumping based on the result of a previous CMP (comparison). To see this in action, look at the code below.

Converting between LMC instructions and the Cambridge 9608 instructions is fairly straightforward once you are confident with the more basic LMC version. It may seem like extra work to learn two variations but the benefits certainly make it worth it – firstly you can use the LMC simulator as mentioned, and secondly by studying the differences and similarities you will deepen your understanding of the whole topic.

Please note that this is one of the topics in Computer Science which require some deep learning. You should expect to spend a bit of time getting to grips with it and to experience some initial confusion which will give way to various “aha” moments.

Oh, and one little detail that might help: you can’t use END as a label in Cambridge 9608 assembly as it is a keyword!

Good luck!

Leave a Reply

Your email address will not be published. Required fields are marked

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Join our mailing list

Join our mailing list to receive awesome articles about learning Python and Computer Science in a fun and accessible way, straight to your inbox.

 Take your Python skills to the next level!

with our free email course on object oriented programming with Python