New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

GNU Assembly Programming on the Excito Bubba (original)

Discuss development on Bubba
Post Reply
wmnelis
Posts: 8
Joined: 21 Jun 2007, 10:30

GNU Assembly Programming on the Excito Bubba (original)

Post by wmnelis »

Hi all. I have been trying to get a very simple assembly program working on the Bubba. Here is the code:

Code: Select all

#
# hello.s - As simple a program as you can get. Just to get a compile
#	    and successful run.
#
.section .text, "x"

.global	_start

_start:
	ADD	r0, r0, r1
	MOV	pc, lr
The code compiles just fine, but will Segfault. In fact any assembly code that I write and compile on this platform immediately Segfaults. I am assuming that I am passing the wrong arguments to as. Right now the only one I am passing is the following: "-march=armv4t". I am actually using the makefile below, but if anyone has a working example code that is compiled by just calling as from the command line I would appreciate seeing that too (and the command line used of course).

Makefile:

Code: Select all

##
## Macros
##

# Environment macros
AS=as
LD=ld
#CC=C:/MinGW/bin/gcc.exe
#RC=C:/MinGW/bin/windres.exe
RM=rm -f

# Project macros
EXE_NAME=hello #Put the name you want the executable to have here
ASFLAGS=-march=armv4t
LDFLAGS=

##
## File List
##

# Project file list (leave off the suffixes)
SOURCE_FILES=		\
	hello

# 3rd party file list
LIBRARIES=			\
	#Put any required 3rd party libraries here

##
## Suffix rules (do not change)
##

##
## Commands (do not change)
##

# Build the executable only
exe:				\
	compile			\
	all

# Compile all files
compile: ${SOURCE_FILES:=.s}
	${AS} ${ASFLAGS} -o ${SOURCE_FILES:=.o} ${SOURCE_FILES:=.s} ${LIBRARIES}

# Link object files into executable
all: ${SOURCE_FILES:=.o}
	${LD} ${LDFLAGS} -o ${EXE_NAME} ${SOURCE_FILES:=.o} ${LIBRARIES}

# Get rid of all non-source files
clean:
	${RM} ${EXE_NAME} ${SOURCE_FILES:=.o}
Just trying to get any assembly code to run. Thanks for any help you can offer.
Post Reply