avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] ASM SRAM test results


From: Grant Stockly
Subject: [avr-gcc-list] ASM SRAM test results
Date: Fri, 06 Sep 2002 13:35:27 -0800

volatile unsigned char sram_byte;
volatile unsigned char sram_byte2;
...
...
int main(void)
...
...

        sram_byte = 'A';
        sram_byte2 = 'B';
        lcd_row(2);
         lcd_print(sram_byte);
         asm volatile("lds r0, sram_byte" :: );
         asm volatile("inc r0" :: );
         asm volatile("sts sram_byte, r0" ::);
         lcd_print(sram_byte);
        
        lcd_row(3);
         lcd_print(sram_byte2);         
         asm volatile("lds r0, sram_byte2" :: );
         asm volatile("inc r0" :: );
         asm volatile("sts sram_byte2, r0" ::);
         lcd_print(sram_byte2);


The above code should print "AB" on line 2 and "BC" on line 3. The test program works perfectly. Good news for me!!! Now I know not to take the foo.lst files as a final result. : )

Thanks to all here who helped!
Grant Stockly

avr-gcc-list at http://avr1.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]