I'm single stepping through a section of code because it did not do what I expected.
I wrote some code to save SREG before disabling interrupts. However, the SREG value did not transfer to my backup register as expected.
So I started single stepping through the Disassembly code at the point where SREG contents should be getting transferred to my backup register.
The particular disassembly line is:
SREG_TEMP_STORE = SREG;
000000D8 IN R6,0x3F In from I/O location
When I single step this line, R6 goes from 0x00 to 0x02, yet SREG shows a value of 0x82 (before and after that line was executed).
Likewise my SREG_TEMP_STORE variable gets the value 0x02, and not the SREG value 0x82 that I was expecting.
But it gets more strange. Although SREG has the value 0x82 next to it, which is 0b10000010, the SREG bits (in the I/O box) are showing 10000001, which is 0x81
SREG bits in the I/O box disagree with the SREG bits in the Processor Status box, which shows 10000010, which correctly matches the shown 0x82
So, assuming 0x82 is the SREG correct value, it appears the simulator is not reading the "I" bit in SREG, when it exectues that disassembly line.
Is there something I just don't get or does this look like a bug in the simulator.