Hi Wayne.
Wayne Uroda wrote:
Hi everyone,
Firstly, I have built binutils-2.18.50 with the following patches
applied, in this order: (from /packaging/patches)
binutils-2.18-14x1-20x1-20x2-20x3-22x4-42x-42x0-461x.patch
binutils-2.18-msp430x24x-msp430x26x.patch
binutils-ld_scripts.patch
binutils-2.18-430X.patch
binutils builds and as far as I can tell the assembler contains some
kind of support for calla and other extended opcodes.
If I create a file test.asm and write in it:
calla #0x12345
...
When I try with the mcu set to msp430x2418 I get the following:
$ ./msp430-as -mmcu=msp430x2418 test.asm
test.asm: Assembler messages:
test.asm:1: Error: Illegal instruction or not implemented opcode.
it works fine though if my assembly file reads "call #0x1234" so I think
it doesn't know about calla somehow.
test.s43:
.text
calla #12346
.rpt #5
rlax r5
.rpt r3
pushx r6
>msp430-as -mmcu=msp430x2418 -ahlmsd=test.lst test.asm
test.lst:
--------------------------------------------
GAS LISTING test.asm page 1
1 .text
2 0000 B013 3A30 calla #12346
3 .rpt #5
4 0004 4418 0555 rlax r5
5 .rpt r3
6 0008 C318 0612 pushx r6
7
GAS LISTING test.asm page 2
NO DEFINED SYMBOLS
NO UNDEFINED SYMBOLS
--------------------------------------------
binutils-2.18, built with patches from cvs:
@echo "## Applying extra mspgcc patches..."
cd $(BUILDDIR)/$(BINUTILS); patch -p1 <
$(PATCHES)/binutils-2.18-14x1-20x1-20x2-20x3-22x4-42x-42x0-461x.patch
cd $(BUILDDIR)/$(BINUTILS); patch -p1 <
$(PATCHES)/binutils-2.18-msp430x24x-msp430x26x.patch
cd $(BUILDDIR)/$(BINUTILS); patch -p1 <
$(PATCHES)/binutils-ld_scripts.patch
cd $(BUILDDIR)/$(BINUTILS); patch -p1 <
$(PATCHES)/binutils-2.18-430X.patch
ifdef MSYSCON
@echo "## Applying patch for mingw build"
cd $(BUILDDIR)/$(BINUTILS); patch -p1 <
$(PATCHES)/binutils-mingw-objdump.patch
endif
Did you try to build binutils-2.18? Don't you get message that some of the
patches you applied to binutils-2.18.50 failed?
I have also built msp430-gcc according to the build instructions in the
mspgcc manual, against the patched version of binutils. I get the same
assembler error when I try to use inline assembly with the "calla"
instruction.
The same result - calla works in inline assembly. gcc 3.2.3 built from cvs
sources. As well as other 430X instructions:
inline void flash_t::Erase(address_t page)
{
asm volatile( "\r\n"
" push %B0 \r\n"
" push %A0 \r\n"
" popx.a %A0 \r\n"
" mov %3, %2 \r\n" // FCTL1 = FWKEY | ERASE;
" clrx 0(%A0) \r\n"
:"=r"(page)
:"0"(page), "m"(FCTL1), "i"((uint16_t)FWKEY | ERASE)
);
}
lss:
inline void flash_t::Erase(address_t page)
{
asm volatile( "\r\n"
febe: 0e 4c mov r12, r14
fec0: 0f 4d mov r13, r15
fec2: 0f 12 push r15
fec4: 0e 12 push r14
fec6: 00 18 7e 41 popx.a r14
feca: b2 40 02 a5 mov #-23294,&0x0128 ;#0xa502
fece: 28 01
fed0: 40 18 8e 43 clrx 0(r14) ;0x00000(r14)
fed4: 00 00
Sergey.