summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2002-04-30 20:59:21 +0000
committerH. Peter Anvin <hpa@zytor.com>2002-04-30 20:59:21 +0000
commitaf535c16cf3f9f628384ec834e3aa325709cb37b (patch)
treec582b65fc34ae4e66aa559ebe901c76aefa05bd5 /test
parent41bf8002b2fa402bd344a290fcc9f65de328859c (diff)
downloadnasm-af535c16cf3f9f628384ec834e3aa325709cb37b.tar.gz
NASM 0.98.03nasm-0.98.03
Diffstat (limited to 'test')
-rw-r--r--test/test1.asm62
-rw-r--r--test/test2.asm18
-rw-r--r--test/test2a.asm22
-rw-r--r--test/test3.asm45
-rw-r--r--test/test4.asm16
-rw-r--r--test/test4a.asm16
-rw-r--r--test/test4b.asm17
-rw-r--r--test/test4c.asm17
-rw-r--r--test/test5.asm43
-rw-r--r--test/test6.asm9
10 files changed, 265 insertions, 0 deletions
diff --git a/test/test1.asm b/test/test1.asm
new file mode 100644
index 00000000..ce24ca15
--- /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 00000000..5bbb034c
--- /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 00000000..2ed09a76
--- /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 00000000..457ed44d
--- /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 00000000..357553e2
--- /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 00000000..bbf85a31
--- /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 00000000..63448817
--- /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 00000000..5d873490
--- /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 00000000..12b0ee42
--- /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 00000000..cf6dca0d
--- /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