Assembly snippet

Assembly programming is programming at the lowest level. It is where the programmer (using mnemonics) describes the program in the processors own instruction set. It is the best approach to efficient, lean coding.

Over the years this form of programming has become synonymous with slow, laborious coding. Code can also quickly become hard to maintain, except if kept short. Assembly can still be very much a part of many programming projects if expertly handled.

Most suitable for hard and fast applications, our team occasionally utilise it to write drivers, still writing the application code in Embedded C/C++.

Most decent compilers make it very straight-forward to mix Embedded C and Assembly within the same program.

Our recent RFID project was the perfect example of Assembly programming success.The project required us to decode RFID data on-the-fly as it came in on a port pin. In this case, every processor cycle counted. This meant that the whole application needed to be in Assembly, as we had to have very low level control on how the PIC working register was used.

Another example of a project where we needed assembly programming was for a scientific instrument where we had to scan a photo-diode array every 10ms. The diode array consisted of 512 elements, so we had to scan through them very quickly with optimisations such as clocking data whilst A to D conversions were being performed. This is a classic example of where assembly programming comes into its own, as it is very difficult to multi-task in this way using C/C++ programming.

These are classic examples of where Assembly programming comes into its own.

At Bluefruit we believe in using the right tools for the right project to the best effect. Assembly still very much has a role to play.