When viewing the disassembly of one of Silicon Labs 8-bit MCUs, I often run into sections that are filled with the assembly instruction:
MOV R7, A
What is this code doing? Why is my device filled with these instructions?
Answer
This code is actually the by-product of the disassembly view attempting to decode flash that has been erased. When flash is erased, all bits return to '1'. This results in the memory being fill with, effectively, bytes of 0xFF. The 8051 instruction that corresponds to 0xFF is 'MOV R7, A'. You can see this erased flash in the memory viewer:
Disassembly filled with "MOV R7, A"