Hi Chris,
Thanks for reply! I am writing inline assembly in C. Strangely, this
time it works. However, I just had another strange problem. Here is
the code doing 1million times of multiplications, I expected it finishes
in a couple seconds. However, it seems there is an infinite loop, and
it never ends. Did I do anything wrong?
Haodong
register uint16_t a1 = 1;
register uint16_t a2 = 2;
asm volatile (
" mov #1000, r15 \n"
" LPI: mov #1000, r14 \n"
" LPJ: mov %0, &0x0130 \n"
" mov %1, &0x0138 \n"
" mov &0x013a, %0 \n"
" mov &0x013c, %1 \n"
" inc %0 \n"
" inc %1 \n"
" dec r14 \n"
" jnz LPJ \n"
" dec r15 \n"
" jnz LPI \n"
:"+r"(a1), "+r"(a2)
:
);
Chris Liechti wrote:
Haodong Wang wrote:
I need to write assembly language to do extensive computations in
efficient way for my Telos-b mote project. The problem is that
mspgcc does not allow me to directly use the registers. I cannot
specify "R15" or "r15" in my program, otherwise it does not compile
with the error message " 'R15' undeclared".
works for me.
can you provide an example, some code and how you compile it?
are you writing separate assembler files (*.S) or inline assembler in C?
chris
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users