To answer my own question here, I wrote a small sample program, example.asm
:
var_1 equ H'0001'
constant var_2=H'0002'
#define var_3 H'0003'
cblock H'0004'
var_4
endc
END
and compiled it with gpasm using the instructions here, Makefile
all: example.asm
gpasm -p p10f200 example.asm
clean:
rm -f *.hex *.lst *.cod *.asm~
Now inspecting the example.hex
file with hexdump -C example.hex
, I get:
00000000 3a 30 32 30 30 30 30 30 34 30 30 30 30 46 41 0a |:020000040000FA.| 00000010 3a 30 30 30 30 30 30 30 31 46 46 0a |:00000001FF.| 0000001c
which I have no clue how to interpret, and the objdump -d example.hex
, throws this error:
example.hex: file format ihex objdump: can't disassemble for architecture UNKNOWN!
eventually I want to know what are the differences between the above four different methods of defining a constant and compare their performance and memory efficiency.
.hex
already a text file? Looks like you're hex-dumping an ASCII hex dump, not a.bin
diff -u foo1.hex foo2.hex
. And/or just look at them with a text editor you know how to use, or a GUI diff tool likemeld
. Of course, you don't use any of the constants, so like we explained in comments on your SO question, no part of the assemblers output corresponds to them at all; your output is the same as for an empty file. And if you did use them, they'd all be equivalent (or would be if you'd used the same numbers)