[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] Pointer to byte in code.
From: |
Royce & Sharal Pereira |
Subject: |
[avr-gcc-list] Pointer to byte in code. |
Date: |
Thu, 15 Jul 2004 21:56:28 +0530 |
Hi,
is thare a way to access a byte in ROM besides the macro __LPM(address)?
How does one define a pointer to a byte in ROM?
For eg, should'nt the function:
void get_byte(PGM_P src)
{
while(*src)
PORTB= *src++;
}
generate the lpm instruction automatically?
How to implement the above?
PS: I have been using SDCC for AT89cxx MCUs, where merely declaring the pointer
as "code *char src"
generates the 'movc' opcode automatically. I'm looking to migrate the SDCC code
to AVR-GCC.
Thanks,
--Royce
- [avr-gcc-list] Pointer to byte in code.,
Royce & Sharal Pereira <=