bugAVR C Runtime Library - Bugs: bug #18373, Bugs in Inline ASM documentacion

 
 

bug #18373: Bugs in Inline ASM documentacion

Submitted by:  None
Submitted on:  Sat 25 Nov 2006 02:45:32 PM UTC  
 
Category: DocumentationSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Documentation
Status: FixedPercent Complete: 0%
Assigned to: Joerg Wunsch <joerg_wunsch>Originator Email: -unavailable-
Open/Closed: ClosedRelease: None
Fixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 25 Nov 2006 02:45:32 PM UTC, original submission:

1. In section about inline asm you write that compiler doesn't support Read-Write operand. It isn't true. Checked.

2. There is simpler way to acces operands than by number. You can write sth like this:

static inline void delayus8(uint8_t t)
{
asm volatile(
"delayus8_loop%=: \n\t"
"nop \n\t"
"dec %[ticks] \n\t"
"brne delayus8_loop%= \n\t"
:[ticks]"+r"(t)
:
);
}

There is no need to make the same register as input and output because of "+r" - read-write operand. But if you want, you can make it this way:

asm volatile(
"delayus8_loop%=: \n\t"
"nop \n\t"
"dec %[ticks] \n\t"
"brne delayus8_loop%= \n\t"
:[ticks]"=r"(t)
:"ticks"(t)
);

But I found that it doesent always work correctly. It is compiled like compiler "think" it dont need to set register [ticks] before call asembler section.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by arcanum (Updated the item)
  • -unavailable- added by joerg_wunsch (Updated the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 30 Oct 2007 09:16:36 AM UTCjoerg_wunschAssigned toNone=>joerg_wunsch
      Open/ClosedOpen=>Closed
    Tue 30 Oct 2007 09:16:35 AM UTCjoerg_wunschStatusNone=>Fixed
    Sun 06 May 2007 03:54:33 PM UTCarcanumPriority9 - Immediate=>5 - Normal
    Sun 25 Mar 2007 01:03:07 AM UTCarcanumPriority5 - Normal=>9 - Immediate
    Mon 08 Jan 2007 12:57:58 PM UTCjoerg_wunschItem GroupNone=>Documentation
    Sat 25 Nov 2006 02:45:32 PM UTCNoneCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1