Why do different debuggers show different disassembly for the same executable? I am not talking only about syntax. For example, I've compiled a "Hello world" program on my MacAir with Clang. Then, lldb in Terminal showed me that the first few assembler directives are for setting up a stack, but FreeDOS debug in DosBox showed me that the first directive was "IRET", and that is for exiting the interrupt. Of course, when I then tried to run a program in lldb it printed "Hello world!", and when I tried to run that same program in FreeDOS debugger, the DosBox crashed. To me, that is weird because I know that both llvm assembler and FreeDOS assembler can make programs for the same processor architecture: x86. And even if the interrupt table is different in DOS and Darwin OS, the disassembly should be equal, right? So, how is this result possible? And, if possible, how to make FreeDos debugger show the correct output in this case? I mean, when I make simple programs in Flat Assembler (the biggest being around 750 lines), it does show the correct output for them with default settings.
Last edited by Teo123; 03-27-2016 at 03:28 PM.
Reason: More explanation of the problem.