inline assembler Q

I was trying some online assembler. In the listing below all assembly statements compile ok except
OUT PORTB, R24. Above it is OUT 0x08, R21 whic works. I thought that all the AVR register and port names can be used in inline assembler, but seem they can't.
So how do I define/introduce a constant or port name like PortD, or if reserved, _PORTD or something?
In some assemblers you just write like: PORTD EQU 0Fh or Something equ 123 etc.
Otherwise said: why doesn't OUT PORTB, R24 work?
thanks!

the test list:
asm volatile(
"cli \n\t"
"nop" "\n\t"
"MOV R2,R1 \n\t"
"ldi R24, 0b1110 \n\t"
"ldi R23, 0x3F \n\t"
"ldi R22, 25 \n\t"
"OUT 0x08, R21 \n\t"
"OUT PORTB, R24 \n\t" // doesn't compile
"sei" "\n\t"
);

How I dealt with the limitation...

Define assembly macros (the function does not have to be referenced but it does have to appear before the macros are used)...
http://code.google.com/p/arduino-tiny/source/browse/TinyDebugKnockBang.cpp?repo=debugknockbang#62

Use the _SFR_IO_ADDR macro to pass the register address into the assembly as a parameter...
http://code.google.com/p/arduino-tiny/source/browse/TinyDebugKnockBang.cpp?repo=debugknockbang#555

Thanks!
the following code still does not compile:

"OUT _SFR_IO_ADDR(PORTA), R12 \n\t"
I look your link, but it was so terribly complicated.
Why can't I just use simple assembler in CC?

Can you give me an example how to output to address range $00 - $3F that must be used with instructions/commands IN and OUT. That is for example: what do I need to do in my code to output to PORTA (=0x22)?
What includes and defs etc. to use. I have used assembler a lot but not avr and not inline c. All is so frustrating and confusing.
Thanks

P.S. reading avr-libc: AVR Libc makes me mad, heh.

wasmuaria:
Thanks!

You are welcome.

Can you give me an example how to output to address range $00 - $3F that must be used with instructions/commands IN and OUT.

An example using the SREG register...

void setup() {
  uint8_t SaveSREG;

  asm volatile
  (
    // Disable interrupts
    "in    %[SaveSREG], %[sreg]"                      "\n\t"
    "cli"                                             "\n\t"

    // Restore interrupts
    "out   %[sreg], %[SaveSREG]"                      "\n\t"

    :
      // Outputs
      [SaveSREG] "=&r" ( SaveSREG )
      
    :
      // Inputs
      [sreg] "I" ( _SFR_IO_ADDR( SREG ) )
      
    :
      // Clobbers
  );


}

void loop() {
  // put your main code here, to run repeatedly:

}

Mixing ASM and C isn't my specialty, but I think maybe the reason why the defines aren't working is in sfr_defs.h. It seems to do different things depending on whether it's included by a C or ASM compiler. In that case, the PORTA defines may be optimized for C use and not compatible with inline ASM.

Just a thought...