But does this work on both GCC and Clang, and is safe from being optimized away? edit: the answer is no
Turbo Pascal had an integrated assembler that could use symbols (and even complex types) defined anywhere in the program, like this:
procedure HelloWorld; assembler;
const Message: String = 'Hello, world!'^M^J; {Msg+CR+LF}
asm
mov ah,$40 {DOS system call number for write}
mov bx,1 {standard output}
xor ch,ch {clear high byte of length}
mov cl,Message.byte[0]
mov dx,offset Message+1
int $21
end;