Stephen Smith's Blog

Musings on Machine Learning…

Programming with 64-Bit ARM Assembly Language

with 26 comments


Introduction

My first book on Assembly Language is Raspberry Pi Assembly Language Programming which is all about ARM 32-Bit Assembly Language Programming. This is since the official variant of Linux for the Raspberry Pi, Raspbian is 32-bit. There are good reasons for this, the most important being that until the Raspberry Pi 4, the maximum memory was 1Gig which isn’t enough to properly run a 64-bit version of Linux. Yes you can do it, but it’s rather painful.

Now with the Raspberry Pi 4 supporting 4Gig of RAM and other SBC’s like the nVidia Jetson Nano also containing 4Gig of RAM, running 64-bit operating systems makes a lot more sense. Further in the ARM world, all phones and tablets have moved to 64-bits. All Apple products are 64-bit and all but the very cheapest Android phones are 64-bit.

Hence I felt it made sense to create a 64-bit version of my book and my publisher Apress agreed. This resulted in my newest book: Programming with 64-Bit ARM Assembly Language.

Beyond the Raspberry Pi

Along with teaching how to program 64-bit ARM Assembly Language, the book goes beyond the Raspberry Pi to cover how to add Assembly Language routines to your Apple iOS or Google Android Apps. Every App developer is struggling to get their App noticed out of the millions of Apps in the App stores. Having better performance is one great way for users to recommend your App to their friends.

The book also covers how to write Assembly Language for ARM 64-Bit Linux including Ubuntu as included with the nVidia Jetson Nano or Kali Linux running on a Raspberry Pi 4. Further the book covers how to cross compile your code, compile/assemble it on a powerful Intel/AMD computer and then run it on your target device.

There is a lot of interest in IoT and embedded devices these days. Often these are based on ARM processors and often you need to do some Assembly Language programming to write the device drivers for the various custom pieces of hardware you are developing.

About ARM 64-Bit Assembly Language

When ARM developed the 64-bit version of their processor, they took the time to fix many problems that have developed over the years in the 32-bit versions. The Assembly Language syntax is more streamlined and a lot of little used features like conditional instructions were removed entirely. As a consequence this new book is a complete rewrite. Although anyone familiar with 32-bit ARM Assembly should find 64-bit Assembly familiar, there are a lot of differences and improvements, such as doubling the number of registers.

With the new book you learn how to utilize all the new features that are now available to you. How the instruction syntax is much more uniform across all the coprocessors and how to use all the new registers you have at your disposal.

The newest generations of the ARM processor all have deep execution pipelines and multiple cores. The new 64-bit instruction set is the foundation that allows the ARM processor to fully exploit these features and get the best performance for the smallest amount of power usage.

Where to Buy

With Covid-19, things are moving a bit slower than normal. The ePub versions of my book are available now from Apress directly. This should flow to all the other retailers shortly, in the meantime they have the book available for presale. The print version is in process, but I’m not sure how long it will take this time around. Here are some sample places where it is listed:

Over the coming weeks, it’ll change from pre-release to shipping now.

Summary

If you are interested in learning 64-Bit ARM Assembly Language, either to optimize your programs or to learn about the architecture of a modern RISC processor then this book is for you. I hope this book motivates people to use more Assembly Language in their work to produce high performance applications. When people are surveyed for their favorite features in applications, better performance is always top of the list.

Written by smist08

May 2, 2020 at 10:46 am

26 Responses

Subscribe to comments with RSS.

  1. With the stay at home order as an amateur I went through the Raspberry Pi Assembly Language Programming and was contemplating reading it through again to try and pick up more skill. A 64 bit version sounds interesting.

    Daniel Labelle

    May 2, 2020 at 9:45 pm

    • i too bout the book… the connection illustrations are really bad… have you found a better connection diagram??

      ray

      August 18, 2022 at 11:29 am

      • I wish I had more time and energy to focus on this subject… I did receive a copy of the the 64 bit version in the first version I think the harware level was not letting us write directly to the hardware but the 64 bit book recommended Kali linux. The 64 bit version of the same assembly code worked not able to remember much of the detail. I did have trouble figuring out the gpio connections because there are more than numbering systems I got a ribbon cable that has a numbered end that plugs into my breadboard. That really helped a lot

        Dan Labelle

        August 19, 2022 at 3:50 pm

      • Sorry about the lack of punctuation and errors

        Dan Labelle

        August 19, 2022 at 3:52 pm

  2. […] going to really work out since the show corresponded with the release of my second computer book: Programming with 64-Bit ARM Assembly Language from […]

  3. […] Programming with 64-Bit ARM Assembly Language […]

  4. […] For developers converting their applications, if they have Assembly Language code, this will have to be converted from Intel Assembly to ARM Assembly and of course a great resource to do this is my book: […]

  5. […] of these solutions have SDKs and you can program them using Assembly Language. However an Assembly Language program will only target one specific bit of hardware, though […]

  6. Hellow smist08,

    I really like your book “64-bit assembly language programming …”. FYI I am using Kali on arm64 (RPi 4B/8GB) as it was a suggested platform. I wanted to point out that OffSec’s pre-packaged arm64 build doesn’t include gdb, nor is it set up to pull from repos as-is.
    I found a workaround by adding Debian buster repos:

    # sudo echo deb http://ftp.us.debian.org/debian buster main >> /etc/apt/sources.list.d/debian.list

    Cheers,
    B

    ps – wasn’t 100% sure whether to post this on the 64-bit book’s github site, as it looks like it’s publisher-maintained.

    B. Student

    October 12, 2020 at 5:49 pm

    • Thanks, I’ll make sure to check this out for the second edition. Don’t remember having to do this myself, but these things keep changing.

      smist08

      October 13, 2020 at 9:13 am

  7. […] Apple Silicon which contain ARM CPUs. Of course I was excited about this since I wrote two books on ARM Assembly Language Programming. ARM processors are used in nearly all cell phones and tablets. They are used in single board […]

  8. […] If you are interested in the M1 ARM processor and want to learn more about how it works internally, then consider my book: Programming with 64-Bit ARM Assembly Language. […]

  9. […] If you are interested in the M1 ARM processor and want to learn more about how it works internally, then consider my book: Programming with 64-Bit ARM Assembly Language. […]

  10. […] If you are interested in the M1 ARM processor and want to learn more about how it works internally, then consider my book: Programming with 64-Bit ARM Assembly Language. […]

  11. […] systems. As we’ll see, doing this is going to require both reverse engineering and then writing ARM 64-bit Assembly Language […]

  12. […] The 64-bit instruction set used on all smartphones and tablets covered in my book “Programming with 64-Bit ARM Assembly Language”. […]

  13. […] Like Intel and AMD, ARM made the transition from 32-bit to 64-bit processors. As part of this they cleaned up the instruction set, added registers and created a third variant of ARM Assembly Language. iOS and Android are now fully 64-bit and you can run 64-bit versions of Linux on newer Raspberry Pis. The ARM 64-bit instruction set is the topic of my book: “Programming with 64-Bit ARM Assembly Language”. […]

  14. I come from China, this book is I use Google translate to learn, some of the following words is also done through Google translation, I hope I can get problem sets the reference answer, because I am a self-taught, not teachers to teaching, I hope to get your help, need through what way can I get to the answer to the problem?

    yiyi li

    November 6, 2021 at 8:45 am

    • There are answers to some of the questions in the back of the book. For the programs, the best way is to run them and ensure they run correctly. Writing code is the best way to learn.

      smist08

      November 6, 2021 at 1:14 pm

      • Can you provide all the answers?The system uses the answers to understand the meaning of the questions, which cannot be fully understood through Google Translate

        liyiyi

        November 10, 2021 at 5:53 am

  15. […] Assembly Language that are available such as: “Raspberry Pi Assembly Language Programming”, “Programming with 64-Bit ARM Assembly Language” and “RP2040 Assembly Language […]

  16. Is it possible to assemble 32 bit arm code on the 64 bit version of Raspi OS 64? Is there a reference in your RPi 64 bit Assembly text?

    jlgreer1

    November 14, 2021 at 12:17 pm

  17. […] have been shipping 64-bit versions since shortly after the Raspberry Pi 3 came out. My book, “Programming with 64-Bit ARM Assembly Language”, was written using the 64-bit version of Kali Linux, except for the parts specifically for […]

  18. […] This was a fairly long tutorial but I can only give so much detail. If you want more detail, you can always consider my book Programming with 64-Bit ARM Assembly Language. […]

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

  20. […] Series. My first three books were on the three types of ARM instruction sets, namely 32-bit, 64-bit and thumb (used in microcontrollers). The RISC-V instruction set architecture is more unified, so […]


Leave a comment

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