unittests: modrm_oob include helper

This commit is contained in:
Ryan Houdek committed 2025-09-11 16:53:42 -07:00
1 parent 7bd0789402
commit d28ef1859d
1 file changed
+51
@@ -0,0 +1,51 @@
%macro w2 2
; Ensures that the load doesn't read past the end.
%1 [r15 - %2]
; Ensures the load doesn't read before the start.
%1 [r14]
%endmacro
%macro w3 3
; Ensures that the load doesn't read past the end.
%1 [r15 - %2], %3
; Ensures the load doesn't read before the start.
%1 [r14], %3
%endmacro
%macro r3 3
; Ensures that the load doesn't read past the end.
%1 %3, [r15 - %2]
; Ensures the load doesn't read before the start.
%1 %3, [r14]
%endmacro
%macro rw3 3
r3 %1, %2, %3
w3 %1, %2, %3
%endmacro
%macro w4 4
; Ensures that the load doesn't read past the end.
%1 [r15 - %2], %3, %4
; Ensures the load doesn't read before the start.
%1 [r14], %3, %4
%endmacro
%macro r4 4
; Ensures that the load doesn't read past the end.
%1 %3, [r15 - %2], %4
; Ensures the load doesn't read before the start.
%1 %3, [r14], %4
%endmacro
%macro rw4 4
r4 %1, %2, %3, %4
w4 %1, %2, %3, %3
%endmacro