diff --git a/unittests/ASM/Includes/modrm_oob_macros.mac b/unittests/ASM/Includes/modrm_oob_macros.mac new file mode 100644 index 000000000..fe1e0f5de --- /dev/null +++ b/unittests/ASM/Includes/modrm_oob_macros.mac @@ -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 + +