Watcom ASM + C puzzle, variable has conflicting addresses (Developers)
mov bx, offset symbol_name loads the BX register with the address of the symbol, which is an immediate number.
mov bh, byte ptr [symbol_name] uses the symbol as a pointer and copies the contents of that memory address into the BH register.
mov bh, byte ptr symbol_name copies the value from the symbol's own memory address into the BH register.
When you are writing assembly, the symbol also probably resides in the code segment, so what you want to do is loading a 8-bit register with the value of that symbol, what you probably want to do is
mov bh, byte ptr cs:symbol_name
In any case you should always make sure that the segment registers point into correct paragraphs. But sometimes it's just more efficient to do a segment override instead of loading the segment registers with new values.
In large memory model, if the symbol is in the DGROUP segment, you first have to load a segment register (either DS or ES, or GS/FS if you use a 386+) with the paragraph address where DGROUP starts before you can access the symbol. Be sure to also save and restore the value of the segment register before modifying it.
Accessing data where DS points to does not need a segment override, but other segment registers need it. In other words, DS is the default segment.
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