I'm trying to learn assembly using the raspberry pi. I have code that compiles using as
but will not compile with gcc
. I thought that as
was the backend for gcc
assembly so I'm confused why it is not working. It says that udiv
is undefined.
test.s
.global _start
_start:
MOV R4, #3
MOV R1, #999
UDIV R2, R1, R4
MOV R7, #1
SVC 0
Compiling with as -o test.o test.s; ld -o test test.o
works ok,
Compiling with gcc test.s -o test
fails.