Get coding on the Raspberry Pi 64-bit
Linux Format|February 2021
John Schwartzman demos using assembly language code for the 64-bit Raspberry Pi to call Linux kernel services and the C run-time library.
John Schwartzman
Get coding on the Raspberry Pi 64-bit

Learning assembly language won’t make you a faster programmer (slower, more likely). However, it just might make you a better programmer. By learning just what a processor can and can’t do, you’re on the way to a deeper understanding of computer science.

Assembly language is a low-level language. It’s specific to a particular processor. You use it to program a specific processor at the hardware level. Compilers understand assembly language, because that’s what they use to create the instructions in high-level languages. Take a C++ compiler: it strings together lots of assembly language instructions to do its work.

Every kind of program ultimately executes machine language on the computer. Assembly language is simply machine language with mnemonics. Mnemonics are names given to machine language instructions, also known as op codes, so that we don’t have to remember hundreds of numeric values. It enables us to write a program using identifiers such as ADD, SUB and MOV.

Raspberry Pis can run in 32-bit mode (AArch32) or 64-bit mode (AArch64) depending on the OS. In this tutorial we’ll look at AArch64 and install a small 64-bit desktop machine on the Pi. The Pi is a Reduced Instruction Set Computer (RISC) that performs smaller and faster operations than a Complex Instruction Set Computer (CISC) like the Intel x86_64.

Making use of the kernel

We’re using Linux and so the assembly language we write will use Linux kernel services. Even when we use the C library (glibc), the library methods we call will, in many cases, be thin wrappers around the Linux kernel services. It’s become obligatory to introduce every new programming language with a program that prints “Hello, world!” to the console, so we’ll start there.

هذه القصة مأخوذة من طبعة February 2021 من Linux Format.

ابدأ النسخة التجريبية المجانية من Magzter GOLD لمدة 7 أيام للوصول إلى آلاف القصص المتميزة المنسقة وأكثر من 9,000 مجلة وصحيفة.

هذه القصة مأخوذة من طبعة February 2021 من Linux Format.

ابدأ النسخة التجريبية المجانية من Magzter GOLD لمدة 7 أيام للوصول إلى آلاف القصص المتميزة المنسقة وأكثر من 9,000 مجلة وصحيفة.

المزيد من القصص من LINUX FORMAT مشاهدة الكل
Create your first WebSocket service
Linux Format

Create your first WebSocket service

Mihalis Tsoukalos explains how to use the Go programming language to work with the WebSocket protocol.

time-read
9 mins  |
April 2023
Fantastic Mr Firefox
Linux Format

Fantastic Mr Firefox

Nick Peers takes a trip down memory lane to reveal the story behind the rise - and slight fall - of Mozilla's popular web browser.

time-read
9 mins  |
April 2023
Set up your terminal and email like it's 1983
Linux Format

Set up your terminal and email like it's 1983

Jump in the hot terminal time machine with Mats Tage Axelsson who emails from the command line using the latest technology.

time-read
8 mins  |
April 2023
Universal layer text effects with GIMP
Linux Format

Universal layer text effects with GIMP

Posters use them, films and presentations are hard to imagine without them: text effects. Attract attention with Karsten Günther and GIMP.

time-read
8 mins  |
April 2023
Jump to a federated social network
Linux Format

Jump to a federated social network

Nick Peers reveals how you can get up and running with this free, decentralised and non-profit alternative to Twitter.

time-read
9 mins  |
April 2023
Free our SOFTWARE!
Linux Format

Free our SOFTWARE!

Taking anything for granted is dangerous, so Jonni Bidwell and Mike Saunders revisit how the free software movement got started to help free us from proprietary tyranny!

time-read
4 mins  |
April 2023
Master RPI.GPIO
Linux Format

Master RPI.GPIO

Les Pounder goes back to the early days of the Raspberry Pi - and his career with this classic library! -

time-read
5 mins  |
April 2023
Waveshare Zero to Pi3
Linux Format

Waveshare Zero to Pi3

Transform your Pi Zero into a Pi 3, they promised Les Pounder, but it's more like adding on go-faster stripes.

time-read
2 mins  |
April 2023
The Best OPEN SOURCE Software Ever!
Linux Format

The Best OPEN SOURCE Software Ever!

In an attempt to trigger controversy, Michael Reed and Neil Mohr unequivocally state these are the greatest free software apps ever. Probably. We’re just trying to be helpful.

time-read
10+ mins  |
April 2023
Linux-Mandrake 7
Linux Format

Linux-Mandrake 7

Simplicity and a wide range of applications make this a great distribution for all Linux users.

time-read
2 mins  |
April 2023