X86 断言两个标签在NASM中的间距小于N字节

X86 断言两个标签在NASM中的间距小于N字节,x86,nasm,X86,Nasm,在NASM中,我可以在编译时断言两个标签之间的间隔小于N字节吗 也就是说,类似于: label1: ; some code ; goes here label2: ; here I want to check that the distance between label1 and label2 is less than 50 bytes... 问题应该在编译时捕获,最好是带有可理解的错误消息。假设标签出现在检查之前,这应该可以工作: label1: resb 50 ; For testi

在NASM中,我可以在编译时断言两个标签之间的间隔小于N字节吗

也就是说,类似于:

label1:
; some code
; goes here
label2:

; here I want to check that the distance between label1 and label2 is less than 50 bytes...

问题应该在编译时捕获,最好是带有可理解的错误消息。

假设标签出现在检查之前,这应该可以工作:

label1:
resb 50  ; For testing purposes
label2:

%if (label2 - label1) >= 50
%error "Blah blah blah"
%endif