I'll admit I expanded on the possibilities after that, because otherwise it didn't make much sense. Nobody cares if an instruction is run or not. You can still disassemble the instructions. In fact reading non-reachable code might reveal vulnerabilities you could reach if you altered the stack via a buffer overflow... only evaluating actual program flow seems like a way to overlook things.
I apologize if it was me who misunderstood it
If you have no debugging information for the file, you cannot know that some byte sequence is unreachable code.
To identify what such a sequence of bytes is, you can try to decode it in various ways, e.g. by disassembling it, by interpreting it as ASCII or Unicode characters, by interpreting it as a sequence of floating-point or integer numbers, etc. If anyone of these decoding attempts looks plausible, you can guess that it is correct. So if it disassembles into a sequence of plausible instructions, you can conclude that it is unreachable code, but your guess is seldom certain.
In any case, the disassembling may start only by executing the program and following the control flow, and also noting all memory addresses that are accessed by loads and stores.
If after that there remain memory regions that have not been accessed in any way, possibly because you could not simulate all the possible program inputs, e.g. because the program accessed a hardware dongle that you do not possess, then you can start to decode in various ways the regions with unknown content, attempting to guess their purpose.
I am not aware of any other situation where you have a sequence of bytes that are machine instructions and that must be disassembled, except when you have extracted them from a binary executable file after identifying their location, which is indeed a part of reverse engineering.
If you do not extract the bytes to be disassembled from a binary file that you have generated yourself, that is a part of reverse engineering.
If you generated the binary file yourself, you have no need to disassemble it. If you want to look at the assembly language program, you do not need to disassemble anything, because whatever tools you used to generate the binary will provide the assembly language equivalent.
But from where can you get such bytes?
Normally such bytes can be obtained only from a binary executable file, by what you called "reverse engineering", though complete reverse engineering includes a lot of work beyond identifying the machine instructions inside a binary file and disassembling/decompiling them.
I cannot imagine what source of bytes that are machine instructions do you have in mind, otherwise than those that must be obtained through reverse engineering.
If you generated yourself the binary file, there is no need to disassemble it, because any high-level language compiler provides upon request the corresponding assembly language program.
No, with reverse engineering I meant arriving at some readable code in a programming language.
But I had both misread what you wrote and was mistaken, even simply translating bytes in an executable to assembly is not trivial; I last dealt with it long enough that I didn't remember the issues.
You're talking about reverse engineering in your comment