Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Watcom ASM + C puzzle, variable has conflicting addresses (Developers)

posted by bencollver Homepage, 01.01.2026, 21:07

> I'm not sure if WD supports write watchpoints - that would surely help
> here. But first I'd verify that on program entry the interesting code part
> is still correct, that is, the line "mov bh, [activpg]" is encoded 8A 3E 4C
> 0C.

See below for a screenshot of the Assembly window on program entry, plus the Memory window. The line "mov bh, [activpg]" is encoded as 8A 3E 7C 02.

[image]

I am still a Watcom newbie, so i don't grok this yet. Looking at the memory map:

The _NULL segment address is 10fc:0000 (10fc0), segment size 0x0020, so the end address is 10fc:0020 (10fe0)

The _DATA segment address is 1199:0006 (11996), segment size 0x09b2, so the end address is 1199:09b8 (12348)

The activpg symbol address is 10fc:0c4c (11c0c), which is outside of _NULL and inside of _DATA

Doing some arithmetic:

10fc:0c4c (11c0c) - 1199:0006 (11996) = 0x0276

If i discard the offset part of the _DATA segment address, then it results in the unexpected value:

10fc:0c4c (11c0c) - 1199:0000 (11990) = 0x027C

But these are just numbers to me, i am not grokking it yet.

 

Complete thread:

Back to the forum
Board view  Mix view
23153 Postings in 2179 Threads, 404 registered users (1 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum