Index: ChangeLog =================================================================== RCS file: /cvsroot/avr-libc/avr-libc/ChangeLog,v retrieving revision 1.331 diff -u -u -r1.331 ChangeLog --- ChangeLog 15 Feb 2004 20:04:32 -0000 1.331 +++ ChangeLog 18 Feb 2004 22:53:00 -0000 @@ -1,3 +1,8 @@ +2004-02-18 Joerg Wunsch
+ + * doc/api/inline_asm.dox: Fix use of _SFR_IO_ADDR() in inline asm. + * doc/api/faq.dox: Ditto. + 2004-02-15 Joerg Wunsch * libc/stdlib/malloc.c: Fix bug #2143 (malloc wrap around top of RAM) @@ -15,7 +20,7 @@ * include/avr/delay.h: Ditto. * include/avr/interrupt.h: Ditto: * include/avr/timer.h: Ditto. - + 2004-02-13 Joerg Wunsch * libc/stdio/vfscanf.c: Apply patch #2554: fix %ul format. Index: doc/api/faq.dox =================================================================== RCS file: /cvsroot/avr-libc/avr-libc/doc/api/faq.dox,v retrieving revision 1.29 diff -u -u -r1.29 faq.dox --- doc/api/faq.dox 18 Oct 2003 20:18:57 -0000 1.29 +++ doc/api/faq.dox 18 Feb 2004 22:53:03 -0000 @@ -354,7 +354,7 @@ assembler. One way to avoid this problem is: \code -asm volatile("sbi %0, 0x07" : "I" (PORTB):); +asm volatile("sbi %0, 0x07" : "I" (_SFR_IO_ADDR(PORTB)):); \endcode \note \c avr/io.h already provides a sbi() macro definition, which can be used Index: doc/api/inline_asm.dox =================================================================== RCS file: /cvsroot/avr-libc/avr-libc/doc/api/inline_asm.dox,v retrieving revision 1.14 diff -u -u -r1.14 inline_asm.dox --- doc/api/inline_asm.dox 8 Sep 2003 22:33:36 -0000 1.14 +++ doc/api/inline_asm.dox 18 Feb 2004 22:53:04 -0000 @@ -95,17 +95,17 @@ Let's start with a simple example of reading a value from port D: \code -asm("in %0, %1" : "=r" (value) : "I" (PORTD) : ); +asm("in %0, %1" : "=r" (value) : "I" (_SFR_IO_ADDR(PORTD)) ); \endcode -Each \c asm statement is devided by colons into four parts: +Each \c asm statement is devided by colons into (up to) four parts: -# The assembler instructions, defined as a single string constant: \code "in %0, %1" \endcode -# A list of output operands, separated by commas. Our example uses just one: \code "=r" (value) \endcode -# A comma separated list of input operands. Again our example uses one - operand only: \code "I" (PORTD) \endcode + operand only: \code "I" (_SFR_IO_ADDR(PORTD)) \endcode -# Clobbered registers, left empty in our example. You can write assembler instructions in much the same way as you would write @@ -116,7 +116,7 @@ The general form is \code -asm(code : output operand list : input operand list : clobber list); +asm(code : output operand list : input operand list [: clobber list]); \endcode In the code section, operands are referenced by a percent sign followed by a @@ -124,7 +124,7 @@ forth. From the above example: \c %0 refers to "=r" (value) and