Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

Coldfire Inline Assembler issues

Posted by Nobody/Anonymous on January 18, 2005
Dear All,
I am not able to compile the assembly code in port.c file for mcf5272 port. I am compiling using Codewarrior C Compiler. Can anyone guide me as to what can be done.
Some of the code i am listing below.
asm volatile ("move.l %%d1,-8(%%sp) \n\t" \
"clr.l %%d1\n\t"\
"move.w %%sr,%%d1\n\t"\
"ori.l %0,%%d1\n\t"\
"andi.l %1,%%d1\n\t"\
"move.l %%d1,%%sp@-\n\t"\
"move.l -4(%%sp),%%d1\n\t" \
: /* no output */\
: "n" (EXSF_FORMAT(4) | EXSF_VECTOR(VECTOR_TMR0)), \
"n" (~STATUS_I(7)) );


asm volatile ("move.l %d0,%sp@- \n\t"\
"move.l %d1,%sp@-\n\t"\
"move.l %d2,%sp@-\n\t"\
"move.l %d3,%sp@-\n\t"\
"move.l %d4,%sp@-\n\t"\
"move.l %d5,%sp@-\n\t"\
"move.l %d6,%sp@-\n\t"\
"move.l %d7,%sp@-\n\t"\
"move.l %a0,%sp@-\n\t"\
"move.l %a1,%sp@-\n\t"\
"move.l %a2,%sp@-\n\t"\
"move.l %a3,%sp@-\n\t"\
"move.l %a4,%sp@-\n\t"\
"move.l %a5,%sp@-\n\t"\
"move.l %a6,%sp@-\n\t"\
"move.l pxCurrentTCB,%a0\n\t"\
"move.l %sp,(%a0)\n\t" );

Regards
Vivek Agarwal

RE: Coldfire Inline Assembler issues

Posted by Nobody/Anonymous on January 18, 2005
I'm not familiar with the ColdFire port but might be able to help if you can provide some of the compiler error messages.

Which compiler are you using? The port was written with gcc-m68k v2.95.3.

RE: Coldfire Inline Assembler issues

Posted by Nobody/Anonymous on January 18, 2005
I am using Metrowerks Codewarrior IDE and C Compiler for Coldfire for compiling and debugging.

the list of error are :-

Error : illegal use of asm inline function
port.c line 200 ove.l %sp@+,%d2 \n\t" "move.l %sp@+,%d1 \n\t" "move.l %sp@+,%d0 \n\t" );

Error : illegal use of asm inline function
port.c line 204 asm volatile ( "rte" );

Error : illegal use of asm inline function
port.c line 228 asm volatile ( "unlk %fp" );

Error : illegal use of asm inline function
port.c line 233 asm volatile ( "move.l %%d1,-8(%%sp) \n\t" \

Error : ';' expected
port.c line 241 : "n" (EXSF_FORMAT(4) | EXSF_VECTOR(VECTOR_TMR0)), \

Error : call of non-function
port.c line 242 "n" (~STATUS_I(7)) );

Error : illegal use of asm inline function
port.c line 244 %a6,%sp@- \n\t" "move.l pxCurrentTCB,%a0 \n\t" "move.l %sp,(%a0) \n\t" );

Error : illegal use of asm inline function
port.c line 246 ove.l %sp@+,%d2 \n\t" "move.l %sp@+,%d1 \n\t" "move.l %sp@+,%d0 \n\t" );

Error : illegal use of asm inline function
port.c line 248 asm volatile ( "rte" );

Error : illegal use of asm inline function
port.c line 271 asm volatile ( "move.l %%a7,%%d1 \n\t" \

Error : illegal use of asm inline function
port.c line 305 asm volatile ( "unlk %fp" );

Error : illegal use of asm inline function
port.c line 307 %a6,%sp@- \n\t" "move.l pxCurrentTCB,%a0 \n\t" "move.l %sp,(%a0) \n\t" );

Error : illegal use of asm inline function
port.c line 310 ove.l %sp@+,%d2 \n\t" "move.l %sp@+,%d1 \n\t" "move.l %sp@+,%d0 \n\t" );

Error : illegal use of asm inline function
port.c line 312 asm volatile ( "rte" );


RE: Coldfire Inline Assembler issues

Posted by Nobody/Anonymous on January 18, 2005
The syntax is GCC specific and will have to be converted to the syntax for your compiler.

RE: Coldfire Inline Assembler issues

Posted by Nobody/Anonymous on January 18, 2005
Any idea where can i get some info on this conversion. also is there any tools anybody knows of.

Any idea what the last 4 lines of the below inline mean starting from :

asm volatile ( "move.l %%d1,-8(%%sp) \n\t" \
"clr.l %%d1 \n\t" \
"move.w %%sr,%%d1 \n\t" \
"ori.l %0,%%d1 \n\t" \
"andi.l %1,%%d1 \n\t" \
"move.l %%d1,%%sp@- \n\t" \
"move.l -4(%%sp),%%d1 \n\t" \
: /* no output */ \
: "n" (EXSF_FORMAT(4) | EXSF_VECTOR(VECTOR_TMR0)), \
"n" (~STATUS_I(7)) );

also what the last line in below routine mean
asm volatile ("move.l %%a7,%%d1 \n\t"\
"move.l %0,%%a7\n\t"\
"movec.l %%a7,%%vbr\n\t"\
"move.l %%d1,%%a7\n\t"\
: : "n" (VBR) : "d1" );

Basically the use of : in inline assembly is unknow to me.
it would great if u could tell the above. i can then write the same according to my compiler.

RE: Coldfire Inline Assembler issues

Posted by Nobody/Anonymous on January 18, 2005
Maybe this helps:

http://gcc.gnu.org/onlinedocs/gcc-3.4.3/gcc/Constraints.html#index-operand-constraints_002c-_0040code_007basm_007d-1696


Here there is documentation for some of the asm features. I know the arm port uses the 'm' constraint as:

asm volatile ( "LDR R0, %0" : : "m" (pxCurrentTCB) );

to get the address of pxCurrentTCB.

The GCC inline assembler is very powerful and therfore unfortunately complex.

Also:
http://gcc.gnu.org/onlinedocs/gcc-3.4.3/gcc/Extended-Asm.html#Extended-Asm


RE: Coldfire Inline Assembler issues

Posted by Nobody/Anonymous on January 19, 2005
any idea what the below code does
what is fp. it is taken from port.c of mcf5272 port.

#ifndef OMIT_FRAME_POINTER
asm volatile ( "unlk %fp" );
#endif


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists