Skip to main content
Tweeted twitter.com/StackRaspi/status/1151371071846850561
added 34 characters in body
Source Link

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.

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.

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.

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.

Source Link

gcc does not compile code that compiles in 'as'

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.

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.