Case Studies: Assembly Language in the Real World
Speed-up
For one project I was working on a rebar scanner which used a magnetic sensor to detect and graphically display the depths and widths of steel bars embedded in reinforced concrete. In one mode the scanner could be rolled along a wall and the display would show a diagram of the positions of the bars within that part of the wall. This was originally designed to be used on relatively small 5 metre sections of wall – however, the engineers using it wanted to be able to attach it to a vehicle and drive along a much longer tunnel, 50 to 100 metres long, mapping out all the rebars in one go. This meant that the algorithm used to convert the raw sensor data into the diagram of the wall had to deal with much more data, and still give a result in just a few seconds.
Small chip
In another case, I was called in to debug a car part responsible for measuring the level of fuel remaining in a petrol tank. For some reason these devices were failing within a few hours of being activated, and the engineers at the company responsible were baffled.As the sensor was such a small component, it had a small and relatively simple processor, which meant that all of the code written for it was written in assembly language. To debug this I had to work through the code line by line, with pencil and paper to keep track of the contents of the registers. I eventually discovered that it was possible for the program to look for some data at position “0” of a table, when the positions went from “1” upwards, which would crash the program. Had the program been written in a language like C or Python this error would have been relatively obvious, but as it was in assembler it was easy to miss this subtle problem.Both of these cases showed situations where using assembly language was useful – either to speed up a program or to allow the use of a smaller, simpler chip – but also the problems that come along with it.How Computers Work: Demystifying Computation

Our purpose is to transform access to education.
We offer a diverse selection of courses from leading universities and cultural institutions from around the world. These are delivered one step at a time, and are accessible on mobile, tablet and desktop, so you can fit learning around your life.
We believe learning should be an enjoyable, social experience, so our courses offer the opportunity to discuss what you’re learning with others as you go, helping you make fresh discoveries and form new ideas.
You can unlock new opportunities with unlimited access to hundreds of online short courses for a year by subscribing to our Unlimited package. Build your knowledge with top universities and organisations.
Learn more about how FutureLearn is transforming access to education