Watcom ASM + C puzzle, variable has conflicting addresses (Developers)
I am working on porting Paul Vojta's calvin editor from Turbo-C and A86 to Watcom. I am currently troubleshooting a puzzle related to the asm sources. The file vv.asm has a symbol named "activpg" for one byte that is initialized to 0
public activpg
...
activpg db 0 ;active display page
crspos dw 450h, 0 ;offset, segment of cursor location
scaninf db 7, 0 ;bottom scan line and (3=mono, 0=cga)
vidseg dw 0b800h ;segment of video card
old24 dw 0, 0 ;old INT 24 address
...
mov bx, offset activpg
mov bh, byte ptr [activpg]
I linked a large memory model executable v.exe
In the v.map memory map, the Segments section includes:
Segment Class Group Address Size
======= ===== ===== ======= ====
...
_NULL CODE DGROUP 10fc:0000 00000020
And the Memory Map section includes:
Address Symbol
======= ======
Module: VV.OBJ(C:\CALSRC24\vv.asm)
10fc:0c4c activpg
I opened v.exe in the Watcom Debugger.
I stepped through the program into ex_version(), into the first botputs(), and into writes(). After stepping through the instruction "mov bx, offset activpg", the CPU registers window shows BX is 0C4C and DS is 3461. Inspecting the memory at 3461:0C4C shows the expected byte 00.
Memory (0x3461:0x0000)
0x0C40: 9A 65 23 09 00 00 00 00 00 00 00 00 00 50 04 00
0x0C50: 00 07 00 00 B8 00 00 00 00 00 03 06 00 06 0B 00
After stepping through the instruction "mov bh, byte ptr [activpg]", the CPU registers window shows BX is 644C. I expected BX to be 004C.
Looking at Code->Assembly i see:
mov bx, offset activpg
mov bx, 0C4C
mov bh, byte ptr [activpg]
mov bh, byte ptr 027C
Inspecting the memory at 3461:027C shows the unexpected byte 64.
Why would Watcom think "activpg" is at two different addresses? (3461:0C4C versus 3461:027C)
Complete thread:
- Watcom ASM + C puzzle, variable has conflicting addresses - bencollver, 31.12.2025, 23:25 (Developers)
![Open in board view [Board]](img/board_d.gif)
![Open in mix view [Mix]](img/mix_d.gif)
- Watcom ASM + C puzzle, variable has conflicting addresses - jadoxa, 01.01.2026, 02:06
- Watcom ASM + C puzzle, variable has conflicting addresses - Rugxulo, 01.01.2026, 03:44
- Watcom ASM + C puzzle, variable has conflicting addresses - Japheth, 01.01.2026, 09:01
- Watcom ASM + C puzzle, variable has conflicting addresses - bencollver, 01.01.2026, 16:35
- Watcom ASM + C puzzle, variable has conflicting addresses - Japheth, 01.01.2026, 18:57
- Watcom ASM + C puzzle, variable has conflicting addresses - bencollver, 01.01.2026, 21:07
- Watcom ASM + C puzzle, variable has conflicting addresses - Japheth, 01.01.2026, 18:57
- Watcom ASM + C puzzle, variable has conflicting addresses - bencollver, 01.01.2026, 16:35
- Watcom ASM + C puzzle, variable has conflicting addresses - boeckmann, 01.01.2026, 21:09
- Watcom ASM + C puzzle, variable has conflicting addresses - bencollver, 01.01.2026, 21:32
- Watcom ASM + C puzzle, variable has conflicting addresses - Japheth, 01.01.2026, 21:51
- Watcom ASM + C puzzle, variable has conflicting addresses - boeckmann, 01.01.2026, 21:56
- Watcom ASM + C puzzle, variable has conflicting addresses - boeckmann, 01.01.2026, 21:58
- Watcom ASM + C puzzle, variable has conflicting addresses - bencollver, 01.01.2026, 22:54
- Watcom ASM + C puzzle, variable has conflicting addresses - boeckmann, 01.01.2026, 23:26
- Watcom ASM + C puzzle, variable has conflicting addresses - bencollver, 02.01.2026, 17:42
- Watcom ASM + C puzzle, variable has conflicting addresses - bencollver, 03.01.2026, 18:09
- Watcom ASM + C puzzle, variable has conflicting addresses - ecm, 03.01.2026, 21:23
- Watcom ASM + C puzzle, variable has conflicting addresses - bencollver, 16.01.2026, 04:44
- Watcom ASM + C puzzle, variable has conflicting addresses - bencollver, 03.01.2026, 18:09
- Watcom ASM + C puzzle, variable has conflicting addresses - Japheth, 04.01.2026, 05:21
- Watcom ASM + C puzzle, variable has conflicting addresses - rr, 04.01.2026, 11:40
- Watcom ASM + C puzzle, variable has conflicting addresses - bencollver, 04.01.2026, 15:31
- Watcom ASM + C puzzle, variable has conflicting addresses - Japheth, 04.01.2026, 16:21
- Watcom ASM + C puzzle, variable has conflicting addresses - bencollver, 04.01.2026, 15:31
- Watcom ASM + C puzzle, variable has conflicting addresses - rr, 04.01.2026, 11:40
- Watcom ASM + C puzzle, variable has conflicting addresses - bencollver, 02.01.2026, 17:42
- Watcom ASM + C puzzle, variable has conflicting addresses - boeckmann, 01.01.2026, 23:26
- Watcom ASM + C puzzle, variable has conflicting addresses - bencollver, 01.01.2026, 22:54
- Watcom ASM + C puzzle, variable has conflicting addresses - boeckmann, 01.01.2026, 21:58
- Watcom ASM + C puzzle, variable has conflicting addresses - bencollver, 01.01.2026, 21:32
- Watcom ASM + C puzzle, variable has conflicting addresses - samwdpckr, 02.01.2026, 08:50
- Watcom ASM + C puzzle, variable has conflicting addresses - bretjohn, 08.01.2026, 21:53
- Watcom ASM + C puzzle, variable has conflicting addresses - jadoxa, 01.01.2026, 02:06
Mix view