I have a raspberry pi 2 & 4 and I have the same issue on both when I try to compile this assembler code.
filename : first.s
.global _start
_start:
mov r1, #20
mov r2, #10
mov r3, #90
ADD r2, r1, r3
svc 0
I'm using the command:
as -mfpu=vfpv4 -o first.o first.s
ld -o first first.o
using gdb allows me to step through everything and checking the registers with "info registers" everything looks fine. The at the end of the program it gives Illegal Instructions. It give illegal instruction if I comment out the svc line, the ADD line, etc.