使用nasm编译代码时报错。
出错的代码段:
times 0x1fe-($-$$) db 0
times ($-$$) db 0
times (1+1) db 0
times (1+$-$$) db 0
times ($+$$) db 0 ;报错
times $$ db 0 ;报错
times $ db 0 ;报错
times (1+$-$$+$$) db 0 ;报错
times (1+$) db 0 ;报错
times (0x1fe+0x7c00-$) db 0 ;报错
错误信息:
./boot.asm:34: error: non-constant argument supplied to TIMES
./boot.asm:35: error: non-constant argument supplied to TIMES
./boot.asm:36: error: non-constant argument supplied to TIMES
./boot.asm:37: error: non-constant argument supplied to TIMES
./boot.asm:38: error: non-constant argument supplied to TIMES
./boot.asm:39: error: non-constant argument supplied to TIMES
为什么只有($-$$)这样使用才不会出错啊?