'about MASM seg operator

I found this in the book "Art of x86 assembly" page 393:

"The seg operator does two things. First, it extracts the segment portion of the specified address, second, it converts the type of the specified expression from address to con- stant."

It says that the seg operator does convert the expr (the address) to constant, but when i tried to assemble this :

code segment
        assume cs: code             
message db "Hello World!$"
    db (seg $) dup ('H') 
_start:
code ends
end

I've got this error:

a.asm(4) : error A2026: constant expected .

so seg do not convert the address to constant?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source