I'm having trouble getting a simple project of 1 file of assembly to build. This the code and error.
.globl _start
_start:
ldc r1, 100
notmain:
sub r1,r1,1
bt r1, notmain
ldc r3,0x4000
shl r3,r3,4
setc res[r3],0x8
ldc r1,0x6
setc res[r1],0x8
// ldc r2, 8
// setd res[r1], r2
setc res[r1],0xf
top:
ldc r0, 0x8
out res[r3], r0
ldc r0, 0x4
out res[r3], r0
ldc r0, 0x2
out res[r3], r0
ldc r0, 0x1
out res[r3], r0
ldc r0, 0x2
out res[r3], r0
ldc r0, 0x4
out res[r3], r0
bu top
**** Build of configuration Debug for project test ****
xmake CONFIG=Debug all
No modules used.
Checking xmos.com for board support package: XC-1
Installed BSP for target XC-1
Creating dependencies for test.S
Creating test_Debug.xe
../src/test.S: Error: Multiple definition of '_start'
crt1.S: Error: first defined here
xmake[1]: *** [bin/Debug/test_Debug.xe] Error 1
xmake: *** [bin/Debug/test_Debug.xe] Error 2
What am I missing? Thanks.
I just found the xcc comand line manual, I think this will help get me going....
assembly only project
-
- Member++
- Posts: 19
- Joined: Wed Jan 14, 2015 2:17 am
-
- XCore Legend
- Posts: 1913
- Joined: Thu Jun 10, 2010 11:43 am
Please post the error and details on how you are compiling this source file.
-
- Member++
- Posts: 19
- Joined: Wed Jan 14, 2015 2:17 am
I added the error output to the original post. Thanks.
-
- XCore Legend
- Posts: 1913
- Joined: Thu Jun 10, 2010 11:43 am
Try the following:
1) Create a new project -> change the target hardware to XC-1A
2) cut & paste the text below into the default .xc file. Then save as same file name but with .s suffix.
3) Then manually delete the empty .xc file leaving only the .s assembler source file.
4) Build the project.
**** Build of configuration Debug for project first_assembler ****
xmake CONFIG=Debug all
No modules used.
Build Complete
Credit goes to this thread:
http://www.xcore.com/forum/viewtopic.ph ... =assembler
1) Create a new project -> change the target hardware to XC-1A
2) cut & paste the text below into the default .xc file. Then save as same file name but with .s suffix.
3) Then manually delete the empty .xc file leaving only the .s assembler source file.
4) Build the project.
**** Build of configuration Debug for project first_assembler ****
xmake CONFIG=Debug all
No modules used.
Build Complete
Credit goes to this thread:
http://www.xcore.com/forum/viewtopic.ph ... =assembler
Code: Select all
.text
.file "first_assembler.S"
.globl main
.globl main.nstackwords
.linkset main.nstackwords, 0
main:
_start:
entsp 0
ldc r1, 100
notmain:
sub r1,r1,1
bt r1, notmain
ldc r3,0x4000
shl r3,r3,4
setc res[r3],0x8
ldc r1,0x6
setc res[r1],0x8
setc res[r1],0xf
top:
ldc r0, 0x8
out res[r3], r0
ldc r0, 0x4
out res[r3], r0
ldc r0, 0x2
out res[r3], r0
ldc r0, 0x1
out res[r3], r0
ldc r0, 0x2
out res[r3], r0
ldc r0, 0x4
out res[r3], r0
bu top
-
- Member++
- Posts: 19
- Joined: Wed Jan 14, 2015 2:17 am
Built first try. Thanks. I'll readup on the changes to the file and see what I was missing. Probably the "main:" label.