--- In AVR-Chat@yahoogroups.com, John Samperi <samperi@a...> wrote: > > At 12:26 PM 2/11/2005, you wrote: > >I was wondering if I could combine both equates to do something like this > >.equ LCD_Enable = Portc, 0 > > No. You can make a macro that would substitute the instructions I guess I've done this by equating the PORTC and the pin separately, something like .equ LCD_PORT = PORTC .equ LCD_DDR = DDRC .equ LCD_Epin = 3 Now in the init code I can say: sbi LCD_DDR,LCD_Epin ; to make it an output. cbi LCD_PORT,LCD_Epin ; to make it low In the main code, I might sbi LCD_PORT,LCD_Epin cbi LCD_PORT_LCD_Epin Which makes for very portable code.
Message
Re: Assembler directive equ
2005-11-02 by Dave VanHorn
Attachments
- No local attachments were found for this message.