Ok. I actually did the experiment, and it looks like I'm right. (hooray!) I used this code (progmem_array.pde):
#include <avr/pgmspace.h>
void setup(void)
{
Serial.begin(9600);
while (Serial.read() != 32)
delay(1); // Wait for space
}
const int mydata[10][10] PROGMEM = {
'0', '1', '2', '3', '4', '5', '6', '7', '8', 'A',
'1', '1', '2', '3', '4', '5', '6', '7', '8', 'B',
'2', '1', '2', '3', '4', '5', '6', '7', '8', 'C',
'3', '1', '2', '3', '4', '5', '6', '7', '8', 'D',
'4', '1', '2', '3', '4', '5', '6', '7', '8', 'E',
'5', '1', '2', '3', '4', '5', '6', '7', '8', 'F',
'6', '1', '2', '3', '4', '5', '6', '7', '8', 'G',
'7', '1', '2', '3', '4', '5', '6', '7', '8', 'H',
'8', '1', '2', '3', '4', '5', '6', '7', '8', 'I',
'9', '1', '2', '3', '4', '5', '6', '7', '8', 'Z' };
void loop(void) {
int i,j;
int n;
Serial.println("\nData by Rows.");
for (i=0; i < 10; i++) {
Serial.println(" ");
for (j=0; j < 10; j++) {
n = pgm_read_word_near(&mydata[i][j]);
Serial.print(n, BYTE);
}
}
Serial.println(" ");
Serial.println("\nData by Columns.");
for (i=0; i < 10; i++) {
Serial.println(" ");
for (j=0; j < 10; j++) {
n = pgm_read_word_near(&mydata[j][i]);
Serial.print(n, BYTE);
}
}
Serial.println(" "); setup(); Serial.println(" "); //start over
}
And it works exactly how I expected it to, correctly printing the array from flash memory (.text segment, in compiler-ese), and leaving the initialized data segment of the binary mercifully empty (.data segment):
BillW-MacOSX<1094> /Applications/arduino-0010/hardware/tools/avr/bin/avr-size progmem_array.elf
text data bss dec hex filename
2490 36 137 2663 a67 progmem_array.elf