Stephen Smith's Blog

Musings on Machine Learning…

Assembly Language Tutorial Four for MagPi Magazine

leave a comment »


I’m in the process of writing a series of Assembly Language tutorials for MagPi Magazine. The fourth one appeared in issue #119 on page 50.

The PDF version of the magazine is free to download, but MagPi always appreciates any donations.

This article leads readers through using the Raspberry Pi’s floating point unit (FPU) to perform a calculation. This article uses the 64-bit of Raspberry Pi OS and shows how to write an Assembly Language routine to calculate the distance between two points in two dimensions. This shows how to use the FPU to add, subtract, multiply and perform square roots. There is a C program that uses this Assembly Language distance() routine to calculate the distance between  a couple of sets of points. The tutorial shows how to use the gdb debugger to step through the program and examine the data as it is calculated.

If you want more detail, you can always consider my book Programming with 64-Bit ARM Assembly Language.

Written by smist08

June 30, 2022 at 1:17 pm

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.