diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test1.asm | 62 | ||||
-rw-r--r-- | test/test2.asm | 18 | ||||
-rw-r--r-- | test/test2a.asm | 22 | ||||
-rw-r--r-- | test/test3.asm | 45 | ||||
-rw-r--r-- | test/test4.asm | 16 | ||||
-rw-r--r-- | test/test4a.asm | 16 | ||||
-rw-r--r-- | test/test4b.asm | 17 | ||||
-rw-r--r-- | test/test4c.asm | 17 | ||||
-rw-r--r-- | test/test5.asm | 43 | ||||
-rw-r--r-- | test/test6.asm | 9 |
10 files changed, 265 insertions, 0 deletions
diff --git a/test/test1.asm b/test/test1.asm new file mode 100644 index 0000000..ce24ca1 --- /dev/null +++ b/test/test1.asm @@ -0,0 +1,62 @@ + segment text + bits 16 + + imul edx,[addr],10 + imul eax,20 + imul edx,eax,130 + + push 0x40 + push word 0x40 + push word 4095 + push byte 0x40 + push dword 0x40 + push dword 4095 + + add ax,1 + add bx,1 + cmp cx,0 + sub dx,3 + sbb si,-1 + xor ax,0xffff + xor ax,-1 + xor bx,0xffff + xor bx,-1 + + + adc bx,add1 + adc bx,-7 + adc bx,-128 + adc bx,-129 + adc bx,addr + adc bx,byte -7 +add1: adc bx,word -7 + adc bx,add1 + resb 256 +addr: nop + adc bx,addr + adc eax,5 + adc eax,500 + adc eax,byte 5 + adc ax,4 + adc ebx,7 + adc ebx,700 + adc ebx,byte 7 + adc ecx,1 + adc eax,1 + + shr edx,mmm + shr edx,one + adc ebx,byte mmm +m1: adc ebx,mmm +mmm equ 9 +m2: adc ebx,mmm +one equ 1 + shr edx,mmm + shr edx,one + shr edx,1 +tend dw tend + + segment data + db 'abc' + db '', 12, 13, 0 + diff --git a/test/test2.asm b/test/test2.asm new file mode 100644 index 0000000..5bbb034 --- /dev/null +++ b/test/test2.asm @@ -0,0 +1,18 @@ + USE16 + CPU 386 + +debugdump001: +goo: jmp foo + jc near foo + mov ax,[si+5] + mov ax,[si-7] + mov ax,[si+n] + nop + resb 10 +foo: jmp goo + jc goo + jmp short goo +debugdump002: push 0 +n equ 3 + + diff --git a/test/test2a.asm b/test/test2a.asm new file mode 100644 index 0000000..2ed09a7 --- /dev/null +++ b/test/test2a.asm @@ -0,0 +1,22 @@ + use32 + cpu P3 + +debugdump001: +goo: jmp foo +; cpu 386 + jc near foo + mov ax,[si+5] + mov ax,[si-7] + mov ax,[si+n] + align 16 +; cpu 486 + bswap edx +; cpu 186 + resb 10 +foo: jmp goo + jc goo + jmp short goo +debugdump002: push 0 +n equ 3 + + diff --git a/test/test3.asm b/test/test3.asm new file mode 100644 index 0000000..457ed44 --- /dev/null +++ b/test/test3.asm @@ -0,0 +1,45 @@ +debugdump001: + jc baker + jmp able - 20 + jmp able +baker: nop + times 125 nop +able: jmp baker + jmp baker + 20 + times 122 nop + jmp able +loc: nop + jc able+20 + + jmp able1 - 20 + jmp able1 +baker1: nop + times 126 nop +able1: jmp near baker1 + jmp baker1 + 20 + times 122 nop + jmp able1 +loc1: nop + +able2: jmp baker2 + times 124 nop + jmp able2 + nop +baker2: nop + + + +able3: jmp baker3 + times 124 nop + jmp able3 + nop + nop +baker3: nop +debugdump099: nop + + + + + + + diff --git a/test/test4.asm b/test/test4.asm new file mode 100644 index 0000000..357553e --- /dev/null +++ b/test/test4.asm @@ -0,0 +1,16 @@ + cpu 186 + +start: jmp able + xor ax,ax + jc start + jnc able + jc charlie + times 100 nop +able: jc start + times 100 nop +baker: jc start + times 100 nop +charlie: jc baker + jnc able + jmp start +end: db 0 diff --git a/test/test4a.asm b/test/test4a.asm new file mode 100644 index 0000000..bbf85a3 --- /dev/null +++ b/test/test4a.asm @@ -0,0 +1,16 @@ + cpu 386 + +start: jmp able + xor ax,ax + jc start + jnc able + jc charlie + times 100 nop +able: jc start + times 100 nop +baker: jc start + times 100 nop +charlie: jc baker + jnc able + jmp start +end: db 0 diff --git a/test/test4b.asm b/test/test4b.asm new file mode 100644 index 0000000..6344881 --- /dev/null +++ b/test/test4b.asm @@ -0,0 +1,17 @@ + use32 + cpu 186 + +start: jmp able + xor ax,ax + jc start + jnc able + jc charlie + times 100 nop +able: jc start + times 100 nop +baker: jc start + times 100 nop +charlie: jc baker + jnc able + jmp start +end: db 0 diff --git a/test/test4c.asm b/test/test4c.asm new file mode 100644 index 0000000..5d87349 --- /dev/null +++ b/test/test4c.asm @@ -0,0 +1,17 @@ + use32 + cpu 386 + +start: jmp able + xor ax,ax + jc start + jnc able + jc charlie + times 100 nop +able: jc start + times 100 nop +baker: jc start + times 100 nop +charlie: jc baker + jnc able + jmp start +end: db 0 diff --git a/test/test5.asm b/test/test5.asm new file mode 100644 index 0000000..12b0ee4 --- /dev/null +++ b/test/test5.asm @@ -0,0 +1,43 @@ +%macro pushm 1-* +%rep %0 +%rotate -1 +push %1 +%endrep +%endmacro + +%macro popm 1-* +%rep %0 +pop %1 +%rotate 1 +%endrep +%endmacro + +%macro pusha 0 +push ax +push cx +push dx +push bx +push bp +mov bp,sp +lea bp,[bp+10] +xchg bp,[bp-10] +push bp +push si +push di +%endmacro + +%macro popa 0 +pop di +pop si +pop bp +pop bx +pop bx +pop dx +pop cx +pop ax +%endmacro + + pushm ax,bx,cx,dx + popm ax,bx,cx,dx + pusha + popa diff --git a/test/test6.asm b/test/test6.asm new file mode 100644 index 0000000..cf6dca0 --- /dev/null +++ b/test/test6.asm @@ -0,0 +1,9 @@ +; test6.asm +; assemble with; nasm -O2 ... +; +%rep 20000 + jmp forward +%endrep +forward: dd forward + +
\ No newline at end of file |