AVR 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 |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
Carbon-Copy List
Follow 7 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2007-10-30 | joerg_wunsch | Assigned to | None | joerg_wunsch | |
Open/Closed | Open | Closed | |||
2007-10-30 | joerg_wunsch | Status | None | Fixed | |
2007-05-06 | arcanum | Priority | 9 - Immediate | 5 - Normal | |
2007-03-25 | arcanum | Priority | 5 - Normal | 9 - Immediate | |
2007-01-08 | joerg_wunsch | Item Group | None | Documentation | |
2006-11-25 | None | Carbon-Copy | - | Added -unavailable- |
Powered by Savane 3.13-4448.
Corresponding source code
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.