I suggest you to group similar things together. Hardware, includes, Register aliases, I/o Aliases, Variable definition, Constant definition, then before your main, you set your initial variables values.

and yeah a simple CLEAR may ruine your life