;Constant = 0x123456
#define CONSTANT_2 0x12
#define CONSTANT_1 0x34
#define CONSTANT_0 0x56
This works, but is a little clunky when I want to change them (I have
a lot).
Is there a way to declare it as one big number similar to the
following?
#define CONSTANT 0x123456
If so, how do I reference the various bytes in my program? I'm using
MPLab v6.20 and writing straight assembly (no C code). An example of
where I would use this would be:
movlw CONSTANT_2
movwf ARG_A_2
movlw CONSTANT_1
movwf ARG_A_1
movlw CONSTANT_0
movwf ARG_A_0
;Do something with ARG_A
I've tried using the upper, high, and low declarations and they
sometimes work, sometimes don't. I haven't figured out a pattern to
it. But I'm also trying to plan for future code that might go to 32
bit constants. What could I do in that case other than what I'm
already doing? Thanks for any help!
-Will