Browse Source

add tests for idiv overflow

Fabian 1 year ago
parent
commit
574673e476
3 changed files with 29 additions and 0 deletions
  1. 10 0
      tests/nasm/idiv16-overflow.asm
  2. 10 0
      tests/nasm/idiv32-overflow.asm
  3. 9 0
      tests/nasm/idiv8-overflow.asm

+ 10 - 0
tests/nasm/idiv16-overflow.asm

@@ -0,0 +1,10 @@
+global _start
+
+%include "header.inc"
+
+    mov ax, 0000h
+    mov dx, 8000h
+    mov bx, -1
+    idiv bx
+
+%include "footer.inc"

+ 10 - 0
tests/nasm/idiv32-overflow.asm

@@ -0,0 +1,10 @@
+global _start
+
+%include "header.inc"
+
+    mov eax, 00000000h
+    mov edx, 80000000h
+    mov ebx, -1
+    idiv ebx
+
+%include "footer.inc"

+ 9 - 0
tests/nasm/idiv8-overflow.asm

@@ -0,0 +1,9 @@
+global _start
+
+%include "header.inc"
+
+    mov ax, 8000h
+    mov bl, -1
+    idiv bl
+
+%include "footer.inc"