I have disassembled an old DOS application with IDA. It run in 16-bit real mode. Some instructions are referencing variables defined in the data segment (DS).
push word ptr ds:8401h
Since I have imported debug symbols, I can display variable name by simply putting mouse over the ds:xxxxh
part.
The problem is this only works when IDA is running in debug mode (eg: a DOSBox process is attached to it). Otherwise nothing is shown.
One possible explanation is that the data segment register (DS) is only set when application is running so IDA as no clue what value it is. In fact, the very first instructions of the program are dedicated to initializing the data segment :
; entry point
mov dx, seg dseg
...
... ; a few instruction later
mov ds, dx
I think this is how IDA is able to guess where the data segment is (which is reported as dseg in the Segments view).
In that application, DS is set once for good and never changed over the time. Is there a way to tell IDA it should assume DS is equal to a given value in the whole disassembly ? (so hovering those variables will give proper name even when no process is attached).