A hexdump is just a way to encode binary data using only the characters 0-9
and a-f
. This makes it easier for humans to read and type, without memorizing the numerical value of 256 glyphs.
The asm tag wiki has some info on what assembly is all about. Machine code is a binary format for representing machine instructions, designed to be parsed by hardware (the CPU). An assembler is a program that assembles bytes into a binary file, following the instructions in an asm source file. Typically assemblers default to outputting a structured file format like ELF or Windows PE, but you can use a flat binary output format if you want to define everything yourself. You can use pseudo-instructions like db
(NASM syntax) or .byte
GNU syntax to assemble whatever bytes you want in whatever order you want into an output file.
Some other completely different binary formats include PDF and ZIP. They're designed to be parsed by software.
This question is like asking what the relationship is between a text file and asm. (Or C, or anything.) Although not quite. Or maybe: the relationship between an editor window and a C program.
My point is that a hexdump doesn't have any specific meaning, and can be done on any stream of bytes, whatever those bytes mean.