$ nvim hi.s
$ as hi.s -o hi.o
$ ld hi.o -o hi
$ ./hi
$ echo $?
0
$ uname -a
Linux localhost 4.9.186-18806637 #1 SMP PREEMPT Fri Jul 3 14:52:04 KST 2020 aarch64 Android
$

$ cat hi.s
.global _start
_start:
mov x0, #0
mov x8, #93
svc 0
$

$ cat hello.s
.global _start
_start:
mov x0, #1
ldr x1, =message
ldr x2, =end_message
sub x2, x2, x1
mov x8, #64
svc 0

// mov x0, #0 // actually, let's return what
// write returned
mov x8, #93
svc 0

.data
message: .ascii "hello, android device\n"
end_message:
$ ./hello
hello, android device
$ echo $?
22

Follow

so I've established I can hunt and peck arm64 assembly with gnu calling conventions into nvim on my smart phone

maybe the important thing is that I could do hello world from memory, which is progress

Sign in to participate in the conversation
SoNoMu

SoNoMu (Sound Noise Music) is a mastodon instance for musicians, sound-artists, producers of any kind of aural noise, songwriters, bedroom producers, sonic manglers and algorave livecoders. -> more...