Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8041

Bare metal, Assembly language • Re: Error message compiling Assembly language

$
0
0
I'm using -m as per instruction from a video. As you can see, I don't know much about coding
I have never used -m, looks like it might be used for cross compiling or some such. If you ever see things like "i386" in peoples instructions then its for the wrong type of computer. The Pi has ARM Cortex-A76 CPU's (aarch64 or armv8). The assembly language is called A64.

Here is a trivial "hello" program to get you started:

Code:

.global _start_start:mov     w2, lenadr     x1, msgmov     w0, 1mov     w8, 64svc     0mov     w0, 0mov     w8, 93svc     0msg:.ascii "Hello, world\n"len  =  . - msg
Run with .....

Code:

$ as hello.s -o hello.o && ld -s hello.o -o hello$ ./helloHello, world

Statistics: Posted by jahboater — Sun Apr 06, 2025 10:56 am



Viewing all articles
Browse latest Browse all 8041

Trending Articles