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

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #18373: Bugs in Inline ASM documentacion

Submitter:  None
Submitted:  Sat 25 Nov 2006 02:45:32 PM UTC
   
 
Category:  Documentation Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Documentation
Status:  Fixed Assigned to:  joerg_wunsch
Percent Complete:  0% Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  None
Fixed Release:  None

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.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-10-30 joerg_wunsch Assigned toNone joerg_wunsch
        Open/ClosedOpen Closed
    2007-10-30 joerg_wunsch StatusNone Fixed
    2007-05-06 arcanum Priority9 - Immediate 5 - Normal
    2007-03-25 arcanum Priority5 - Normal 9 - Immediate
    2007-01-08 joerg_wunsch Item GroupNone Documentation
    2006-11-25 None Carbon-Copy- Added -unavailable-

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code