asm source

Till Straumann strauman at SLAC.Stanford.EDU
Mon Aug 18 19:23:16 UTC 2003


I learned about embedded assembly code from
 a) gcc info pages
 b) studying low-level linux and RTEMS kernel and
    driver code.

Try 'info gcc' and go into the menus;
  Introduction
    C Extensions
      Extended Asm
where you find an interesting section
 "Assembler Instructions with C Expression Operands"

HTH

-- Till

shannon wrote:
> Hello!
> When I read the source of RTEMS, I meet these codes:
> #if ( M68K_COLDFIRE_ARCH == 1 )
> #define m68k_flash_interrupts( _level ) \
>    do { register unsigned32 _tmpsr = 0x0700; \
> 	asm volatile ( "move.w 2,%sr\n\t" \
> 		       "or.l   2,1\n\t" \
> 		       "move.w 1,%sr" \
> 		       : "=d"(_tmpsr) : "0"(_tmpsr), "d"(_level) ); \
>    } while( 0 )
> 
> Please tell me if they are standard asm programs:
> 	move.w 2,%sr\n\t" \
> 	"or.l   2,1\n\t" \
> 	"move.w 1,%sr" \
> 	: "=d"(_tmpsr) : "0"(_tmpsr), "d"(_level) ); \
> 
> Are there some books that explain this kind of program.
> 
> 
>         shannon
>         zhou_xingjian at 163.com
>           2003-08-13
> 
> 





More information about the users mailing list