Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Debugging and mapping functions (MS Linker) (Developers)

posted by tom Homepage, Germany (West), 22.03.2025, 21:58

> 1286:0BA2 _flip5
> 1286:0B7E _flip_range
> 31A6:3584 _flist_sel
> 1286:0E2C _fli_abs_tseek
> 21E5:0130 _fli_comp1
> 301E:0068 _fli_comp_frame


> Unfortunately the program is in large memory model with code in multiple
> segments.
By default, for C programs in the large memory model, every source file
gets its own code and data segment.

so all functions in one source module should get the same code segment,
like flip5, flip_range, fli_abd_tseek.

you can change this behavior and squeeze functions into
segments of your choice using

#pragma codeseg("FLIP_CODE")

or similar, depending on your compiler.

later, when linking multiple modules, the linker sorts all code segments first, then all data segments, and some more segment groups like "CONST", "STACK" and more.

> It seems as if all symbols that have the same segment in the EXE file end
> up with the same segment in RAM, but not sure if that is by design or just
> how it happened to be?
that's how it is.

at the beginning of your .exe file, there is a "relocation" table, meaning
"when loading the program into RAM at a certain address, please add this
address to these locations".
this offset is obviously the same for the entire program.

> I used that to find one function after locating
> another function that had the same segment in the MAP file. But that was a
> bit time-consuming.
yes. debuggers that understand the symbolic info of the compilers are cool.
luckily modern compilers usually come with an associated debugger.

CODEVIEW for MSC
WDB/WDEB386 for WCC
...

 

Complete thread:

Back to the forum
Board view  Mix view
22477 Postings in 2087 Threads, 400 registered users, 120 users online (1 registered, 119 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum