* Moved lcc and q3asm into code/tools

This commit is contained in:
Tim Angus 2005-10-04 15:18:22 +00:00
parent b1cef6352e
commit ad118b9baf
452 changed files with 0 additions and 0 deletions

View file

@ -0,0 +1,92 @@
1 5 8 6 3 7 2 4
1 6 8 3 7 4 2 5
1 7 4 6 8 2 5 3
1 7 5 8 2 4 6 3
2 4 6 8 3 1 7 5
2 5 7 1 3 8 6 4
2 5 7 4 1 8 6 3
2 6 1 7 4 8 3 5
2 6 8 3 1 4 7 5
2 7 3 6 8 5 1 4
2 7 5 8 1 4 6 3
2 8 6 1 3 5 7 4
3 1 7 5 8 2 4 6
3 5 2 8 1 7 4 6
3 5 2 8 6 4 7 1
3 5 7 1 4 2 8 6
3 5 8 4 1 7 2 6
3 6 2 5 8 1 7 4
3 6 2 7 1 4 8 5
3 6 2 7 5 1 8 4
3 6 4 1 8 5 7 2
3 6 4 2 8 5 7 1
3 6 8 1 4 7 5 2
3 6 8 1 5 7 2 4
3 6 8 2 4 1 7 5
3 7 2 8 5 1 4 6
3 7 2 8 6 4 1 5
3 8 4 7 1 6 2 5
4 1 5 8 2 7 3 6
4 1 5 8 6 3 7 2
4 2 5 8 6 1 3 7
4 2 7 3 6 8 1 5
4 2 7 3 6 8 5 1
4 2 7 5 1 8 6 3
4 2 8 5 7 1 3 6
4 2 8 6 1 3 5 7
4 6 1 5 2 8 3 7
4 6 8 2 7 1 3 5
4 6 8 3 1 7 5 2
4 7 1 8 5 2 6 3
4 7 3 8 2 5 1 6
4 7 5 2 6 1 3 8
4 7 5 3 1 6 8 2
4 8 1 3 6 2 7 5
4 8 1 5 7 2 6 3
4 8 5 3 1 7 2 6
5 1 4 6 8 2 7 3
5 1 8 4 2 7 3 6
5 1 8 6 3 7 2 4
5 2 4 6 8 3 1 7
5 2 4 7 3 8 6 1
5 2 6 1 7 4 8 3
5 2 8 1 4 7 3 6
5 3 1 6 8 2 4 7
5 3 1 7 2 8 6 4
5 3 8 4 7 1 6 2
5 7 1 3 8 6 4 2
5 7 1 4 2 8 6 3
5 7 2 4 8 1 3 6
5 7 2 6 3 1 4 8
5 7 2 6 3 1 8 4
5 7 4 1 3 8 6 2
5 8 4 1 3 6 2 7
5 8 4 1 7 2 6 3
6 1 5 2 8 3 7 4
6 2 7 1 3 5 8 4
6 2 7 1 4 8 5 3
6 3 1 7 5 8 2 4
6 3 1 8 4 2 7 5
6 3 1 8 5 2 4 7
6 3 5 7 1 4 2 8
6 3 5 8 1 4 2 7
6 3 7 2 4 8 1 5
6 3 7 2 8 5 1 4
6 3 7 4 1 8 2 5
6 4 1 5 8 2 7 3
6 4 2 8 5 7 1 3
6 4 7 1 3 5 2 8
6 4 7 1 8 2 5 3
6 8 2 4 1 7 5 3
7 1 3 8 6 4 2 5
7 2 4 1 8 5 3 6
7 2 6 3 1 4 8 5
7 3 1 6 8 5 2 4
7 3 8 2 5 1 6 4
7 4 2 5 8 1 3 6
7 4 2 8 6 1 3 5
7 5 3 1 6 8 2 4
8 2 4 1 7 5 3 6
8 2 5 3 1 7 4 6
8 3 1 6 2 5 7 4
8 4 1 3 6 2 7 5

View file

@ -0,0 +1,2 @@
tst/8q.c:30: warning: missing return value
tst/8q.c:39: warning: missing return value

View file

@ -0,0 +1,180 @@
.globl main
.text
.align 16
.type main,@function
main:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $4,%esp
movl $0,-4(%ebp)
.LC2:
movl -4(%ebp),%edi
leal (,%edi,4),%edi
movl $1,down(%edi)
movl $1,up(%edi)
.LC3:
incl -4(%ebp)
cmpl $15,-4(%ebp)
jl .LC2
movl $0,-4(%ebp)
.LC6:
movl -4(%ebp),%edi
movl $1,rows(,%edi,4)
.LC7:
incl -4(%ebp)
cmpl $8,-4(%ebp)
jl .LC6
pushl $0
call queens
addl $4,%esp
movl $0,%eax
.LC1:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf10:
.size main,.Lf10-main
.globl queens
.align 16
.type queens,@function
queens:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $4,%esp
movl $0,-4(%ebp)
.LC12:
movl -4(%ebp),%edi
cmpl $0,rows(,%edi,4)
je .LC16
movl 20(%ebp),%esi
movl %edi,%ebx
subl %esi,%ebx
cmpl $0,up+28(,%ebx,4)
je .LC16
leal (%esi,%edi),%edi
cmpl $0,down(,%edi,4)
je .LC16
movl -4(%ebp),%edi
movl 20(%ebp),%esi
leal (%esi,%edi),%ebx
movl $0,down(,%ebx,4)
movl %edi,%ebx
subl %esi,%ebx
movl $0,up+28(,%ebx,4)
movl $0,rows(,%edi,4)
movl 20(%ebp),%edi
movl -4(%ebp),%esi
movl %esi,x(,%edi,4)
cmpl $7,20(%ebp)
jne .LC20
call print
jmp .LC21
.LC20:
movl 20(%ebp),%edi
leal 1(%edi),%edi
pushl %edi
call queens
addl $4,%esp
.LC21:
movl -4(%ebp),%edi
movl 20(%ebp),%esi
leal (%esi,%edi),%ebx
movl $1,down(,%ebx,4)
movl %edi,%ebx
subl %esi,%ebx
movl $1,up+28(,%ebx,4)
movl $1,rows(,%edi,4)
.LC16:
.LC13:
incl -4(%ebp)
cmpl $8,-4(%ebp)
jl .LC12
movl $0,%eax
.LC11:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf23:
.size queens,.Lf23-queens
.globl print
.align 16
.type print,@function
print:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $4,%esp
movl $0,-4(%ebp)
.LC25:
movl -4(%ebp),%edi
movl x(,%edi,4),%edi
leal 49(%edi),%edi
pushl %edi
pushl $.LC29
call printf
addl $8,%esp
.LC26:
incl -4(%ebp)
cmpl $8,-4(%ebp)
jl .LC25
pushl $.LC30
call printf
addl $4,%esp
movl $0,%eax
.LC24:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf31:
.size print,.Lf31-print
.bss
.globl x
.align 4
.type x,@object
.size x,32
.comm x,32
.globl rows
.align 4
.type rows,@object
.size rows,32
.comm rows,32
.globl down
.align 4
.type down,@object
.size down,60
.comm down,60
.globl up
.align 4
.type up,@object
.size up,60
.comm up,60
.data
.align 1
.LC30:
.byte 10
.byte 0
.align 1
.LC29:
.byte 37
.byte 99
.byte 32
.byte 0
.text
.ident "LCC: 4.1"

View file

@ -0,0 +1,4 @@
0 1 2 3 1000 1001 1002 1003 2000 2001 2002 2003
0 1 2 3 1000 1001 1002 1003 2000 2001 2002 2003
0 1 2 3 1000 1001 1002 1003 2000 2001 2002 2003
0 1 2 3 1000 1001 1002 1003 2000 2001 2002 2003

View file

@ -0,0 +1,2 @@
tst/array.c:33: warning: missing return value
tst/array.c:48: warning: missing return value

View file

@ -0,0 +1,235 @@
.globl main
.text
.align 16
.type main,@function
main:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $60,%esp
movl $0,-8(%ebp)
.LC2:
movl $0,-4(%ebp)
.LC6:
movl -4(%ebp),%edi
movl -8(%ebp),%esi
movl %esi,%ebx
sall $4,%ebx
leal x(%ebx),%ebx
imul $1000,%esi,%esi
leal (%edi,%esi),%esi
movl %esi,(%ebx,%edi,4)
.LC7:
incl -4(%ebp)
cmpl $4,-4(%ebp)
jl .LC6
movl -8(%ebp),%edi
movl %edi,%esi
sall $4,%esi
leal x(%esi),%esi
movl %esi,y(,%edi,4)
.LC3:
incl -8(%ebp)
cmpl $3,-8(%ebp)
jl .LC2
call f
movl $0,-8(%ebp)
.LC10:
movl -8(%ebp),%edi
movl %edi,%esi
sall $4,%esi
leal -60(%ebp),%ebx
leal (%ebx,%esi),%esi
movl %esi,-12(%ebp)
movl %esi,y(,%edi,4)
movl $0,-4(%ebp)
.LC14:
movl -4(%ebp),%edi
leal (,%edi,4),%edi
movl -12(%ebp),%esi
movl -8(%ebp),%ebx
sall $4,%ebx
leal x(%ebx),%ebx
movl (%ebx,%edi),%ebx
movl %ebx,(%esi,%edi)
.LC15:
incl -4(%ebp)
cmpl $4,-4(%ebp)
jl .LC14
.LC11:
incl -8(%ebp)
cmpl $3,-8(%ebp)
jl .LC10
pushl $y
leal -60(%ebp),%edi
pushl %edi
call g
addl $8,%esp
movl $0,%eax
.LC1:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf18:
.size main,.Lf18-main
.globl f
.align 16
.type f,@function
f:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $8,%esp
movl $0,-8(%ebp)
.LC20:
movl $0,-4(%ebp)
.LC24:
movl -4(%ebp),%edi
movl -8(%ebp),%esi
sall $4,%esi
leal x(%esi),%esi
pushl (%esi,%edi,4)
pushl $.LC28
call printf
addl $8,%esp
.LC25:
incl -4(%ebp)
cmpl $4,-4(%ebp)
jl .LC24
.LC21:
incl -8(%ebp)
cmpl $3,-8(%ebp)
jl .LC20
pushl $.LC29
call printf
addl $4,%esp
movl $0,-8(%ebp)
.LC30:
movl $0,-4(%ebp)
.LC34:
movl -4(%ebp),%edi
movl -8(%ebp),%esi
movl y(,%esi,4),%esi
pushl (%esi,%edi,4)
pushl $.LC28
call printf
addl $8,%esp
.LC35:
incl -4(%ebp)
cmpl $4,-4(%ebp)
jl .LC34
.LC31:
incl -8(%ebp)
cmpl $3,-8(%ebp)
jl .LC30
pushl $.LC29
call printf
addl $4,%esp
movl $0,%eax
.LC19:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf38:
.size f,.Lf38-f
.globl g
.align 16
.type g,@function
g:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $8,%esp
movl $0,-8(%ebp)
.LC40:
movl $0,-4(%ebp)
.LC44:
movl -4(%ebp),%edi
movl -8(%ebp),%esi
sall $4,%esi
movl 20(%ebp),%ebx
leal (%ebx,%esi),%esi
pushl (%esi,%edi,4)
pushl $.LC28
call printf
addl $8,%esp
.LC45:
incl -4(%ebp)
cmpl $4,-4(%ebp)
jl .LC44
.LC41:
incl -8(%ebp)
cmpl $3,-8(%ebp)
jl .LC40
pushl $.LC29
call printf
addl $4,%esp
movl $0,-8(%ebp)
.LC48:
movl $0,-4(%ebp)
.LC52:
movl -4(%ebp),%edi
movl -8(%ebp),%esi
movl 24(%ebp),%ebx
movl (%ebx,%esi,4),%esi
pushl (%esi,%edi,4)
pushl $.LC28
call printf
addl $8,%esp
.LC53:
incl -4(%ebp)
cmpl $4,-4(%ebp)
jl .LC52
.LC49:
incl -8(%ebp)
cmpl $3,-8(%ebp)
jl .LC48
pushl $.LC29
call printf
addl $4,%esp
movl $0,%eax
.LC39:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf56:
.size g,.Lf56-g
.bss
.globl y
.align 4
.type y,@object
.size y,12
.comm y,12
.globl x
.align 4
.type x,@object
.size x,48
.comm x,48
.data
.align 1
.LC29:
.byte 10
.byte 0
.align 1
.LC28:
.byte 32
.byte 37
.byte 100
.byte 0
.text
.ident "LCC: 4.1"

View file

@ -0,0 +1,51 @@
char freq
011 8.1
012 6.1
040 11.9
! 0.2
" 1.5
% 0.6
& 0.4
' 0.4
( 2.9
) 2.9
* 0.8
+ 1.3
, 1.3
- 0.4
. 0.6
/ 1.0
0 2.5
1 1.9
2 0.6
3 0.2
7 0.4
8 0.2
; 3.8
< 0.8
= 2.7
> 0.2
[ 1.5
\ 0.8
] 1.5
a 3.1
c 4.4
e 2.3
f 6.0
g 1.3
h 1.0
i 5.0
l 1.0
m 0.2
n 3.3
o 2.1
p 1.0
q 0.4
r 4.2
s 0.6
t 3.8
u 1.2
v 0.6
w 0.2
{ 0.6
} 0.6

View file

View file

@ -0,0 +1,161 @@
.globl main
.text
.align 16
.type main,@function
main:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $24,%esp
cmpl $1,20(%ebp)
jg .LC2
flds .LC4
fstps -16(%ebp)
jmp .LC3
.LC2:
movl 24(%ebp),%edi
pushl 4(%edi)
call atof
addl $4,%esp
fstps -20(%ebp)
flds -20(%ebp)
fdivs .LC5
fstps -16(%ebp)
.LC3:
movl $0,-4(%ebp)
.LC6:
movl -4(%ebp),%edi
leal 1(%edi),%esi
movl %esi,-4(%ebp)
flds .LC4
fstps f(,%edi,4)
.LC7:
cmpl $127,-4(%ebp)
jle .LC6
movl $0,-8(%ebp)
jmp .LC11
.LC10:
movl -12(%ebp),%edi
leal f(,%edi,4),%edi
flds (,%edi)
fadds .LC13
fstps (,%edi)
incl -8(%ebp)
.LC11:
call getchar
movl %eax,-12(%ebp)
cmpl $-1,%eax
jne .LC10
pushl $.LC14
call printf
addl $4,%esp
movl $0,-4(%ebp)
.LC15:
movl -4(%ebp),%edi
flds f(,%edi,4)
fstps -24(%ebp)
flds .LC4
fcomps -24(%ebp)
fstsw %ax
sahf
je .LC19
flds -24(%ebp)
fildl -8(%ebp)
fdivp %st(1),%st
flds -16(%ebp)
fcompp
fstsw %ax
sahf
ja .LC19
cmpl $32,-4(%ebp)
jg .LC21
pushl -4(%ebp)
pushl $.LC23
call printf
addl $8,%esp
jmp .LC22
.LC21:
pushl -4(%ebp)
pushl $.LC24
call printf
addl $8,%esp
.LC22:
flds .LC5
movl -4(%ebp),%edi
fmuls f(,%edi,4)
fildl -8(%ebp)
fdivp %st(1),%st
subl $8,%esp
fstpl (%esp)
pushl $.LC25
call printf
addl $12,%esp
.LC19:
.LC16:
incl -4(%ebp)
cmpl $127,-4(%ebp)
jle .LC15
movl $0,%eax
.LC1:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf26:
.size main,.Lf26-main
.bss
.globl f
.align 4
.type f,@object
.size f,512
.comm f,512
.data
.align 1
.LC25:
.byte 9
.byte 37
.byte 46
.byte 49
.byte 102
.byte 10
.byte 0
.align 1
.LC24:
.byte 37
.byte 99
.byte 0
.align 1
.LC23:
.byte 37
.byte 48
.byte 51
.byte 111
.byte 0
.align 1
.LC14:
.byte 99
.byte 104
.byte 97
.byte 114
.byte 9
.byte 102
.byte 114
.byte 101
.byte 113
.byte 10
.byte 0
.align 4
.LC13:
.long 1065353216
.align 4
.LC5:
.long 1120403456
.align 4
.LC4:
.long 0
.text
.ident "LCC: 4.1"

View file

@ -0,0 +1,48 @@
Section s22 returned 0.
Decimal and octal/hex constants sometimes give
different results when assigned to longs.
Decimal and octal/hex constants sometimes give
different results when assigned to longs.
Section s241 returned 0.
Section s243 returned 0.
Section s244 returned 0.
Section s25 returned 0.
8 bits in chars.
32 bits in ints.
16 bits in shorts.
32 bits in longs.
32 bits in unsigneds.
32 bits in floats.
64 bits in doubles.
1.192093e-07 is the least number that can be added to 1. (float).
2.220446e-16 is the least number that can be added to 1. (double).
Section s26 returned 0.
Section s4 returned 0.
Section s61 returned 0.
Section s626 returned 0.
Section s71 returned 0.
Section s72 returned 0.
Section s757 returned 0.
Section s7813 returned 0.
Section s714 returned 0.
Section s715 returned 0.
Register count for char is unreliable.
Register count for pointer is unreliable.
Register count for int is unreliable.
Section s81 returned 0.
Section s84 returned 0.
char alignment: 1
short alignment: 2
int alignment: 4
long alignment: 4
unsigned alignment: 4
float alignment: 4
double alignment: 4
Sign extension in fields
Be especially careful with 1-bit fields!
Section s85 returned 0.
Section s86 returned 0.
Section s88 returned 0.
Section s9 returned 0.
No errors detected.

View file

@ -0,0 +1,25 @@
tst/cq.c:394: warning: overflow in converting constant expression from `unsigned long' to `long int'
tst/cq.c:394: warning: overflow in converting constant expression from `unsigned long' to `long int'
tst/cq.c:394: warning: overflow in converting constant expression from `unsigned long' to `long int'
tst/cq.c:395: warning: overflow in constant `4294967296'
tst/cq.c:395: warning: overflow in converting constant expression from `unsigned long' to `long int'
tst/cq.c:395: warning: overflow in constant `040000000000'
tst/cq.c:395: warning: overflow in converting constant expression from `unsigned long' to `long int'
tst/cq.c:395: warning: overflow in constant `0x100000000'
tst/cq.c:395: warning: overflow in converting constant expression from `unsigned long' to `long int'
tst/cq.c:396: warning: overflow in constant `68719476735'
tst/cq.c:396: warning: overflow in converting constant expression from `unsigned long' to `long int'
tst/cq.c:396: warning: overflow in constant `0777777777777'
tst/cq.c:396: warning: overflow in converting constant expression from `unsigned long' to `long int'
tst/cq.c:396: warning: overflow in constant `0xfffffffff'
tst/cq.c:396: warning: overflow in converting constant expression from `unsigned long' to `long int'
tst/cq.c:397: warning: overflow in constant `68719476736'
tst/cq.c:397: warning: overflow in converting constant expression from `unsigned long' to `long int'
tst/cq.c:397: warning: overflow in constant `01000000000000'
tst/cq.c:397: warning: overflow in converting constant expression from `unsigned long' to `long int'
tst/cq.c:397: warning: overflow in constant `0x1000000000'
tst/cq.c:397: warning: overflow in converting constant expression from `unsigned long' to `long int'
tst/cq.c:533: warning: missing return value
tst/cq.c:1169: warning: missing return value
tst/cq.c:5294: warning: unreachable code
tst/cq.c:5303: warning: missing return value

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,11 @@
1 1 1 1 1 1 1 1 1.000000 1.000000 1.000000
2 2 2 2 2 2 2 2 2.000000 2.000000 2.000000
3 3 3 3 3 3 3 3 3.000000 3.000000 3.000000
4 4 4 4 4 4 4 4 4.000000 4.000000 4.000000
5 5 5 5 5 5 5 5 5.000000 5.000000 5.000000
6 6 6 6 6 6 6 6 6.000000 6.000000 6.000000
7 7 7 7 7 7 7 7 7.000000 7.000000 7.000000
8 8 8 8 8 8 8 8 8.000000 8.000000 8.000000
9 9 9 9 9 9 9 9 9.000000 9.000000 9.000000
10 10 10 10 10 10 10 10 10.000000 10.000000 10.000000
11 11 11 11 11 11 11 11 11.000000 11.000000 11.000000

View file

@ -0,0 +1,2 @@
tst/cvt.c:32: warning: conversion from `pointer to void function(void)' to `pointer to void' is compiler dependent
tst/cvt.c:33: warning: conversion from `pointer to void' to `pointer to void function(void)' is compiler dependent

View file

@ -0,0 +1,792 @@
.globl print
.text
.align 16
.type print,@function
print:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
fldl D
subl $8,%esp
fstpl (%esp)
fldl d
subl $8,%esp
fstpl (%esp)
flds f
subl $8,%esp
fstpl (%esp)
pushl L
pushl I
movw S,%di
movzwl %di,%edi
pushl %edi
movb C,%bl
movzbl %bl,%edi
pushl %edi
pushl l
pushl i
movswl s,%edi
pushl %edi
movsbl c,%edi
pushl %edi
pushl $.LC2
call printf
addl $60,%esp
.LC1:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf3:
.size print,.Lf3-print
.globl main
.align 16
.type main,@function
main:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $296,%esp
movb $1,c
movsbl c,%edi
movl %edi,%esi
movw %si,s
movl %edi,i
movl %edi,l
movl %edi,%esi
movl %esi,%ebx
movb %bl,C
movl %esi,%ebx
movw %bx,S
movl %esi,I
movl %esi,L
pushl %edi
fildl (%esp)
addl $4,%esp
fstps f
pushl %edi
fildl (%esp)
addl $4,%esp
fstpl -8(%ebp)
fldl -8(%ebp)
fstpl d
fldl -8(%ebp)
fstpl D
call print
movw $2,s
movswl s,%edi
movl %edi,%ebx
movb %bl,c
movl %edi,i
movl %edi,l
movl %edi,%esi
movl %esi,%ebx
movb %bl,C
movl %esi,%ebx
movw %bx,S
movl %esi,I
movl %esi,L
pushl %edi
fildl (%esp)
addl $4,%esp
fstps f
pushl %edi
fildl (%esp)
addl $4,%esp
fstpl -16(%ebp)
fldl -16(%ebp)
fstpl d
fldl -16(%ebp)
fstpl D
call print
movl $3,i
movl i,%edi
movl %edi,%ebx
movb %bl,c
movl %edi,%esi
movw %si,s
movl %edi,l
movl %edi,%esi
movl %esi,%ebx
movb %bl,C
movl %esi,%ebx
movw %bx,S
movl %esi,I
movl %esi,L
pushl %edi
fildl (%esp)
addl $4,%esp
fstps f
pushl %edi
fildl (%esp)
addl $4,%esp
fstpl -24(%ebp)
fldl -24(%ebp)
fstpl d
fldl -24(%ebp)
fstpl D
call print
movl $4,l
movl l,%edi
movl %edi,%ebx
movb %bl,c
movl %edi,%esi
movw %si,s
movl %edi,i
movl %edi,%esi
movl %esi,%ebx
movb %bl,C
movl %esi,%ebx
movw %bx,S
movl %esi,I
movl %esi,L
pushl %edi
fildl (%esp)
addl $4,%esp
fstps f
pushl %edi
fildl (%esp)
addl $4,%esp
fstpl -32(%ebp)
fldl -32(%ebp)
fstpl d
fldl -32(%ebp)
fstpl D
call print
movb $5,C
movb C,%bl
movzbl %bl,%edi
movl %edi,%ebx
movb %bl,c
movl %edi,%esi
movw %si,s
movl %edi,i
movl %edi,l
movl %edi,%esi
movl %esi,%ebx
movw %bx,S
movl %esi,I
movl %esi,L
pushl %edi
fildl (%esp)
addl $4,%esp
fstps f
pushl %edi
fildl (%esp)
addl $4,%esp
fstpl -40(%ebp)
fldl -40(%ebp)
fstpl d
fldl -40(%ebp)
fstpl D
call print
movw $6,S
movw S,%di
movzwl %di,%edi
movl %edi,%ebx
movb %bl,c
movl %edi,%esi
movw %si,s
movl %edi,i
movl %edi,l
movl %edi,%esi
movl %esi,%ebx
movb %bl,C
movl %esi,I
movl %esi,L
pushl %edi
fildl (%esp)
addl $4,%esp
fstps f
pushl %edi
fildl (%esp)
addl $4,%esp
fstpl -48(%ebp)
fldl -48(%ebp)
fstpl d
fldl -48(%ebp)
fstpl D
call print
movl $7,I
movl I,%edi
movl %edi,%ebx
movb %bl,c
movl %edi,%ebx
movw %bx,s
movl %edi,i
movl %edi,l
movl %edi,%ebx
movb %bl,C
movl %edi,%esi
movw %si,S
movl %edi,L
fldl .LC5
movl %edi,%esi
shrl $1,%esi
pushl %esi
fildl (%esp)
addl $4,%esp
fmulp %st(1),%st
andl $1,%edi
pushl %edi
fildl (%esp)
addl $4,%esp
faddp %st(1),%st
fstpl -56(%ebp)
fldl -56(%ebp)
fstps f
fldl -56(%ebp)
fstpl d
fldl -56(%ebp)
fstpl D
call print
movl $8,L
movl L,%edi
movl %edi,%ebx
movb %bl,c
movl %edi,%ebx
movw %bx,s
movl %edi,i
movl %edi,l
movl %edi,%ebx
movb %bl,C
movl %edi,%esi
movw %si,S
movw S,%si
movzwl %si,%esi
movl %esi,I
fldl .LC5
movl %edi,%esi
shrl $1,%esi
pushl %esi
fildl (%esp)
addl $4,%esp
fmulp %st(1),%st
andl $1,%edi
pushl %edi
fildl (%esp)
addl $4,%esp
faddp %st(1),%st
fstpl -64(%ebp)
fldl -64(%ebp)
fstps f
fldl -64(%ebp)
fstpl d
fldl -64(%ebp)
fstpl D
call print
flds .LC6
fstps f
flds f
fstps -84(%ebp)
flds -84(%ebp)
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,%ebx
movb %bl,c
movl %edi,%esi
movw %si,s
movl %edi,i
movl %edi,l
flds .LC10
fcomps -84(%ebp)
fstsw %ax
sahf
ja .LC8
flds -84(%ebp)
fsubs .LC10
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
leal 0x80000000(%edi),%edi
movl %edi,-68(%ebp)
jmp .LC9
.LC8:
flds -84(%ebp)
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,-68(%ebp)
.LC9:
movl -68(%ebp),%edi
movl %edi,%ebx
movb %bl,C
flds .LC10
fcomps f
fstsw %ax
sahf
ja .LC12
flds f
fsubs .LC10
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
leal 0x80000000(%edi),%edi
movl %edi,-72(%ebp)
jmp .LC13
.LC12:
flds f
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,-72(%ebp)
.LC13:
movl -72(%ebp),%edi
movw %di,S
flds .LC10
fcomps f
fstsw %ax
sahf
ja .LC15
flds f
fsubs .LC10
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
leal 0x80000000(%edi),%edi
movl %edi,-76(%ebp)
jmp .LC16
.LC15:
flds f
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,-76(%ebp)
.LC16:
movl -76(%ebp),%edi
movl %edi,I
flds .LC10
fcomps f
fstsw %ax
sahf
ja .LC18
flds f
fsubs .LC10
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
leal 0x80000000(%edi),%edi
movl %edi,-80(%ebp)
jmp .LC19
.LC18:
flds f
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,-80(%ebp)
.LC19:
movl -80(%ebp),%edi
movl %edi,L
flds f
fstpl -120(%ebp)
fldl -120(%ebp)
fstpl d
fldl -120(%ebp)
fstpl D
call print
fldl .LC20
fstpl d
fldl d
fstpl -144(%ebp)
fldl -144(%ebp)
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,%ebx
movb %bl,c
movl %edi,%esi
movw %si,s
movl %edi,i
movl %edi,l
fldl .LC24
fcompl -144(%ebp)
fstsw %ax
sahf
ja .LC22
fldl -144(%ebp)
fsubl .LC24
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
leal 0x80000000(%edi),%edi
movl %edi,-124(%ebp)
jmp .LC23
.LC22:
fldl -144(%ebp)
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,-124(%ebp)
.LC23:
movl -124(%ebp),%edi
movl %edi,%ebx
movb %bl,C
fldl .LC24
fcompl d
fstsw %ax
sahf
ja .LC26
fldl d
fsubl .LC24
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
leal 0x80000000(%edi),%edi
movl %edi,-128(%ebp)
jmp .LC27
.LC26:
fldl d
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,-128(%ebp)
.LC27:
movl -128(%ebp),%edi
movw %di,S
fldl .LC24
fcompl d
fstsw %ax
sahf
ja .LC29
fldl d
fsubl .LC24
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
leal 0x80000000(%edi),%edi
movl %edi,-132(%ebp)
jmp .LC30
.LC29:
fldl d
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,-132(%ebp)
.LC30:
movl -132(%ebp),%edi
movl %edi,I
fldl .LC24
fcompl d
fstsw %ax
sahf
ja .LC32
fldl d
fsubl .LC24
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
leal 0x80000000(%edi),%edi
movl %edi,-136(%ebp)
jmp .LC33
.LC32:
fldl d
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,-136(%ebp)
.LC33:
movl -136(%ebp),%edi
movl %edi,L
fldl d
fstps f
fldl d
fstpl D
call print
fldl .LC34
fstpl D
fldl D
fstpl -232(%ebp)
fldl -232(%ebp)
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,%ebx
movb %bl,c
movl %edi,%esi
movw %si,s
movl %edi,i
movl %edi,l
fldl .LC38
fcompl -232(%ebp)
fstsw %ax
sahf
ja .LC36
fldl -232(%ebp)
fsubl .LC38
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
leal 0x80000000(%edi),%edi
movl %edi,-212(%ebp)
jmp .LC37
.LC36:
fldl -232(%ebp)
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,-212(%ebp)
.LC37:
movl -212(%ebp),%edi
movl %edi,%ebx
movb %bl,C
fldl .LC38
fcompl D
fstsw %ax
sahf
ja .LC40
fldl D
fsubl .LC38
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
leal 0x80000000(%edi),%edi
movl %edi,-216(%ebp)
jmp .LC41
.LC40:
fldl D
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,-216(%ebp)
.LC41:
movl -216(%ebp),%edi
movw %di,S
fldl .LC38
fcompl D
fstsw %ax
sahf
ja .LC43
fldl D
fsubl .LC38
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
leal 0x80000000(%edi),%edi
movl %edi,-220(%ebp)
jmp .LC44
.LC43:
fldl D
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,-220(%ebp)
.LC44:
movl -220(%ebp),%edi
movl %edi,I
fldl .LC38
fcompl D
fstsw %ax
sahf
ja .LC46
fldl D
fsubl .LC38
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
leal 0x80000000(%edi),%edi
movl %edi,-224(%ebp)
jmp .LC47
.LC46:
fldl D
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,-224(%ebp)
.LC47:
movl -224(%ebp),%edi
movl %edi,L
fldl D
fstps f
fldl D
fstpl d
call print
movl $0,p
movl $0,p
movl $0,p
movl $0,p
movl P,%edi
movl %edi,p
movl $0,P
movl $0,P
movl $0,P
movl $0,P
movl p,%edi
movl %edi,P
movl $0,%eax
.LC4:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf48:
.size main,.Lf48-main
.bss
.globl P
.align 4
.type P,@object
.size P,4
.comm P,4
.globl p
.align 4
.type p,@object
.size p,4
.comm p,4
.globl D
.align 4
.type D,@object
.size D,8
.comm D,8
.globl d
.align 4
.type d,@object
.size d,8
.comm d,8
.globl f
.align 4
.type f,@object
.size f,4
.comm f,4
.globl L
.align 4
.type L,@object
.size L,4
.comm L,4
.globl I
.align 4
.type I,@object
.size I,4
.comm I,4
.globl S
.align 2
.type S,@object
.size S,2
.comm S,2
.globl C
.align 1
.type C,@object
.size C,1
.comm C,1
.globl l
.align 4
.type l,@object
.size l,4
.comm l,4
.globl i
.align 4
.type i,@object
.size i,4
.comm i,4
.globl s
.align 2
.type s,@object
.size s,2
.comm s,2
.globl c
.align 1
.type c,@object
.size c,1
.comm c,1
.data
.align 4
.LC38:
.long 0
.long 1105199104
.align 4
.LC34:
.long 0
.long 1076232192
.align 4
.LC24:
.long 0
.long 1105199104
.align 4
.LC20:
.long 0
.long 1076101120
.align 4
.LC10:
.long 1325400064
.align 4
.LC6:
.long 1091567616
.align 4
.LC5:
.long 0
.long 1073741824
.align 1
.LC2:
.byte 37
.byte 100
.byte 32
.byte 37
.byte 100
.byte 32
.byte 37
.byte 100
.byte 32
.byte 37
.byte 108
.byte 100
.byte 32
.byte 37
.byte 117
.byte 32
.byte 37
.byte 117
.byte 32
.byte 37
.byte 117
.byte 32
.byte 37
.byte 108
.byte 117
.byte 32
.byte 37
.byte 102
.byte 32
.byte 37
.byte 102
.byte 32
.byte 37
.byte 108
.byte 102
.byte 10
.byte 0
.text
.ident "LCC: 4.1"

View file

@ -0,0 +1,5 @@
x = 1 2 3 4 -3 6
y = 3 8 9
x = 1 2 3 0 0 6
y = 2 8 16
p->a = 0x3, p->b = 0xf

View file

@ -0,0 +1,4 @@
tst/fields.c:6: warning: initializer exceeds bit-field width
tst/fields.c:8: warning: initializer exceeds bit-field width
tst/fields.c:30: warning: missing return value
tst/fields.c:34: warning: missing return value

View file

@ -0,0 +1,321 @@
.data
.globl x
.align 4
.type x,@object
.size x,16
x:
.long 1
.byte 2
.space 3
.byte 3
.byte 64
.space 2
.byte 80
.byte 6
.space 2
.globl i
.align 4
.type i,@object
.size i,4
i:
.long 16
.globl y
.align 4
.type y,@object
.size y,8
y:
.byte 35
.space 3
.byte 9
.byte 0
.byte 0
.byte 0
.globl main
.text
.align 16
.type main,@function
main:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movsbl x+13,%edi
pushl %edi
movl x+12,%edi
sall $25,%edi
sarl $29,%edi
pushl %edi
movl x+8,%edi
sall $16,%edi
sarl $28,%edi
pushl %edi
movl x+8,%edi
sall $20,%edi
sarl $20,%edi
pushl %edi
movsbl x+4,%edi
pushl %edi
pushl x
pushl $.LC4
call printf
addl $28,%esp
pushl y+4
movl y,%edi
movl %edi,%esi
shrl $2,%esi
andl $15,%esi
pushl %esi
andl $3,%edi
pushl %edi
pushl $.LC10
call printf
addl $16,%esp
movl x+8,%edi
andl $0xffff0fff,%edi
movl i,%esi
sall $28,%esi
sarl $28,%esi
shll $12,%esi
andl $0xf000,%esi
orl %esi,%edi
movl %edi,x+8
movl x+12,%edi
andl $0xffffff8f,%edi
movl %edi,x+12
movsbl x+13,%edi
pushl %edi
movl x+12,%edi
sall $25,%edi
sarl $29,%edi
pushl %edi
movl x+8,%edi
sall $16,%edi
sarl $28,%edi
pushl %edi
movl x+8,%edi
sall $20,%edi
sarl $20,%edi
pushl %edi
movsbl x+4,%edi
pushl %edi
pushl x
pushl $.LC4
call printf
addl $28,%esp
movl y,%edi
andl $0xfffffffc,%edi
orl $2,%edi
movl %edi,y
movl i,%edi
movl %edi,y+4
pushl y+4
movl y,%edi
movl %edi,%esi
shrl $2,%esi
andl $15,%esi
pushl %esi
andl $3,%edi
pushl %edi
pushl $.LC10
call printf
addl $16,%esp
pushl $x
call f2
addl $4,%esp
movl $0,%eax
.LC3:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf21:
.size main,.Lf21-main
.globl f1
.align 16
.type f1,@function
f1:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl 20(%ebp),%edi
andl $0xffffffc3,(,%edi)
movl 20(%ebp),%edi
movl (,%edi),%esi
andl $0xfffffffc,%esi
movl $0,%ebx
andl $3,%ebx
andl $3,%ebx
orl %ebx,%esi
movl %esi,(,%edi)
movl 20(%ebp),%edi
movl (,%edi),%edi
andl $60,%edi
cmpl $0,%edi
je .LC23
pushl $.LC25
call printf
addl $4,%esp
.LC23:
movl 20(%ebp),%edi
orl $3,(,%edi)
movl 20(%ebp),%edi
orl $60,(,%edi)
movl 20(%ebp),%edi
movl (,%edi),%edi
movl %edi,%esi
shrl $2,%esi
andl $15,%esi
pushl %esi
andl $3,%edi
pushl %edi
pushl $.LC26
call printf
addl $12,%esp
movl $0,%eax
.LC22:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf27:
.size f1,.Lf27-f1
.globl f2
.align 16
.type f2,@function
f2:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $4,%esp
cmpl $0,i
jne .LC30
movl $1,-4(%ebp)
jmp .LC31
.LC30:
movl $0,-4(%ebp)
.LC31:
movl 20(%ebp),%edi
movl (,%edi),%esi
andl $0xfffffffc,%esi
movl -4(%ebp),%ebx
andl $3,%ebx
andl $3,%ebx
orl %ebx,%esi
movl %esi,(,%edi)
movl 20(%ebp),%edi
pushl %edi
call f1
addl $4,%esp
movl (,%edi),%esi
andl $0xffffffc3,%esi
movl $0,%ebx
andl $15,%ebx
leal (,%ebx,4),%ebx
andl $60,%ebx
orl %ebx,%esi
movl %esi,(,%edi)
movl $0,%eax
.LC28:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf32:
.size f2,.Lf32-f2
.data
.align 1
.LC26:
.byte 112
.byte 45
.byte 62
.byte 97
.byte 32
.byte 61
.byte 32
.byte 48
.byte 120
.byte 37
.byte 120
.byte 44
.byte 32
.byte 112
.byte 45
.byte 62
.byte 98
.byte 32
.byte 61
.byte 32
.byte 48
.byte 120
.byte 37
.byte 120
.byte 10
.byte 0
.align 1
.LC25:
.byte 112
.byte 45
.byte 62
.byte 98
.byte 32
.byte 33
.byte 61
.byte 32
.byte 48
.byte 33
.byte 10
.byte 0
.align 1
.LC10:
.byte 121
.byte 32
.byte 61
.byte 32
.byte 37
.byte 100
.byte 32
.byte 37
.byte 100
.byte 32
.byte 37
.byte 100
.byte 10
.byte 0
.align 1
.LC4:
.byte 120
.byte 32
.byte 61
.byte 32
.byte 37
.byte 100
.byte 32
.byte 37
.byte 100
.byte 32
.byte 37
.byte 100
.byte 32
.byte 37
.byte 100
.byte 32
.byte 37
.byte 100
.byte 32
.byte 37
.byte 100
.byte 10
.byte 0
.text
.ident "LCC: 4.1"

View file

@ -0,0 +1,29 @@
tst/front.c:3: warning: missing return value
tst/front.c:10: warning: missing return value
tst/front.c:20: type error in argument 1 to `s'; found `pointer to struct D' expected `pointer to incomplete struct D defined at tst/front.c:14'
tst/front.c:21: warning: missing return value
tst/front.c:32: warning: missing return value
tst/front.c:36: operands of = have illegal types `pointer to int' and `pointer to const int'
tst/front.c:38: warning: missing return value
tst/front.c:62: operands of = have illegal types `pointer to char' and `pointer to const void'
tst/front.c:63: warning: missing return value
tst/front.c:68: warning: missing return value
tst/front.c:69: warning: inconsistent linkage for `yy' previously declared at tst/front.c:68
tst/front.c:69: warning: missing return value
tst/front.c:71: invalid storage class `static' for `int function goo'
tst/front.c:71: warning: declaration of `goo' does not match previous declaration at tst/front.c:70
tst/front.c:71: warning: missing return value
tst/front.c:74: warning: declaration of `xr' does not match previous declaration at tst/front.c:72
tst/front.c:74: warning: missing return value
tst/front.c:81: warning: missing return value
tst/front.c:82: warning: declaration of `ss2' does not match previous declaration at tst/front.c:81
tst/front.c:84: warning: inconsistent linkage for `ss5' previously declared at tst/front.c:80
tst/front.c:92: type error in argument 1 to `gx1'; found `pointer to double' expected `double'
tst/front.c:92: warning: missing return value
tst/front.c:95: redeclaration of `hx1' previously declared at tst/front.c:94
tst/front.c:98: warning: missing return value
tst/front.c:101: conflicting argument declarations for function `gg1'
tst/front.c:101: warning: missing return value
tst/front.c:112: type error in argument 4 to `qsort'; found `pointer to int function(pointer to pointer to char,pointer to pointer to char)' expected `pointer to int function(pointer to const void,pointer to const void)'
tst/front.c:113: warning: missing return value
tst/front.c:120: warning: missing return value

View file

@ -0,0 +1,530 @@
.globl main
.text
.align 16
.type main,@function
main:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
pushl $0
call exit
addl $4,%esp
movl $0,%eax
.LC1:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf2:
.size main,.Lf2-main
.globl nested
.align 16
.type nested,@function
nested:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
cmpl $4,20(%ebp)
jge .LC7
cmpl $114,24(%ebp)
je .LC10
.LC7:
cmpl $1,20(%ebp)
jne .LC9
movl 24(%ebp),%edi
cmpl $104,%edi
je .LC10
cmpl $105,%edi
je .LC10
.LC9:
cmpl $2,20(%ebp)
jne .LC4
movl 24(%ebp),%edi
cmpl $111,%edi
je .LC10
cmpl $121,%edi
jne .LC4
.LC10:
movl 24(%ebp),%edi
movl %edi,20(%ebp)
.LC4:
movl $0,%eax
.LC3:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf11:
.size nested,.Lf11-nested
.globl s
.align 16
.type s,@function
s:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
.LC12:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf13:
.size s,.Lf13-s
.data
.globl Dy
.align 4
.type Dy,@object
.size Dy,8
Dy:
.long 0
.space 4
.globl Dz
.align 4
.type Dz,@object
.size Dz,8
Dz:
.long 1
.space 4
.globl Dfunc
.text
.align 16
.type Dfunc,@function
Dfunc:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf16:
.size Dfunc,.Lf16-Dfunc
.globl f
.align 16
.type f,@function
f:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf18:
.size f,.Lf18-f
.globl f1
.align 16
.type f1,@function
f1:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf20:
.size f1,.Lf20-f1
.globl f2
.align 16
.type f2,@function
f2:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf22:
.size f2,.Lf22-f2
.globl g
.align 16
.type g,@function
g:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf24:
.size g,.Lf24-g
.globl h
.align 16
.type h,@function
h:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf26:
.size h,.Lf26-h
.globl h1
.align 16
.type h1,@function
h1:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf28:
.size h1,.Lf28-h1
.globl h2
.align 16
.type h2,@function
h2:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf30:
.size h2,.Lf30-h2
.data
.align 4
.type yy.32,@object
.size yy.32,4
yy.32:
.long 1
.globl set1
.text
.align 16
.type set1,@function
set1:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf33:
.size set1,.Lf33-set1
.data
.align 4
.type yy.35,@object
.size yy.35,4
yy.35:
.long 2
.globl set2
.text
.align 16
.type set2,@function
set2:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf36:
.size set2,.Lf36-set2
.align 16
.type goo,@function
goo:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf38:
.size goo,.Lf38-goo
.globl sss
.align 16
.type sss,@function
sss:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf40:
.size sss,.Lf40-sss
.bss
.align 4
.type xr.42,@object
.size xr.42,4
.lcomm xr.42,4
.globl rrr
.text
.align 16
.type rrr,@function
rrr:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf43:
.size rrr,.Lf43-rrr
.globl setstatic
.align 16
.type setstatic,@function
setstatic:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf45:
.size setstatic,.Lf45-setstatic
.globl gx1
.align 16
.type gx1,@function
gx1:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf47:
.size gx1,.Lf47-gx1
.globl ff1
.align 16
.type ff1,@function
ff1:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf49:
.size ff1,.Lf49-ff1
.globl gg1
.align 16
.type gg1,@function
gg1:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf51:
.size gg1,.Lf51-gg1
.globl hh1
.align 16
.type hh1,@function
hh1:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf53:
.size hh1,.Lf53-hh1
.globl cmp
.align 16
.type cmp,@function
cmp:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf55:
.size cmp,.Lf55-cmp
.globl sort
.align 16
.type sort,@function
sort:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf57:
.size sort,.Lf57-sort
.globl onearg
.align 16
.type onearg,@function
onearg:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf65:
.size onearg,.Lf65-onearg
.bss
.globl ss4
.align 4
.type ss4,@object
.size ss4,4
.comm ss4,4
.align 4
.type ss2,@object
.size ss2,4
.lcomm ss2,4
.align 4
.type ss5,@object
.size ss5,4
.lcomm ss5,4
.globl ss3
.align 4
.type ss3,@object
.size ss3,4
.comm ss3,4
.align 4
.type ss1,@object
.size ss1,4
.lcomm ss1,4
.align 4
.type yy,@object
.size yy,4
.lcomm yy,4
.globl z
.align 4
.type z,@object
.size z,4
.comm z,4
.globl y
.align 4
.type y,@object
.size y,4
.comm y,4
.globl x
.align 4
.type x,@object
.size x,4
.comm x,4
.globl b
.align 4
.type b,@object
.size b,4
.comm b,4
.globl a
.align 4
.type a,@object
.size a,4
.comm a,4
.text
.ident "LCC: 4.1"

View file

View file

@ -0,0 +1,9 @@
tst/incr.c:1: warning: missing return value
tst/incr.c:6: warning: expression with no effect elided
tst/incr.c:6: warning: expression with no effect elided
tst/incr.c:11: warning: missing return value
tst/incr.c:16: warning: expression with no effect elided
tst/incr.c:16: warning: expression with no effect elided
tst/incr.c:21: warning: missing return value
tst/incr.c:30: warning: missing return value
tst/incr.c:39: warning: missing return value

View file

@ -0,0 +1,181 @@
.globl main
.text
.align 16
.type main,@function
main:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl $0,%eax
.LC1:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf2:
.size main,.Lf2-main
.globl memchar
.align 16
.type memchar,@function
memchar:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $8,%esp
movl -8(%ebp),%edi
leal 1(%edi),%esi
movl %esi,-8(%ebp)
movb (,%edi),%bl
movb %bl,-1(%ebp)
movl -8(%ebp),%edi
leal 1(%edi),%edi
movl %edi,-8(%ebp)
movb (,%edi),%bl
movb %bl,-1(%ebp)
movl -8(%ebp),%edi
leal -1(%edi),%esi
movl %esi,-8(%ebp)
movb (,%edi),%bl
movb %bl,-1(%ebp)
movl -8(%ebp),%edi
leal -1(%edi),%edi
movl %edi,-8(%ebp)
movb (,%edi),%bl
movb %bl,-1(%ebp)
movl $0,%eax
.LC3:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf4:
.size memchar,.Lf4-memchar
.globl memint
.align 16
.type memint,@function
memint:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $8,%esp
movl -8(%ebp),%edi
leal 4(%edi),%esi
movl %esi,-8(%ebp)
movl (,%edi),%edi
movl %edi,-4(%ebp)
movl -8(%ebp),%edi
leal 4(%edi),%edi
movl %edi,-8(%ebp)
movl (,%edi),%edi
movl %edi,-4(%ebp)
movl -8(%ebp),%edi
leal -4(%edi),%esi
movl %esi,-8(%ebp)
movl (,%edi),%edi
movl %edi,-4(%ebp)
movl -8(%ebp),%edi
leal -4(%edi),%edi
movl %edi,-8(%ebp)
movl (,%edi),%edi
movl %edi,-4(%ebp)
movl $0,%eax
.LC5:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf6:
.size memint,.Lf6-memint
.globl regchar
.align 16
.type regchar,@function
regchar:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $8,%esp
movl -8(%ebp),%edi
leal 1(%edi),%esi
movl %esi,-8(%ebp)
movb (,%edi),%bl
movb %bl,-1(%ebp)
movl -8(%ebp),%edi
leal 1(%edi),%edi
movl %edi,-8(%ebp)
movb (,%edi),%bl
movb %bl,-1(%ebp)
movl -8(%ebp),%edi
leal -1(%edi),%esi
movl %esi,-8(%ebp)
movb (,%edi),%bl
movb %bl,-1(%ebp)
movl -8(%ebp),%edi
leal -1(%edi),%edi
movl %edi,-8(%ebp)
movb (,%edi),%bl
movb %bl,-1(%ebp)
movl $0,%eax
.LC7:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf8:
.size regchar,.Lf8-regchar
.globl regint
.align 16
.type regint,@function
regint:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $8,%esp
movl -8(%ebp),%edi
leal 4(%edi),%esi
movl %esi,-8(%ebp)
movl (,%edi),%edi
movl %edi,-4(%ebp)
movl -8(%ebp),%edi
leal 4(%edi),%edi
movl %edi,-8(%ebp)
movl (,%edi),%edi
movl %edi,-4(%ebp)
movl -8(%ebp),%edi
leal -4(%edi),%esi
movl %esi,-8(%ebp)
movl (,%edi),%edi
movl %edi,-4(%ebp)
movl -8(%ebp),%edi
leal -4(%edi),%edi
movl %edi,-8(%ebp)
movl (,%edi),%edi
movl %edi,-4(%ebp)
movl $0,%eax
.LC9:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf10:
.size regint,.Lf10-regint
.ident "LCC: 4.1"

View file

@ -0,0 +1,16 @@
1 2 3 4
5 6
7
if
for
else
while
1 2 3 if
4 5 0 for
6 7 8 else
9 10 11 while
1 2 3 if
4 5 0 for
6 7 8 else
9 10 11 while
0 0 0

View file

@ -0,0 +1,3 @@
tst/init.c:36: warning: missing return value
tst/init.c:49: warning: missing return value
tst/init.c:59: warning: missing return value

View file

@ -0,0 +1,336 @@
.data
.globl words
.align 4
.type words,@object
words:
.long 1
.long 2
.long 3
.byte 105
.byte 102
.byte 0
.space 3
.space 2
.long 4
.long 5
.space 4
.byte 102
.byte 111
.byte 114
.space 3
.space 2
.long 6
.long 7
.long 8
.byte 101
.byte 108
.byte 115
.byte 101
.byte 0
.space 1
.space 2
.long 9
.long 10
.long 11
.byte 119
.byte 104
.byte 105
.byte 108
.byte 101
.space 1
.space 2
.long 0
.space 8
.space 8
.size words,100
.globl wordlist
.align 4
.type wordlist,@object
.size wordlist,4
wordlist:
.long words
.globl x
.align 4
.type x,@object
x:
.long 1
.long 2
.long 3
.long 4
.long 0
.long 5
.long 6
.space 12
.long 7
.space 16
.size x,60
.globl y
.align 4
.type y,@object
y:
.long x
.long x+20
.long x+40
.long 0
.size y,16
.globl main
.text
.align 16
.type main,@function
main:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $8,%esp
movl $0,-8(%ebp)
jmp .LC8
.LC5:
movl $0,-4(%ebp)
jmp .LC12
.LC9:
movl -4(%ebp),%edi
movl -8(%ebp),%esi
movl y(,%esi,4),%esi
pushl (%esi,%edi,4)
pushl $.LC13
call printf
addl $8,%esp
.LC10:
incl -4(%ebp)
.LC12:
movl -4(%ebp),%edi
movl -8(%ebp),%esi
movl y(,%esi,4),%esi
cmpl $0,(%esi,%edi,4)
jne .LC9
pushl $.LC14
call printf
addl $4,%esp
.LC6:
incl -8(%ebp)
.LC8:
movl -8(%ebp),%edi
movl y(,%edi,4),%edi
cmpl $0,%edi
jne .LC5
call f
pushl wordlist
call g
addl $4,%esp
movl $0,%eax
.LC4:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf15:
.size main,.Lf15-main
.data
.align 4
.type keywords.17,@object
keywords.17:
.long .LC18
.long .LC19
.long .LC20
.long .LC21
.long 0
.size keywords.17,20
.globl f
.text
.align 16
.type f,@function
f:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $4,%esp
leal keywords.17,%edi
movl %edi,-4(%ebp)
jmp .LC25
.LC22:
movl -4(%ebp),%edi
pushl (,%edi)
pushl $.LC26
call printf
addl $8,%esp
.LC23:
movl -4(%ebp),%edi
leal 4(%edi),%edi
movl %edi,-4(%ebp)
.LC25:
movl -4(%ebp),%edi
movl (,%edi),%edi
cmpl $0,%edi
jne .LC22
movl $0,%eax
.LC16:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf27:
.size f,.Lf27-f
.globl g
.align 16
.type g,@function
g:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $4,%esp
jmp .LC32
.LC29:
movl $0,-4(%ebp)
jmp .LC36
.LC33:
movl -4(%ebp),%edi
movl 20(%ebp),%esi
pushl (%esi,%edi,4)
pushl $.LC37
call printf
addl $8,%esp
.LC34:
incl -4(%ebp)
.LC36:
movl -4(%ebp),%edi
cmpl $3,%edi
jb .LC33
movl 20(%ebp),%edi
leal 12(%edi),%edi
pushl %edi
pushl $.LC26
call printf
addl $8,%esp
.LC30:
movl 20(%ebp),%edi
leal 20(%edi),%edi
movl %edi,20(%ebp)
.LC32:
movl 20(%ebp),%edi
cmpl $0,(,%edi)
jne .LC29
call h
movl $0,%eax
.LC28:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf38:
.size g,.Lf38-g
.globl h
.align 16
.type h,@function
h:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $4,%esp
movl $0,-4(%ebp)
jmp .LC43
.LC40:
imul $20,-4(%ebp),%edi
leal words+12(%edi),%esi
pushl %esi
pushl words+8(%edi)
pushl words+4(%edi)
pushl words(%edi)
pushl $.LC44
call printf
addl $20,%esp
.LC41:
incl -4(%ebp)
.LC43:
movl -4(%ebp),%edi
cmpl $5,%edi
jb .LC40
movl $0,%eax
.LC39:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf48:
.size h,.Lf48-h
.data
.align 1
.LC44:
.byte 37
.byte 100
.byte 32
.byte 37
.byte 100
.byte 32
.byte 37
.byte 100
.byte 32
.byte 37
.byte 115
.byte 10
.byte 0
.align 1
.LC37:
.byte 37
.byte 100
.byte 32
.byte 0
.align 1
.LC26:
.byte 37
.byte 115
.byte 10
.byte 0
.align 1
.LC21:
.byte 119
.byte 104
.byte 105
.byte 108
.byte 101
.byte 0
.align 1
.LC20:
.byte 101
.byte 108
.byte 115
.byte 101
.byte 0
.align 1
.LC19:
.byte 102
.byte 111
.byte 114
.byte 0
.align 1
.LC18:
.byte 105
.byte 102
.byte 0
.align 1
.LC14:
.byte 10
.byte 0
.align 1
.LC13:
.byte 32
.byte 37
.byte 100
.byte 0
.text
.ident "LCC: 4.1"

View file

@ -0,0 +1,14 @@
UCHAR_MAX: 000000ff=255
USHRT_MAX: 0000ffff=65535
UINT_MAX: ffffffff=-1
ULONG_MAX: ffffffff=-1
CHAR_MAX: 0000007f=127
SCHAR_MAX: 0000007f=127
SHRT_MAX: 00007fff=32767
INT_MAX: 7fffffff=2147483647
LONG_MAX: 7fffffff=2147483647
CHAR_MIN: ffffff80=-128
SCHAR_MIN: ffffff80=-128
SHRT_MIN: ffff8000=-32768
INT_MIN: 80000000=-2147483648
LONG_MIN: 80000000=-2147483648

View file

View file

@ -0,0 +1,396 @@
.globl main
.text
.align 16
.type main,@function
main:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
pushl $255
pushl $255
pushl $.LC2
call printf
addl $12,%esp
pushl $65535
pushl $65535
pushl $.LC3
call printf
addl $12,%esp
pushl $0xffffffff
pushl $0xffffffff
pushl $.LC4
call printf
addl $12,%esp
pushl $0xffffffff
pushl $0xffffffff
pushl $.LC5
call printf
addl $12,%esp
pushl $127
pushl $127
pushl $.LC6
call printf
addl $12,%esp
pushl $127
pushl $127
pushl $.LC7
call printf
addl $12,%esp
pushl $32767
pushl $32767
pushl $.LC8
call printf
addl $12,%esp
pushl $2147483647
pushl $2147483647
pushl $.LC9
call printf
addl $12,%esp
pushl $2147483647
pushl $2147483647
pushl $.LC10
call printf
addl $12,%esp
pushl $-128
pushl $-128
pushl $.LC11
call printf
addl $12,%esp
pushl $-128
pushl $-128
pushl $.LC12
call printf
addl $12,%esp
pushl $-32768
pushl $-32768
pushl $.LC13
call printf
addl $12,%esp
pushl $-2147483648
pushl $-2147483648
pushl $.LC14
call printf
addl $12,%esp
pushl $-2147483648
pushl $-2147483648
pushl $.LC15
call printf
addl $12,%esp
movl $0,%eax
.LC1:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf16:
.size main,.Lf16-main
.data
.align 1
.LC15:
.byte 76
.byte 79
.byte 78
.byte 71
.byte 95
.byte 77
.byte 73
.byte 78
.byte 58
.byte 9
.byte 37
.byte 48
.byte 56
.byte 108
.byte 120
.byte 61
.byte 37
.byte 108
.byte 100
.byte 10
.byte 0
.align 1
.LC14:
.byte 73
.byte 78
.byte 84
.byte 95
.byte 77
.byte 73
.byte 78
.byte 58
.byte 9
.byte 37
.byte 48
.byte 56
.byte 120
.byte 61
.byte 37
.byte 100
.byte 10
.byte 0
.align 1
.LC13:
.byte 83
.byte 72
.byte 82
.byte 84
.byte 95
.byte 77
.byte 73
.byte 78
.byte 58
.byte 9
.byte 37
.byte 48
.byte 56
.byte 120
.byte 61
.byte 37
.byte 100
.byte 10
.byte 0
.align 1
.LC12:
.byte 83
.byte 67
.byte 72
.byte 65
.byte 82
.byte 95
.byte 77
.byte 73
.byte 78
.byte 58
.byte 9
.byte 37
.byte 48
.byte 56
.byte 120
.byte 61
.byte 37
.byte 100
.byte 10
.byte 0
.align 1
.LC11:
.byte 67
.byte 72
.byte 65
.byte 82
.byte 95
.byte 77
.byte 73
.byte 78
.byte 58
.byte 9
.byte 37
.byte 48
.byte 56
.byte 120
.byte 61
.byte 37
.byte 100
.byte 10
.byte 0
.align 1
.LC10:
.byte 76
.byte 79
.byte 78
.byte 71
.byte 95
.byte 77
.byte 65
.byte 88
.byte 58
.byte 9
.byte 37
.byte 48
.byte 56
.byte 108
.byte 120
.byte 61
.byte 37
.byte 108
.byte 100
.byte 10
.byte 0
.align 1
.LC9:
.byte 73
.byte 78
.byte 84
.byte 95
.byte 77
.byte 65
.byte 88
.byte 58
.byte 9
.byte 37
.byte 48
.byte 56
.byte 120
.byte 61
.byte 37
.byte 100
.byte 10
.byte 0
.align 1
.LC8:
.byte 83
.byte 72
.byte 82
.byte 84
.byte 95
.byte 77
.byte 65
.byte 88
.byte 58
.byte 9
.byte 37
.byte 48
.byte 56
.byte 120
.byte 61
.byte 37
.byte 100
.byte 10
.byte 0
.align 1
.LC7:
.byte 83
.byte 67
.byte 72
.byte 65
.byte 82
.byte 95
.byte 77
.byte 65
.byte 88
.byte 58
.byte 9
.byte 37
.byte 48
.byte 56
.byte 120
.byte 61
.byte 37
.byte 100
.byte 10
.byte 0
.align 1
.LC6:
.byte 67
.byte 72
.byte 65
.byte 82
.byte 95
.byte 77
.byte 65
.byte 88
.byte 58
.byte 9
.byte 37
.byte 48
.byte 56
.byte 120
.byte 61
.byte 37
.byte 100
.byte 10
.byte 0
.align 1
.LC5:
.byte 85
.byte 76
.byte 79
.byte 78
.byte 71
.byte 95
.byte 77
.byte 65
.byte 88
.byte 58
.byte 9
.byte 37
.byte 48
.byte 56
.byte 108
.byte 120
.byte 61
.byte 37
.byte 108
.byte 100
.byte 10
.byte 0
.align 1
.LC4:
.byte 85
.byte 73
.byte 78
.byte 84
.byte 95
.byte 77
.byte 65
.byte 88
.byte 58
.byte 9
.byte 37
.byte 48
.byte 56
.byte 120
.byte 61
.byte 37
.byte 100
.byte 10
.byte 0
.align 1
.LC3:
.byte 85
.byte 83
.byte 72
.byte 82
.byte 84
.byte 95
.byte 77
.byte 65
.byte 88
.byte 58
.byte 9
.byte 37
.byte 48
.byte 56
.byte 120
.byte 61
.byte 37
.byte 100
.byte 10
.byte 0
.align 1
.LC2:
.byte 85
.byte 67
.byte 72
.byte 65
.byte 82
.byte 95
.byte 77
.byte 65
.byte 88
.byte 58
.byte 9
.byte 37
.byte 48
.byte 56
.byte 120
.byte 61
.byte 37
.byte 100
.byte 10
.byte 0
.text
.ident "LCC: 4.1"

View file

@ -0,0 +1,183 @@
Lest this program stop prematurely, i.e. before displaying
`END OF TEST',
try to persuade the computer NOT to terminate execution when an
error like Over/Underflow or Division by Zero occurs, but rather
to persevere with a surrogate value after, perhaps, displaying some
warning. If persuasion avails naught, don't despair but run this
program anyway to see how many milestones it passes, and then
amend it to make further progress.
Answer questions with Y, y, N or n (unless otherwise indicated).
Diagnosis resumes after milestone Number 0 Page: 1
Users are invited to help debug and augment this program so it will
cope with unanticipated and newly uncovered arithmetic pathologies.
Please send suggestions and interesting results to
Richard Karpinski
Computer Center U-76
University of California
San Francisco, CA 94143-0704, USA
In doing so, please include the following information:
Precision: double;
Version: 10 February 1989;
Computer:
Compiler:
Optimization level:
Other relevant compiler options:
Diagnosis resumes after milestone Number 1 Page: 2
Running this program should reveal these characteristics:
Radix = 1, 2, 4, 8, 10, 16, 100, 256 ...
Precision = number of significant digits carried.
U2 = Radix/Radix^Precision = One Ulp
(OneUlpnit in the Last Place) of 1.000xxx .
U1 = 1/Radix^Precision = One Ulp of numbers a little less than 1.0 .
Adequacy of guard digits for Mult., Div. and Subt.
Whether arithmetic is chopped, correctly rounded, or something else
for Mult., Div., Add/Subt. and Sqrt.
Whether a Sticky Bit used correctly for rounding.
UnderflowThreshold = an underflow threshold.
E0 and PseudoZero tell whether underflow is abrupt, gradual, or fuzzy.
V = an overflow threshold, roughly.
V0 tells, roughly, whether Infinity is represented.
Comparisions are checked for consistency with subtraction
and for contamination with pseudo-zeros.
Sqrt is tested. Y^X is not tested.
Extra-precise subexpressions are revealed but NOT YET tested.
Decimal-Binary conversion is NOT YET tested for accuracy.
Diagnosis resumes after milestone Number 2 Page: 3
The program attempts to discriminate among
FLAWs, like lack of a sticky bit,
Serious DEFECTs, like lack of a guard digit, and
FAILUREs, like 2+2 == 5 .
Failures may confound subsequent diagnoses.
The diagnostic capabilities of this program go beyond an earlier
program called `MACHAR', which can be found at the end of the
book `Software Manual for the Elementary Functions' (1980) by
W. J. Cody and W. Waite. Although both programs try to discover
the Radix, Precision and range (over/underflow thresholds)
of the arithmetic, this program tries to cope with a wider variety
of pathologies, and to say how well the arithmetic is implemented.
The program is based upon a conventional radix representation for
floating-point numbers, but also allows logarithmic encoding
as used by certain early WANG machines.
BASIC version of this program (C) 1983 by Prof. W. M. Kahan;
see source comments for more history.
Diagnosis resumes after milestone Number 3 Page: 4
Program is now RUNNING tests on small integers:
-1, 0, 1/2, 1, 2, 3, 4, 5, 9, 27, 32 & 240 are O.K.
Searching for Radix and Precision.
Radix = 2.000000 .
Closest relative separation found is U1 = 1.1102230e-16 .
Recalculating radix and precision
confirms closest relative separation U1 .
Radix confirmed.
The number of significant digits of the Radix is 53.000000 .
Some subexpressions appear to be calculated extra
precisely with about 11 extra B-digits, i.e.
roughly 3.31133 extra significant decimals.
That feature is not tested further by this program.
Diagnosis resumes after milestone Number 30 Page: 5
Subtraction appears to be normalized, as it should be.
Checking for guard digit in *, /, and -.
*, /, and - appear to have guard digits, as they should.
Diagnosis resumes after milestone Number 40 Page: 6
Checking rounding on multiply, divide and add/subtract.
* is neither chopped nor correctly rounded.
/ is neither chopped nor correctly rounded.
Addition/Subtraction neither rounds nor chops.
Sticky bit used incorrectly or not at all.
FLAW: lack(s) of guard digits or failure(s) to correctly round or chop
(noted above) count as one flaw in the final tally below.
Does Multiplication commute? Testing on 20 random pairs.
No failures found in 20 integer pairs.
Running test of square root(x).
Testing if sqrt(X * X) == X for 20 Integers X.
Test for sqrt monotonicity.
sqrt has passed a test for Monotonicity.
Testing whether sqrt is rounded or chopped.
Square root is neither chopped nor correctly rounded.
Observed errors run from -5.0000000e-01 to 5.0000000e-01 ulps.
Diagnosis resumes after milestone Number 90 Page: 7
Testing powers Z^i for small Integers Z and i.
... no discrepancis found.
Seeking Underflow thresholds UfThold and E0.
Smallest strictly positive number found is E0 = 4.94066e-324 .
Since comparison denies Z = 0, evaluating (Z + Z) / Z should be safe.
What the machine gets for (Z + Z) / Z is 2.00000000000000000e+00 .
This is O.K., provided Over/Underflow has NOT just been signaled.
Underflow is gradual; it incurs Absolute Error =
(roundoff in UfThold) < E0.
The Underflow threshold is 2.22507385850720188e-308, below which
calculation may suffer larger Relative error than merely roundoff.
Since underflow occurs below the threshold
UfThold = (2.00000000000000000e+00) ^ (-1.02200000000000000e+03)
only underflow should afflict the expression
(2.00000000000000000e+00) ^ (-1.02200000000000000e+03);
actually calculating yields: 0.00000000000000000e+00 .
This computed value is O.K.
Testing X^((X + 1) / (X - 1)) vs. exp(2) = 7.38905609893065218e+00 as X -> 1.
Accuracy seems adequate.
Testing powers Z^Q at four nearly extreme values.
... no discrepancies found.
Diagnosis resumes after milestone Number 160 Page: 8
Searching for Overflow threshold:
This may generate an error.
Can `Z = -Y' overflow?
Trying it on Y = -Inf .
Seems O.K.
Overflow threshold is V = 1.79769313486231571e+308 .
Overflow saturates at V0 = Inf .
No Overflow should be signaled for V * 1 = 1.79769313486231571e+308
nor for V / 1 = 1.79769313486231571e+308 .
Any overflow signal separating this * from the one
above is a DEFECT.
Diagnosis resumes after milestone Number 190 Page: 9
What message and/or values does Division by Zero produce?
Trying to compute 1 / 0 produces ... Inf .
Trying to compute 0 / 0 produces ... NaN .
Diagnosis resumes after milestone Number 220 Page: 10
The number of FLAWs discovered = 1.
The arithmetic diagnosed seems Satisfactory though flawed.
END OF TEST.

View file

@ -0,0 +1,16 @@
tst/paranoia.c:1867: warning: missing return value
tst/paranoia.c:1874: warning: missing return value
tst/paranoia.c:1884: warning: missing return value
tst/paranoia.c:1924: warning: missing return value
tst/paranoia.c:1939: warning: missing return value
tst/paranoia.c:1956: warning: missing return value
tst/paranoia.c:1975: warning: missing return value
tst/paranoia.c:1988: warning: missing return value
tst/paranoia.c:1995: warning: missing return value
tst/paranoia.c:2055: warning: missing return value
tst/paranoia.c:2062: warning: missing return value
tst/paranoia.c:2070: warning: missing return value
tst/paranoia.c:2087: warning: missing return value
tst/paranoia.c:2115: warning: missing return value
tst/paranoia.c:2144: warning: missing return value
tst/paranoia.c:2173: warning: missing return value

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,20 @@
exchange(1,9)
exchange(3,7)
exchange(5,6)
exchange(0,5)
exchange(0,3)
exchange(0,0)
exchange(1,2)
exchange(6,6)
exchange(8,9)
exchange(7,8)
-51
-1
0
1
3
10
18
32
567
789

View file

@ -0,0 +1,5 @@
tst/sort.c:23: warning: missing return value
tst/sort.c:30: warning: missing return value
tst/sort.c:37: warning: missing return value
tst/sort.c:41: warning: missing return value
tst/sort.c:65: warning: missing return value

View file

@ -0,0 +1,330 @@
.data
.globl in
.align 4
.type in,@object
in:
.long 10
.long 32
.long -1
.long 567
.long 3
.long 18
.long 1
.long -51
.long 789
.long 0
.size in,40
.globl main
.text
.align 16
.type main,@function
main:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $4,%esp
pushl $10
pushl $in
call sort
addl $8,%esp
movl $0,-4(%ebp)
jmp .LC5
.LC2:
movl -4(%ebp),%edi
pushl in(,%edi,4)
call putd
addl $4,%esp
pushl $10
call putchar
addl $4,%esp
.LC3:
incl -4(%ebp)
.LC5:
movl -4(%ebp),%edi
cmpl $10,%edi
jb .LC2
movl $0,%eax
.LC1:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf6:
.size main,.Lf6-main
.globl putd
.align 16
.type putd,@function
putd:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
cmpl $0,20(%ebp)
jge .LC8
pushl $45
call putchar
addl $4,%esp
negl 20(%ebp)
.LC8:
movl 20(%ebp),%eax
movl $10,%ecx
cdq
idivl %ecx
cmpl $0,%eax
je .LC10
movl 20(%ebp),%eax
movl $10,%ecx
cdq
idivl %ecx
pushl %eax
call putd
addl $4,%esp
.LC10:
movl 20(%ebp),%eax
movl $10,%ecx
cdq
idivl %ecx
leal 48(%edx),%edi
pushl %edi
call putchar
addl $4,%esp
movl $0,%eax
.LC7:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf12:
.size putd,.Lf12-putd
.globl sort
.align 16
.type sort,@function
sort:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl 24(%ebp),%edi
subl $1,%edi
movl %edi,24(%ebp)
pushl %edi
pushl $0
movl 20(%ebp),%edi
movl %edi,xx
pushl %edi
call quick
addl $12,%esp
movl $0,%eax
.LC13:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf14:
.size sort,.Lf14-sort
.globl quick
.align 16
.type quick,@function
quick:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $4,%esp
movl 28(%ebp),%edi
cmpl %edi,24(%ebp)
jl .LC16
jmp .LC15
.LC16:
pushl 28(%ebp)
pushl 24(%ebp)
pushl 20(%ebp)
call partition
addl $12,%esp
movl %eax,-4(%ebp)
movl -4(%ebp),%edi
subl $1,%edi
pushl %edi
pushl 24(%ebp)
pushl 20(%ebp)
call quick
addl $12,%esp
pushl 28(%ebp)
movl -4(%ebp),%edi
leal 1(%edi),%edi
pushl %edi
pushl 20(%ebp)
call quick
addl $12,%esp
movl $0,%eax
.LC15:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf18:
.size quick,.Lf18-quick
.globl partition
.align 16
.type partition,@function
partition:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $8,%esp
incl 28(%ebp)
movl 24(%ebp),%edi
movl %edi,-8(%ebp)
movl -8(%ebp),%edi
movl 20(%ebp),%esi
movl (%esi,%edi,4),%edi
movl %edi,-4(%ebp)
jmp .LC21
.LC20:
incl 24(%ebp)
jmp .LC24
.LC23:
incl 24(%ebp)
.LC24:
movl 24(%ebp),%edi
movl 20(%ebp),%esi
movl -4(%ebp),%ebx
cmpl %ebx,(%esi,%edi,4)
jl .LC23
decl 28(%ebp)
jmp .LC27
.LC26:
decl 28(%ebp)
.LC27:
movl 28(%ebp),%edi
movl 20(%ebp),%esi
movl -4(%ebp),%ebx
cmpl %ebx,(%esi,%edi,4)
jg .LC26
movl 28(%ebp),%edi
cmpl %edi,24(%ebp)
jge .LC29
movl 20(%ebp),%edi
movl 28(%ebp),%esi
leal (%edi,%esi,4),%esi
pushl %esi
movl 24(%ebp),%esi
leal (%edi,%esi,4),%edi
pushl %edi
call exchange
addl $8,%esp
.LC29:
.LC21:
movl 28(%ebp),%edi
cmpl %edi,24(%ebp)
jl .LC20
movl 20(%ebp),%edi
movl 28(%ebp),%esi
leal (%edi,%esi,4),%esi
pushl %esi
movl -8(%ebp),%esi
leal (%edi,%esi,4),%edi
pushl %edi
call exchange
addl $8,%esp
movl 28(%ebp),%eax
.LC19:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf31:
.size partition,.Lf31-partition
.globl exchange
.align 16
.type exchange,@function
exchange:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $4,%esp
movl xx,%edi
movl $4,%esi
movl 24(%ebp),%ebx
subl %edi,%ebx
movl %ebx,%eax
movl %esi,%ecx
cdq
idivl %ecx
pushl %eax
movl 20(%ebp),%ebx
subl %edi,%ebx
movl %ebx,%eax
movl %esi,%ecx
cdq
idivl %ecx
pushl %eax
pushl $.LC33
call printf
addl $12,%esp
movl 20(%ebp),%edi
movl (,%edi),%esi
movl %esi,-4(%ebp)
movl 24(%ebp),%esi
movl (,%esi),%esi
movl %esi,(,%edi)
movl 24(%ebp),%edi
movl -4(%ebp),%esi
movl %esi,(,%edi)
movl $0,%eax
.LC32:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf34:
.size exchange,.Lf34-exchange
.bss
.globl xx
.align 4
.type xx,@object
.size xx,4
.comm xx,4
.data
.align 1
.LC33:
.byte 101
.byte 120
.byte 99
.byte 104
.byte 97
.byte 110
.byte 103
.byte 101
.byte 40
.byte 37
.byte 100
.byte 44
.byte 37
.byte 100
.byte 41
.byte 10
.byte 0
.text
.ident "LCC: 4.1"

View file

View file

@ -0,0 +1,6 @@
tst/spill.c:1: warning: missing return value
tst/spill.c:3: warning: missing return value
tst/spill.c:5: warning: missing return value
tst/spill.c:7: warning: missing return value
tst/spill.c:9: warning: missing return value
tst/spill.c:17: warning: missing return value

View file

@ -0,0 +1,282 @@
.globl main
.text
.align 16
.type main,@function
main:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl $0,%eax
.LC1:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf2:
.size main,.Lf2-main
.globl f
.align 16
.type f,@function
f:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
call f
movl %eax,%edi
call f
leal (%eax,%edi),%edi
movl %edi,20(%ebp)
movl $0,%eax
.LC3:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf4:
.size f,.Lf4-f
.globl f2
.align 16
.type f2,@function
f2:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $4,%esp
call f
movl %eax,%edi
cmpl $0,20(%ebp)
je .LC7
call f
movl %eax,%esi
movl %esi,-4(%ebp)
jmp .LC8
.LC7:
movl $1,-4(%ebp)
.LC8:
movl -4(%ebp),%esi
leal (%esi,%edi),%edi
movl %edi,20(%ebp)
movl $0,%eax
.LC5:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf9:
.size f2,.Lf9-f2
.globl f3
.align 16
.type f3,@function
f3:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $44,%esp
movl $0,-4(%ebp)
movl $0,-8(%ebp)
movl $0,-12(%ebp)
movl $0,-16(%ebp)
movl $0,-20(%ebp)
movl $0,-24(%ebp)
movl $0,-28(%ebp)
movl $0,-32(%ebp)
movl $0,-36(%ebp)
movl $0,-40(%ebp)
movl 24(%ebp),%edi
leal 4(%edi),%esi
movl %esi,24(%ebp)
cmpl $0,20(%ebp)
je .LC12
call f
movl %eax,%esi
movl %esi,-44(%ebp)
jmp .LC13
.LC12:
movl $0,-44(%ebp)
.LC13:
movl -44(%ebp),%esi
movl %esi,(,%edi)
movl $0,%eax
.LC10:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf14:
.size f3,.Lf14-f3
.globl f4
.align 16
.type f4,@function
f4:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $52,%esp
movl $0,-4(%ebp)
movl $0,-8(%ebp)
movl $0,-12(%ebp)
movl $0,-16(%ebp)
movl $0,-20(%ebp)
movl $0,-24(%ebp)
movl i,%edi
leal (,%edi,8),%esi
fldl a(%esi)
fstpl -36(%ebp)
fldl b(%esi)
fstpl -44(%ebp)
fldl -36(%ebp)
faddl -44(%ebp)
fldl .LC19
fcompp
fstsw %ax
sahf
je .LC17
cmpl $0,%edi
je .LC17
fldl -36(%ebp)
fsubl -44(%ebp)
fldl .LC19
fcompp
fstsw %ax
sahf
je .LC17
movl $1,-28(%ebp)
jmp .LC18
.LC17:
movl $0,-28(%ebp)
.LC18:
movl -28(%ebp),%edi
movl %edi,i
movl $0,%eax
.LC15:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf20:
.size f4,.Lf20-f4
.globl f5
.align 16
.type f5,@function
f5:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl k,%edi
movl m,%esi
movl A,%ebx
movl %edi,%edx
imull %esi,%edx
leal (%ebx,%edx,8),%edx
movl j,%ecx
movl %ecx,%eax
imull %esi,%eax
leal (%ebx,%eax,8),%esi
movl n,%ebx
movl B,%eax
imull %ebx,%edi
leal (%eax,%edi,8),%edi
imull %ebx,%ecx
leal (%eax,%ecx,8),%ebx
fldl (,%edx)
fmull (,%esi)
fldl (,%edi)
fmull (,%ebx)
faddp %st(1),%st
fstpl x
fldl (,%edx)
fmull (,%ebx)
fldl (,%edi)
fmull (,%esi)
fsubp %st(1),%st
fstpl x
movl $0,%eax
.LC21:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf22:
.size f5,.Lf22-f5
.bss
.globl x
.align 4
.type x,@object
.size x,8
.comm x,8
.globl B
.align 4
.type B,@object
.size B,4
.comm B,4
.globl A
.align 4
.type A,@object
.size A,4
.comm A,4
.globl n
.align 4
.type n,@object
.size n,4
.comm n,4
.globl m
.align 4
.type m,@object
.size m,4
.comm m,4
.globl k
.align 4
.type k,@object
.size k,4
.comm k,4
.globl j
.align 4
.type j,@object
.size j,4
.comm j,4
.globl i
.align 4
.type i,@object
.size i,4
.comm i,4
.globl b
.align 4
.type b,@object
.size b,80
.comm b,80
.globl a
.align 4
.type a,@object
.size a,80
.comm a,80
.data
.align 4
.LC19:
.long 0
.long 0
.text
.ident "LCC: 4.1"

View file

@ -0,0 +1,6 @@
test 1
test 2
test 3
test 4
test 5.000000
{1 2 3 4} {1 2 3 4} {1 2 3 4} {1 2 3 4} {1 2 3 4} {1 2 3 4}

View file

@ -0,0 +1 @@
tst/stdarg.c:51: warning: missing return value

View file

@ -0,0 +1,395 @@
.data
.globl x
.align 4
.type x,@object
.size x,16
x:
.long 1
.long 2
.long 3
.long 4
.globl main
.text
.align 16
.type main,@function
main:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $8,%esp
pushl $.LC2
call print
addl $4,%esp
pushl $.LC4
pushl $.LC3
call print
addl $8,%esp
pushl $10
pushl $3
pushl $.LC5
call print
addl $12,%esp
pushl $10
pushl $4
pushl $.LC8
pushl $.LC7
pushl $.LC6
call print
addl $20,%esp
pushl $10
fldl .LC10
subl $8,%esp
fstpl (%esp)
pushl $.LC8
pushl $.LC7
pushl $.LC9
call print
addl $24,%esp
leal x,%edi
movl %edi,-8(%ebp)
movl %edi,%esi
movl %esi,-4(%ebp)
subl $16,%esp
movl %esp,%edi
movl $16,%ecx
rep
movsb
movl -8(%ebp),%edi
movl %edi,%esi
subl $16,%esp
movl %esp,%edi
movl $16,%ecx
rep
movsb
movl -8(%ebp),%edi
movl %edi,%esi
subl $16,%esp
movl %esp,%edi
movl $16,%ecx
rep
movsb
movl -8(%ebp),%edi
movl %edi,%esi
subl $16,%esp
movl %esp,%edi
movl $16,%ecx
rep
movsb
movl -8(%ebp),%edi
movl %edi,%esi
subl $16,%esp
movl %esp,%edi
movl $16,%ecx
rep
movsb
movl -8(%ebp),%edi
movl %edi,%esi
subl $16,%esp
movl %esp,%edi
movl $16,%ecx
rep
movsb
pushl $.LC11
call print
addl $100,%esp
movl $0,%eax
.LC1:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf12:
.size main,.Lf12-main
.globl print
.align 16
.type print,@function
print:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $28,%esp
leal 24(%ebp),%edi
movl %edi,-4(%ebp)
jmp .LC19
.LC16:
movl 20(%ebp),%edi
movsbl (,%edi),%edi
cmpl $37,%edi
jne .LC20
movl 20(%ebp),%edi
leal 1(%edi),%edi
movl %edi,20(%ebp)
movsbl (,%edi),%edi
movl %edi,-8(%ebp)
movl -8(%ebp),%edi
cmpl $115,%edi
je .LC36
cmpl $115,%edi
jg .LC41
.LC40:
movl -8(%ebp),%edi
cmpl $98,%edi
jl .LC22
cmpl $102,%edi
jg .LC22
jmp *.LC42-392(,%edi,4)
.data
.align 4
.LC42:
.long .LC25
.long .LC30
.long .LC32
.long .LC22
.long .LC38
.text
.LC41:
cmpl $119,-8(%ebp)
je .LC34
jmp .LC22
.LC25:
movl -4(%ebp),%edi
leal 16(%edi),%edi
movl %edi,-28(%ebp)
movl %edi,-4(%ebp)
leal -24(%ebp),%edi
movl -28(%ebp),%esi
leal -16(%esi),%esi
movl $16,%ecx
rep
movsb
pushl -12(%ebp)
pushl -16(%ebp)
pushl -20(%ebp)
pushl -24(%ebp)
pushl $.LC26
call printf
addl $20,%esp
jmp .LC21
.LC30:
movl -4(%ebp),%edi
leal 4(%edi),%edi
movl %edi,-4(%ebp)
movsbl -4(%edi),%edi
pushl %edi
pushl $.LC31
call printf
addl $8,%esp
jmp .LC21
.LC32:
movl -4(%ebp),%edi
leal 4(%edi),%edi
movl %edi,-4(%ebp)
pushl -4(%edi)
pushl $.LC33
call printf
addl $8,%esp
jmp .LC21
.LC34:
movl -4(%ebp),%edi
leal 4(%edi),%edi
movl %edi,-4(%ebp)
movswl -4(%edi),%edi
pushl %edi
pushl $.LC35
call printf
addl $8,%esp
jmp .LC21
.LC36:
movl -4(%ebp),%edi
leal 4(%edi),%edi
movl %edi,-4(%ebp)
pushl -4(%edi)
pushl $.LC37
call printf
addl $8,%esp
jmp .LC21
.LC38:
movl -4(%ebp),%edi
leal 8(%edi),%edi
movl %edi,-4(%ebp)
fldl -8(%edi)
subl $8,%esp
fstpl (%esp)
pushl $.LC39
call printf
addl $12,%esp
jmp .LC21
.LC22:
movl 20(%ebp),%edi
movsbl (,%edi),%edi
pushl %edi
pushl $.LC31
call printf
addl $8,%esp
jmp .LC21
.LC20:
movl 20(%ebp),%edi
movsbl (,%edi),%edi
pushl %edi
pushl $.LC31
call printf
addl $8,%esp
.LC21:
.LC17:
incl 20(%ebp)
.LC19:
movl 20(%ebp),%edi
movsbl (,%edi),%edi
cmpl $0,%edi
jne .LC16
movl $0,%eax
.LC13:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf44:
.size print,.Lf44-print
.data
.align 1
.LC39:
.byte 37
.byte 102
.byte 0
.align 1
.LC37:
.byte 37
.byte 115
.byte 0
.align 1
.LC35:
.byte 37
.byte 120
.byte 0
.align 1
.LC33:
.byte 37
.byte 100
.byte 0
.align 1
.LC31:
.byte 37
.byte 99
.byte 0
.align 1
.LC26:
.byte 123
.byte 37
.byte 100
.byte 32
.byte 37
.byte 100
.byte 32
.byte 37
.byte 100
.byte 32
.byte 37
.byte 100
.byte 125
.byte 0
.align 1
.LC11:
.byte 37
.byte 98
.byte 32
.byte 37
.byte 98
.byte 32
.byte 37
.byte 98
.byte 32
.byte 37
.byte 98
.byte 32
.byte 37
.byte 98
.byte 32
.byte 37
.byte 98
.byte 10
.byte 0
.align 4
.LC10:
.long 0
.long 1075052544
.align 1
.LC9:
.byte 37
.byte 115
.byte 37
.byte 115
.byte 32
.byte 37
.byte 102
.byte 37
.byte 99
.byte 0
.align 1
.LC8:
.byte 115
.byte 116
.byte 0
.align 1
.LC7:
.byte 116
.byte 101
.byte 0
.align 1
.LC6:
.byte 37
.byte 115
.byte 37
.byte 115
.byte 32
.byte 37
.byte 119
.byte 37
.byte 99
.byte 0
.align 1
.LC5:
.byte 116
.byte 101
.byte 115
.byte 116
.byte 32
.byte 37
.byte 100
.byte 37
.byte 99
.byte 0
.align 1
.LC4:
.byte 50
.byte 0
.align 1
.LC3:
.byte 116
.byte 101
.byte 115
.byte 116
.byte 32
.byte 37
.byte 115
.byte 10
.byte 0
.align 1
.LC2:
.byte 116
.byte 101
.byte 115
.byte 116
.byte 32
.byte 49
.byte 10
.byte 0
.text
.ident "LCC: 4.1"

View file

@ -0,0 +1,5 @@
(-1,-1) is not within [10,10; 310,310]
(1,1) is not within [10,10; 310,310]
(20,300) is within [10,10; 310,310]
(500,400) is not within [10,10; 310,310]
ab

View file

@ -0,0 +1,2 @@
tst/struct.c:49: warning: missing return value
tst/struct.c:68: warning: missing return value

View file

@ -0,0 +1,477 @@
.globl addpoint
.text
.align 16
.type addpoint,@function
addpoint:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl 32(%ebp),%edi
addl %edi,24(%ebp)
movl 36(%ebp),%edi
addl %edi,28(%ebp)
movl 20(%ebp),%edi
leal 24(%ebp),%esi
movl $8,%ecx
rep
movsb
.LC1:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf5:
.size addpoint,.Lf5-addpoint
.globl canonrect
.align 16
.type canonrect,@function
canonrect:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $32,%esp
movl 32(%ebp),%edi
cmpl %edi,24(%ebp)
jge .LC11
movl 24(%ebp),%edi
movl %edi,-20(%ebp)
jmp .LC12
.LC11:
movl 32(%ebp),%edi
movl %edi,-20(%ebp)
.LC12:
movl -20(%ebp),%edi
movl %edi,-16(%ebp)
movl 36(%ebp),%edi
cmpl %edi,28(%ebp)
jge .LC21
movl 28(%ebp),%edi
movl %edi,-24(%ebp)
jmp .LC22
.LC21:
movl 36(%ebp),%edi
movl %edi,-24(%ebp)
.LC22:
movl -24(%ebp),%edi
movl %edi,-12(%ebp)
movl 32(%ebp),%edi
cmpl %edi,24(%ebp)
jle .LC27
movl 24(%ebp),%edi
movl %edi,-28(%ebp)
jmp .LC28
.LC27:
movl 32(%ebp),%edi
movl %edi,-28(%ebp)
.LC28:
movl -28(%ebp),%edi
movl %edi,-8(%ebp)
movl 36(%ebp),%edi
cmpl %edi,28(%ebp)
jle .LC38
movl 28(%ebp),%edi
movl %edi,-32(%ebp)
jmp .LC39
.LC38:
movl 36(%ebp),%edi
movl %edi,-32(%ebp)
.LC39:
movl -32(%ebp),%edi
movl %edi,-4(%ebp)
movl 20(%ebp),%edi
leal -16(%ebp),%esi
movl $16,%ecx
rep
movsb
.LC6:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf40:
.size canonrect,.Lf40-canonrect
.globl makepoint
.align 16
.type makepoint,@function
makepoint:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $8,%esp
movl 24(%ebp),%edi
movl %edi,-8(%ebp)
movl 28(%ebp),%edi
movl %edi,-4(%ebp)
movl 20(%ebp),%edi
leal -8(%ebp),%esi
movl $8,%ecx
rep
movsb
.LC41:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf44:
.size makepoint,.Lf44-makepoint
.globl makerect
.align 16
.type makerect,@function
makerect:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $16,%esp
leal -16(%ebp),%edi
leal 24(%ebp),%esi
movl $8,%ecx
rep
movsb
leal -8(%ebp),%edi
leal 32(%ebp),%esi
movl $8,%ecx
rep
movsb
leal -16(%ebp),%esi
subl $16,%esp
movl %esp,%edi
movl $16,%ecx
rep
movsb
pushl 20(%ebp)
call canonrect
addl $20,%esp
.LC45:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf48:
.size makerect,.Lf48-makerect
.globl ptinrect
.align 16
.type ptinrect,@function
ptinrect:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $4,%esp
movl 20(%ebp),%edi
cmpl 28(%ebp),%edi
jl .LC57
cmpl 36(%ebp),%edi
jge .LC57
movl 32(%ebp),%edi
cmpl %edi,24(%ebp)
jl .LC57
movl 40(%ebp),%edi
cmpl %edi,24(%ebp)
jge .LC57
movl $1,-4(%ebp)
jmp .LC58
.LC57:
movl $0,-4(%ebp)
.LC58:
movl -4(%ebp),%eax
.LC49:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf59:
.size ptinrect,.Lf59-ptinrect
.data
.globl y
.align 4
.type y,@object
.size y,4
y:
.byte 97
.byte 98
.byte 0
.space 1
.globl odd
.text
.align 16
.type odd,@function
odd:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $4,%esp
leal -4(%ebp),%edi
leal 20(%ebp),%esi
movl $4,%ecx
rep
movsb
leal -4(%ebp),%edi
pushl %edi
pushl $.LC61
call printf
addl $8,%esp
movl $0,%eax
.LC60:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf62:
.size odd,.Lf62-odd
.data
.align 4
.LC64:
.long 0
.long 0
.align 4
.LC65:
.long 320
.long 320
.align 4
.LC66:
.long -1
.long -1
.long 1
.long 1
.long 20
.long 300
.long 500
.long 400
.globl main
.text
.align 16
.type main,@function
main:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $108,%esp
leal -68(%ebp),%edi
leal .LC64,%esi
movl $8,%ecx
rep
movsb
leal -76(%ebp),%edi
leal .LC65,%esi
movl $8,%ecx
rep
movsb
leal -36(%ebp),%edi
leal .LC66,%esi
movl $32,%ecx
rep
movsb
pushl $-10
pushl $-10
leal -84(%ebp),%edi
pushl %edi
call makepoint
addl $12,%esp
leal -84(%ebp),%esi
subl $8,%esp
movl %esp,%edi
movl $8,%ecx
rep
movsb
leal -76(%ebp),%esi
subl $8,%esp
movl %esp,%edi
movl $8,%ecx
rep
movsb
leal -92(%ebp),%edi
pushl %edi
call addpoint
addl $20,%esp
pushl $10
pushl $10
leal -100(%ebp),%edi
pushl %edi
call makepoint
addl $12,%esp
leal -100(%ebp),%esi
subl $8,%esp
movl %esp,%edi
movl $8,%ecx
rep
movsb
leal -68(%ebp),%esi
subl $8,%esp
movl %esp,%edi
movl $8,%ecx
rep
movsb
leal -108(%ebp),%edi
pushl %edi
call addpoint
addl $20,%esp
leal -108(%ebp),%esi
subl $8,%esp
movl %esp,%edi
movl $8,%ecx
rep
movsb
leal -92(%ebp),%esi
subl $8,%esp
movl %esp,%edi
movl $8,%ecx
rep
movsb
leal -52(%ebp),%edi
pushl %edi
call makerect
addl $20,%esp
movl $0,-4(%ebp)
jmp .LC70
.LC67:
movl -4(%ebp),%edi
leal (,%edi,8),%edi
leal -32(%ebp),%esi
pushl (%esi,%edi)
leal -36(%ebp),%esi
pushl (%esi,%edi)
leal -60(%ebp),%edi
pushl %edi
call makepoint
addl $12,%esp
pushl -56(%ebp)
movl -4(%ebp),%edi
leal -36(%ebp),%esi
pushl (%esi,%edi,8)
pushl $.LC71
call printf
addl $12,%esp
leal -52(%ebp),%esi
subl $16,%esp
movl %esp,%edi
movl $16,%ecx
rep
movsb
leal -60(%ebp),%esi
subl $8,%esp
movl %esp,%edi
movl $8,%ecx
rep
movsb
call ptinrect
addl $24,%esp
cmpl $0,%eax
jne .LC74
pushl $.LC76
call printf
addl $4,%esp
.LC74:
pushl -40(%ebp)
pushl -44(%ebp)
pushl -48(%ebp)
pushl -52(%ebp)
pushl $.LC77
call printf
addl $20,%esp
.LC68:
incl -4(%ebp)
.LC70:
movl -4(%ebp),%edi
cmpl $4,%edi
jb .LC67
leal y,%esi
subl $4,%esp
movl %esp,%edi
movl $4,%ecx
rep
movsb
call odd
addl $4,%esp
pushl $0
call exit
addl $4,%esp
movl $0,%eax
.LC63:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf82:
.size main,.Lf82-main
.data
.align 1
.LC77:
.byte 119
.byte 105
.byte 116
.byte 104
.byte 105
.byte 110
.byte 32
.byte 91
.byte 37
.byte 100
.byte 44
.byte 37
.byte 100
.byte 59
.byte 32
.byte 37
.byte 100
.byte 44
.byte 37
.byte 100
.byte 93
.byte 10
.byte 0
.align 1
.LC76:
.byte 110
.byte 111
.byte 116
.byte 32
.byte 0
.align 1
.LC71:
.byte 40
.byte 37
.byte 100
.byte 44
.byte 37
.byte 100
.byte 41
.byte 32
.byte 105
.byte 115
.byte 32
.byte 0
.align 1
.LC61:
.byte 37
.byte 115
.byte 10
.byte 0
.text
.ident "LCC: 4.1"

View file

@ -0,0 +1,76 @@
b = 0x8
f = 0xc
n = 0xa
r = 0xd
t = 0x9
v = 0xb
x = 0x78
f:
x = 0
x = 1
x = 2
x = 2
x = 2
x = 2
x = 2
x = 7
x = 8
x = 9
x = 9
x = 9
x = 9
x = 9
x = 9
x = 9
x = 16
x = 17
x = 18
x = 19
x = 20
g:
1 1
1 2
2 3
2 4
2 5
3 6
d 6
3 7
d 7
3 8
d 8
d 9
d 10
h:
i = 8
i = 16
i = 120
i = 128
i = 248
i = 264
i = 272
i = 280
i = 288
i = 296
i = 304
i = 312
488 defaults
x = 0x1000000
x = 0x2000000
x = 0x3000000
x = 0x4000000
x = 0x5000000
x = 0x6000000 (default)
x = 0x7000000 (default)
0
1
2
3
4
5
0
1
2
3
4
5

View file

@ -0,0 +1,5 @@
tst/switch.c:55: warning: missing return value
tst/switch.c:73: warning: missing return value
tst/switch.c:97: warning: missing return value
tst/switch.c:112: warning: missing return value
tst/switch.c:137: warning: missing return value

View file

@ -0,0 +1,899 @@
.globl main
.text
.align 16
.type main,@function
main:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $8,%esp
leal .LC6,%edi
movl %edi,-4(%ebp)
jmp .LC5
.LC2:
movl -4(%ebp),%edi
movsbl (,%edi),%edi
pushl %edi
call backslash
addl $4,%esp
pushl %eax
movl -4(%ebp),%edi
movsbl (,%edi),%edi
pushl %edi
pushl $.LC7
call printf
addl $12,%esp
.LC3:
incl -4(%ebp)
.LC5:
movl -4(%ebp),%edi
movsbl (,%edi),%edi
cmpl $0,%edi
jne .LC2
call f
call g
call h
movl $16777216,-8(%ebp)
jmp .LC11
.LC8:
pushl -8(%ebp)
call big
addl $4,%esp
.LC9:
addl $16777216,-8(%ebp)
.LC11:
movl -8(%ebp),%edi
andl $117440512,%edi
cmpl $0,%edi
jne .LC8
call limit
movl $0,%eax
.LC1:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf12:
.size main,.Lf12-main
.globl backslash
.align 16
.type backslash,@function
backslash:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl 20(%ebp),%edi
cmpl $102,%edi
je .LC17
cmpl $102,%edi
jg .LC23
.LC22:
cmpl $98,20(%ebp)
je .LC16
jmp .LC14
.LC23:
movl 20(%ebp),%edi
cmpl $110,%edi
je .LC18
cmpl $110,%edi
jl .LC14
.LC24:
movl 20(%ebp),%edi
cmpl $114,%edi
je .LC19
cmpl $116,%edi
je .LC20
cmpl $118,%edi
je .LC21
jmp .LC14
.LC16:
movl $8,%eax
jmp .LC13
.LC17:
movl $12,%eax
jmp .LC13
.LC18:
movl $10,%eax
jmp .LC13
.LC19:
movl $13,%eax
jmp .LC13
.LC20:
movl $9,%eax
jmp .LC13
.LC21:
movl $11,%eax
jmp .LC13
.LC14:
movl 20(%ebp),%eax
.LC13:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf25:
.size backslash,.Lf25-backslash
.globl f
.align 16
.type f,@function
f:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $12,%esp
movl $0,-8(%ebp)
pushl $.LC27
call printf
addl $4,%esp
movl $0,-4(%ebp)
.LC28:
movl -4(%ebp),%edi
movl %edi,-12(%ebp)
movl -4(%ebp),%edi
cmpl $1,%edi
jl .LC32
cmpl $20,%edi
jg .LC32
jmp *.LC44-4(,%edi,4)
.data
.align 4
.LC44:
.long .LC34
.long .LC35
.long .LC32
.long .LC32
.long .LC32
.long .LC32
.long .LC36
.long .LC37
.long .LC38
.long .LC32
.long .LC32
.long .LC32
.long .LC32
.long .LC32
.long .LC32
.long .LC39
.long .LC40
.long .LC41
.long .LC42
.long .LC43
.text
.LC34:
movl -4(%ebp),%edi
movl %edi,-8(%ebp)
jmp .LC33
.LC35:
movl -4(%ebp),%edi
movl %edi,-8(%ebp)
jmp .LC33
.LC36:
movl -4(%ebp),%edi
movl %edi,-8(%ebp)
jmp .LC33
.LC37:
movl -4(%ebp),%edi
movl %edi,-8(%ebp)
jmp .LC33
.LC38:
movl -4(%ebp),%edi
movl %edi,-8(%ebp)
jmp .LC33
.LC39:
movl -4(%ebp),%edi
movl %edi,-8(%ebp)
jmp .LC33
.LC40:
movl -4(%ebp),%edi
movl %edi,-8(%ebp)
jmp .LC33
.LC41:
movl -4(%ebp),%edi
movl %edi,-8(%ebp)
jmp .LC33
.LC42:
movl -4(%ebp),%edi
movl %edi,-8(%ebp)
jmp .LC33
.LC43:
movl -4(%ebp),%edi
movl %edi,-8(%ebp)
.LC32:
.LC33:
pushl -8(%ebp)
pushl $.LC46
call printf
addl $8,%esp
.LC29:
incl -4(%ebp)
cmpl $20,-4(%ebp)
jle .LC28
movl $0,%eax
.LC26:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf47:
.size f,.Lf47-f
.globl g
.align 16
.type g,@function
g:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $4,%esp
pushl $.LC49
call printf
addl $4,%esp
movl $1,-4(%ebp)
.LC50:
movl -4(%ebp),%edi
cmpl $1001,%edi
jl .LC67
cmpl $1004,%edi
jg .LC68
jmp *.LC69-4004(,%edi,4)
.data
.align 4
.LC69:
.long .LC63
.long .LC63
.long .LC63
.long .LC63
.text
.LC67:
movl -4(%ebp),%edi
cmpl $1,%edi
jl .LC54
cmpl $8,%edi
jg .LC54
jmp *.LC71-4(,%edi,4)
.data
.align 4
.LC71:
.long .LC56
.long .LC56
.long .LC58
.long .LC58
.long .LC58
.long .LC60
.long .LC60
.long .LC60
.text
.LC68:
movl -4(%ebp),%edi
cmpl $3001,%edi
jl .LC54
cmpl $3004,%edi
jg .LC54
jmp *.LC73-12004(,%edi,4)
.data
.align 4
.LC73:
.long .LC65
.long .LC65
.long .LC65
.long .LC65
.text
.LC56:
pushl -4(%ebp)
pushl $.LC57
call printf
addl $8,%esp
jmp .LC55
.LC58:
pushl -4(%ebp)
pushl $.LC59
call printf
addl $8,%esp
jmp .LC55
.LC60:
pushl -4(%ebp)
pushl $.LC61
call printf
addl $8,%esp
.LC54:
pushl -4(%ebp)
pushl $.LC62
call printf
addl $8,%esp
jmp .LC55
.LC63:
pushl -4(%ebp)
pushl $.LC64
call printf
addl $8,%esp
jmp .LC55
.LC65:
pushl -4(%ebp)
pushl $.LC66
call printf
addl $8,%esp
.LC55:
.LC51:
incl -4(%ebp)
cmpl $10,-4(%ebp)
jle .LC50
movl $0,%eax
.LC48:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf75:
.size g,.Lf75-g
.globl h
.align 16
.type h,@function
h:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $8,%esp
movl $0,-8(%ebp)
pushl $.LC77
call printf
addl $4,%esp
movl $1,-4(%ebp)
.LC78:
movl -4(%ebp),%edi
cmpl $264,%edi
je .LC90
cmpl $264,%edi
jg .LC98
.LC97:
movl -4(%ebp),%edi
cmpl $120,%edi
je .LC88
cmpl $120,%edi
jg .LC100
.LC99:
movl -4(%ebp),%edi
cmpl $8,%edi
je .LC87
cmpl $8,%edi
jl .LC82
.LC101:
cmpl $16,-4(%ebp)
je .LC86
jmp .LC82
.LC100:
movl -4(%ebp),%edi
cmpl $128,%edi
je .LC84
cmpl $128,%edi
jl .LC82
.LC102:
cmpl $248,-4(%ebp)
je .LC91
jmp .LC82
.LC98:
movl -4(%ebp),%edi
cmpl $288,%edi
je .LC95
cmpl $288,%edi
jg .LC104
.LC103:
movl -4(%ebp),%edi
cmpl $272,%edi
je .LC92
cmpl $272,%edi
jl .LC82
.LC105:
cmpl $280,-4(%ebp)
je .LC89
jmp .LC82
.LC104:
movl -4(%ebp),%edi
cmpl $304,%edi
je .LC93
cmpl $304,%edi
jg .LC107
.LC106:
cmpl $296,-4(%ebp)
je .LC94
jmp .LC82
.LC107:
cmpl $312,-4(%ebp)
je .LC96
jmp .LC82
.LC82:
incl -8(%ebp)
jmp .LC79
.LC84:
pushl -4(%ebp)
pushl $.LC85
call printf
addl $8,%esp
jmp .LC83
.LC86:
pushl -4(%ebp)
pushl $.LC85
call printf
addl $8,%esp
jmp .LC83
.LC87:
pushl -4(%ebp)
pushl $.LC85
call printf
addl $8,%esp
jmp .LC83
.LC88:
pushl -4(%ebp)
pushl $.LC85
call printf
addl $8,%esp
jmp .LC83
.LC89:
pushl -4(%ebp)
pushl $.LC85
call printf
addl $8,%esp
jmp .LC83
.LC90:
pushl -4(%ebp)
pushl $.LC85
call printf
addl $8,%esp
jmp .LC83
.LC91:
pushl -4(%ebp)
pushl $.LC85
call printf
addl $8,%esp
jmp .LC83
.LC92:
pushl -4(%ebp)
pushl $.LC85
call printf
addl $8,%esp
jmp .LC83
.LC93:
pushl -4(%ebp)
pushl $.LC85
call printf
addl $8,%esp
jmp .LC83
.LC94:
pushl -4(%ebp)
pushl $.LC85
call printf
addl $8,%esp
jmp .LC83
.LC95:
pushl -4(%ebp)
pushl $.LC85
call printf
addl $8,%esp
jmp .LC83
.LC96:
pushl -4(%ebp)
pushl $.LC85
call printf
addl $8,%esp
.LC83:
.LC79:
incl -4(%ebp)
cmpl $500,-4(%ebp)
jle .LC78
pushl -8(%ebp)
pushl $.LC108
call printf
addl $8,%esp
movl $0,%eax
.LC76:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf109:
.size h,.Lf109-h
.globl big
.align 16
.type big,@function
big:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $4,%esp
movl 20(%ebp),%edi
andl $0x6000000,%edi
movl %edi,-4(%ebp)
movl -4(%ebp),%edi
cmpl $33554432,%edi
je .LC116
cmpl $33554432,%edi
jg .LC120
.LC119:
movl -4(%ebp),%edi
cmpl $-2,%edi
je .LC114
cmpl $-1,%edi
je .LC114
cmpl $0,%edi
je .LC114
jmp .LC111
.LC120:
movl -4(%ebp),%edi
cmpl $67108864,%edi
je .LC117
jmp .LC111
.LC114:
pushl 20(%ebp)
pushl $.LC115
call printf
addl $8,%esp
jmp .LC112
.LC116:
pushl 20(%ebp)
pushl $.LC115
call printf
addl $8,%esp
jmp .LC112
.LC117:
pushl 20(%ebp)
pushl $.LC115
call printf
addl $8,%esp
jmp .LC112
.LC111:
pushl 20(%ebp)
pushl $.LC118
call printf
addl $8,%esp
.LC112:
movl $0,%eax
.LC110:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf121:
.size big,.Lf121-big
.globl limit
.align 16
.type limit,@function
limit:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $4,%esp
movl $-2147483648,-4(%ebp)
.LC123:
movl -4(%ebp),%edi
movl $-2147483648,%esi
cmpl $-2147483648,%edi
jl .LC127
cmpl $-2147483644,%edi
jg .LC127
leal (,%edi,4),%edi
leal (,%esi,4),%esi
subl %esi,%edi
jmp *.LC140(%edi)
.data
.align 4
.LC140:
.long .LC129
.long .LC131
.long .LC133
.long .LC135
.long .LC137
.text
.LC129:
pushl $.LC130
call printf
addl $4,%esp
jmp .LC128
.LC131:
pushl $.LC132
call printf
addl $4,%esp
jmp .LC128
.LC133:
pushl $.LC134
call printf
addl $4,%esp
jmp .LC128
.LC135:
pushl $.LC136
call printf
addl $4,%esp
jmp .LC128
.LC137:
pushl $.LC138
call printf
addl $4,%esp
jmp .LC128
.LC127:
pushl $.LC139
call printf
addl $4,%esp
.LC128:
.LC124:
incl -4(%ebp)
cmpl $-2147483643,-4(%ebp)
jle .LC123
movl $2147483647,-4(%ebp)
.LC141:
movl -4(%ebp),%edi
movl $2147483643,%esi
cmpl $2147483643,%edi
jl .LC145
cmpl $2147483647,%edi
jg .LC145
leal (,%edi,4),%edi
leal (,%esi,4),%esi
subl %esi,%edi
jmp *.LC152(%edi)
.data
.align 4
.LC152:
.long .LC151
.long .LC150
.long .LC149
.long .LC148
.long .LC147
.text
.LC147:
pushl $.LC130
call printf
addl $4,%esp
jmp .LC146
.LC148:
pushl $.LC132
call printf
addl $4,%esp
jmp .LC146
.LC149:
pushl $.LC134
call printf
addl $4,%esp
jmp .LC146
.LC150:
pushl $.LC136
call printf
addl $4,%esp
jmp .LC146
.LC151:
pushl $.LC138
call printf
addl $4,%esp
jmp .LC146
.LC145:
pushl $.LC139
call printf
addl $4,%esp
.LC146:
.LC142:
decl -4(%ebp)
cmpl $2147483642,-4(%ebp)
jge .LC141
movl $0,%eax
.LC122:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf153:
.size limit,.Lf153-limit
.data
.align 1
.LC139:
.byte 53
.byte 10
.byte 0
.align 1
.LC138:
.byte 52
.byte 10
.byte 0
.align 1
.LC136:
.byte 51
.byte 10
.byte 0
.align 1
.LC134:
.byte 50
.byte 10
.byte 0
.align 1
.LC132:
.byte 49
.byte 10
.byte 0
.align 1
.LC130:
.byte 48
.byte 10
.byte 0
.align 1
.LC118:
.byte 120
.byte 32
.byte 61
.byte 32
.byte 48
.byte 120
.byte 37
.byte 120
.byte 32
.byte 40
.byte 100
.byte 101
.byte 102
.byte 97
.byte 117
.byte 108
.byte 116
.byte 41
.byte 10
.byte 0
.align 1
.LC115:
.byte 120
.byte 32
.byte 61
.byte 32
.byte 48
.byte 120
.byte 37
.byte 120
.byte 10
.byte 0
.align 1
.LC108:
.byte 37
.byte 100
.byte 32
.byte 100
.byte 101
.byte 102
.byte 97
.byte 117
.byte 108
.byte 116
.byte 115
.byte 10
.byte 0
.align 1
.LC85:
.byte 105
.byte 32
.byte 61
.byte 32
.byte 37
.byte 100
.byte 10
.byte 0
.align 1
.LC77:
.byte 104
.byte 58
.byte 10
.byte 0
.align 1
.LC66:
.byte 54
.byte 32
.byte 37
.byte 100
.byte 10
.byte 0
.align 1
.LC64:
.byte 53
.byte 32
.byte 37
.byte 100
.byte 10
.byte 0
.align 1
.LC62:
.byte 100
.byte 32
.byte 37
.byte 100
.byte 10
.byte 0
.align 1
.LC61:
.byte 51
.byte 32
.byte 37
.byte 100
.byte 10
.byte 0
.align 1
.LC59:
.byte 50
.byte 32
.byte 37
.byte 100
.byte 10
.byte 0
.align 1
.LC57:
.byte 49
.byte 32
.byte 37
.byte 100
.byte 10
.byte 0
.align 1
.LC49:
.byte 103
.byte 58
.byte 10
.byte 0
.align 1
.LC46:
.byte 120
.byte 32
.byte 61
.byte 32
.byte 37
.byte 100
.byte 10
.byte 0
.align 1
.LC27:
.byte 102
.byte 58
.byte 10
.byte 0
.align 1
.LC7:
.byte 37
.byte 99
.byte 32
.byte 61
.byte 32
.byte 48
.byte 120
.byte 37
.byte 120
.byte 10
.byte 0
.align 1
.LC6:
.byte 98
.byte 102
.byte 110
.byte 114
.byte 116
.byte 118
.byte 120
.byte 0
.text
.ident "LCC: 4.1"

View file

@ -0,0 +1,74 @@
5 a
2 and
5 buf
16 c
8 char
1 compare
4 cond
5 count
1 d
1 die
3 else
1 entry
1 eof
4 err
1 error
1 exit
1 folded
1 for
1 free
1 frequencies
1 frequency
1 get
2 getchar
3 getword
14 if
2 in
1 index
1 input
1 install
8 int
1 into
1 is
4 isletter
1 it
1 itself
5 left
1 letter
7 lookup
1 main
2 malloc
1 message
2 n
1 necessary
12 next
9 node
4 of
1 on
1 or
1 otherwise
2 out
8 p
3 print
2 printf
16 return
5 right
4 root
25 s
2 storage
3 strcmp
1 strcpy
1 strlen
8 struct
1 structures
2 subtree
1 t
5 tprint
9 tree
1 uses
1 version
1 wf
3 while
21 word
9 words
2 z

View file

@ -0,0 +1,2 @@
tst/wf1.c:29: warning: missing return value
tst/wf1.c:87: warning: missing return value

View file

@ -0,0 +1,437 @@
.globl main
.text
.align 16
.type main,@function
main:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $24,%esp
movl $0,-24(%ebp)
movl $0,next
jmp .LC3
.LC2:
leal -24(%ebp),%edi
pushl %edi
leal -20(%ebp),%edi
pushl %edi
call lookup
addl $8,%esp
incl (,%eax)
.LC3:
leal -20(%ebp),%edi
pushl %edi
call getword
addl $4,%esp
cmpl $0,%eax
jne .LC2
pushl -24(%ebp)
call tprint
addl $4,%esp
movl $0,%eax
.LC1:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf5:
.size main,.Lf5-main
.globl err
.align 16
.type err,@function
err:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
pushl 20(%ebp)
pushl $.LC7
call printf
addl $8,%esp
pushl $1
call exit
addl $4,%esp
movl $0,%eax
.LC6:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf8:
.size err,.Lf8-err
.globl getword
.align 16
.type getword,@function
getword:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $8,%esp
.LC10:
.LC11:
call getchar
movl %eax,%edi
movl %edi,-4(%ebp)
cmpl $-1,%edi
je .LC13
pushl -4(%ebp)
call isletter
addl $4,%esp
cmpl $0,%eax
je .LC10
.LC13:
movl 20(%ebp),%edi
movl %edi,-8(%ebp)
jmp .LC17
.LC14:
movl -8(%ebp),%edi
leal 1(%edi),%esi
movl %esi,-8(%ebp)
movl -4(%ebp),%esi
movl %esi,%ebx
movb %bl,(,%edi)
.LC15:
call getchar
movl %eax,-4(%ebp)
.LC17:
pushl -4(%ebp)
call isletter
addl $4,%esp
movl %eax,-4(%ebp)
cmpl $0,%eax
jne .LC14
movl -8(%ebp),%edi
movb $0,(,%edi)
movl -8(%ebp),%edi
movl 20(%ebp),%esi
cmpl %esi,%edi
jbe .LC18
movl $1,%eax
jmp .LC9
.LC18:
movl $0,%eax
.LC9:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf20:
.size getword,.Lf20-getword
.globl isletter
.align 16
.type isletter,@function
isletter:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl 20(%ebp),%edi
cmpl $65,%edi
jl .LC22
cmpl $90,%edi
jg .LC22
addl $32,20(%ebp)
.LC22:
movl 20(%ebp),%edi
cmpl $97,%edi
jl .LC24
cmpl $122,%edi
jg .LC24
movl 20(%ebp),%eax
jmp .LC21
.LC24:
movl $0,%eax
.LC21:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf26:
.size isletter,.Lf26-isletter
.globl lookup
.align 16
.type lookup,@function
lookup:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $4,%esp
movl 24(%ebp),%edi
movl (,%edi),%edi
cmpl $0,%edi
je .LC28
movl 24(%ebp),%edi
movl (,%edi),%edi
pushl 12(%edi)
pushl 20(%ebp)
call strcmp
addl $8,%esp
movl %eax,-4(%ebp)
cmpl $0,-4(%ebp)
jge .LC30
movl 24(%ebp),%edi
movl (,%edi),%edi
leal 4(%edi),%edi
pushl %edi
pushl 20(%ebp)
call lookup
addl $8,%esp
movl %eax,%edi
jmp .LC27
.LC30:
cmpl $0,-4(%ebp)
jle .LC32
movl 24(%ebp),%edi
movl (,%edi),%edi
leal 8(%edi),%edi
pushl %edi
pushl 20(%ebp)
call lookup
addl $8,%esp
movl %eax,%edi
jmp .LC27
.LC32:
movl 24(%ebp),%edi
movl (,%edi),%eax
jmp .LC27
.LC28:
cmpl $2000,next
jl .LC34
pushl $.LC36
call err
addl $4,%esp
.LC34:
movl next,%edi
sall $4,%edi
movl $0,words(%edi)
movl next,%edi
sall $4,%edi
movl $0,words+8(%edi)
movl $0,words+4(%edi)
pushl 20(%ebp)
call strlen
addl $4,%esp
leal 1(%eax),%edi
pushl %edi
call malloc
addl $4,%esp
movl next,%esi
sall $4,%esi
movl %eax,words+12(%esi)
movl next,%edi
sall $4,%edi
movl words+12(%edi),%edi
cmpl $0,%edi
jne .LC40
pushl $.LC43
call err
addl $4,%esp
.LC40:
pushl 20(%ebp)
movl next,%edi
sall $4,%edi
pushl words+12(%edi)
call strcpy
addl $8,%esp
movl next,%edi
leal 1(%edi),%esi
movl %esi,next
sall $4,%edi
leal words(%edi),%edi
movl 24(%ebp),%esi
movl %edi,(,%esi)
movl %edi,%eax
.LC27:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf45:
.size lookup,.Lf45-lookup
.globl tprint
.align 16
.type tprint,@function
tprint:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl 20(%ebp),%edi
cmpl $0,%edi
je .LC47
movl 20(%ebp),%edi
pushl 4(%edi)
call tprint
addl $4,%esp
movl 20(%ebp),%edi
pushl 12(%edi)
pushl (,%edi)
pushl $.LC49
call printf
addl $12,%esp
movl 20(%ebp),%edi
pushl 8(%edi)
call tprint
addl $4,%esp
.LC47:
movl $0,%eax
.LC46:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf50:
.size tprint,.Lf50-tprint
.globl strcmp
.align 16
.type strcmp,@function
strcmp:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
jmp .LC53
.LC52:
movl 20(%ebp),%edi
leal 1(%edi),%esi
movl %esi,20(%ebp)
movsbl (,%edi),%edi
cmpl $0,%edi
jne .LC55
movl $0,%eax
jmp .LC51
.LC55:
incl 24(%ebp)
.LC53:
movl 20(%ebp),%edi
movsbl (,%edi),%edi
movl 24(%ebp),%esi
movsbl (,%esi),%esi
cmpl %esi,%edi
je .LC52
movl 20(%ebp),%edi
movsbl (,%edi),%edi
cmpl $0,%edi
jne .LC57
movl $-1,%eax
jmp .LC51
.LC57:
movl 24(%ebp),%edi
movsbl (,%edi),%edi
cmpl $0,%edi
jne .LC59
movl $1,%eax
jmp .LC51
.LC59:
movl 20(%ebp),%edi
movsbl (,%edi),%edi
movl 24(%ebp),%esi
movsbl (,%esi),%esi
movl %edi,%eax
subl %esi,%eax
.LC51:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf61:
.size strcmp,.Lf61-strcmp
.bss
.globl next
.align 4
.type next,@object
.size next,4
.comm next,4
.globl words
.align 4
.type words,@object
.size words,32000
.comm words,32000
.data
.align 1
.LC49:
.byte 37
.byte 100
.byte 9
.byte 37
.byte 115
.byte 10
.byte 0
.align 1
.LC43:
.byte 111
.byte 117
.byte 116
.byte 32
.byte 111
.byte 102
.byte 32
.byte 119
.byte 111
.byte 114
.byte 100
.byte 32
.byte 115
.byte 116
.byte 111
.byte 114
.byte 97
.byte 103
.byte 101
.byte 0
.align 1
.LC36:
.byte 111
.byte 117
.byte 116
.byte 32
.byte 111
.byte 102
.byte 32
.byte 110
.byte 111
.byte 100
.byte 101
.byte 32
.byte 115
.byte 116
.byte 111
.byte 114
.byte 97
.byte 103
.byte 101
.byte 0
.align 1
.LC7:
.byte 63
.byte 32
.byte 37
.byte 115
.byte 10
.byte 0
.text
.ident "LCC: 4.1"

View file

@ -0,0 +1,10 @@
a
b
load
negate
push 5
c
load
multiply
add
store

View file

@ -0,0 +1,3 @@
tst/yacc.c:345: warning: missing return value
tst/yacc.c:349: warning: missing return value
tst/yacc.c:359: warning: missing return value

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,92 @@
1 5 8 6 3 7 2 4
1 6 8 3 7 4 2 5
1 7 4 6 8 2 5 3
1 7 5 8 2 4 6 3
2 4 6 8 3 1 7 5
2 5 7 1 3 8 6 4
2 5 7 4 1 8 6 3
2 6 1 7 4 8 3 5
2 6 8 3 1 4 7 5
2 7 3 6 8 5 1 4
2 7 5 8 1 4 6 3
2 8 6 1 3 5 7 4
3 1 7 5 8 2 4 6
3 5 2 8 1 7 4 6
3 5 2 8 6 4 7 1
3 5 7 1 4 2 8 6
3 5 8 4 1 7 2 6
3 6 2 5 8 1 7 4
3 6 2 7 1 4 8 5
3 6 2 7 5 1 8 4
3 6 4 1 8 5 7 2
3 6 4 2 8 5 7 1
3 6 8 1 4 7 5 2
3 6 8 1 5 7 2 4
3 6 8 2 4 1 7 5
3 7 2 8 5 1 4 6
3 7 2 8 6 4 1 5
3 8 4 7 1 6 2 5
4 1 5 8 2 7 3 6
4 1 5 8 6 3 7 2
4 2 5 8 6 1 3 7
4 2 7 3 6 8 1 5
4 2 7 3 6 8 5 1
4 2 7 5 1 8 6 3
4 2 8 5 7 1 3 6
4 2 8 6 1 3 5 7
4 6 1 5 2 8 3 7
4 6 8 2 7 1 3 5
4 6 8 3 1 7 5 2
4 7 1 8 5 2 6 3
4 7 3 8 2 5 1 6
4 7 5 2 6 1 3 8
4 7 5 3 1 6 8 2
4 8 1 3 6 2 7 5
4 8 1 5 7 2 6 3
4 8 5 3 1 7 2 6
5 1 4 6 8 2 7 3
5 1 8 4 2 7 3 6
5 1 8 6 3 7 2 4
5 2 4 6 8 3 1 7
5 2 4 7 3 8 6 1
5 2 6 1 7 4 8 3
5 2 8 1 4 7 3 6
5 3 1 6 8 2 4 7
5 3 1 7 2 8 6 4
5 3 8 4 7 1 6 2
5 7 1 3 8 6 4 2
5 7 1 4 2 8 6 3
5 7 2 4 8 1 3 6
5 7 2 6 3 1 4 8
5 7 2 6 3 1 8 4
5 7 4 1 3 8 6 2
5 8 4 1 3 6 2 7
5 8 4 1 7 2 6 3
6 1 5 2 8 3 7 4
6 2 7 1 3 5 8 4
6 2 7 1 4 8 5 3
6 3 1 7 5 8 2 4
6 3 1 8 4 2 7 5
6 3 1 8 5 2 4 7
6 3 5 7 1 4 2 8
6 3 5 8 1 4 2 7
6 3 7 2 4 8 1 5
6 3 7 2 8 5 1 4
6 3 7 4 1 8 2 5
6 4 1 5 8 2 7 3
6 4 2 8 5 7 1 3
6 4 7 1 3 5 2 8
6 4 7 1 8 2 5 3
6 8 2 4 1 7 5 3
7 1 3 8 6 4 2 5
7 2 4 1 8 5 3 6
7 2 6 3 1 4 8 5
7 3 1 6 8 5 2 4
7 3 8 2 5 1 6 4
7 4 2 5 8 1 3 6
7 4 2 8 6 1 3 5
7 5 3 1 6 8 2 4
8 2 4 1 7 5 3 6
8 2 5 3 1 7 4 6
8 3 1 6 2 5 7 4
8 4 1 3 6 2 7 5

View file

@ -0,0 +1,2 @@
tst/8q.c:30: warning: missing return value
tst/8q.c:39: warning: missing return value

View file

@ -0,0 +1,176 @@
.486
.model flat
extrn __fltused:near
extrn __ftol:near
public _main
_TEXT segment
_main:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,4
mov dword ptr (-4)[ebp],0
L2:
mov edi,dword ptr (-4)[ebp]
lea edi,[edi*4]
mov dword ptr (_down)[edi],1
mov dword ptr (_up)[edi],1
L3:
inc dword ptr (-4)[ebp]
cmp dword ptr (-4)[ebp],15
jl L2
mov dword ptr (-4)[ebp],0
L6:
mov edi,dword ptr (-4)[ebp]
mov dword ptr (_rows)[edi*4],1
L7:
inc dword ptr (-4)[ebp]
cmp dword ptr (-4)[ebp],8
jl L6
push 0
call _queens
add esp,4
mov eax,0
L1:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _queens
_queens:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,4
mov dword ptr (-4)[ebp],0
L11:
mov edi,dword ptr (-4)[ebp]
cmp dword ptr (_rows)[edi*4],0
je L15
mov esi,dword ptr (20)[ebp]
mov ebx,edi
sub ebx,esi
cmp dword ptr (_up+28)[ebx*4],0
je L15
lea edi,[esi][edi]
cmp dword ptr (_down)[edi*4],0
je L15
mov edi,dword ptr (-4)[ebp]
mov esi,dword ptr (20)[ebp]
lea ebx,[esi][edi]
mov dword ptr (_down)[ebx*4],0
mov ebx,edi
sub ebx,esi
mov dword ptr (_up+28)[ebx*4],0
mov dword ptr (_rows)[edi*4],0
mov edi,dword ptr (20)[ebp]
mov esi,dword ptr (-4)[ebp]
mov dword ptr (_x)[edi*4],esi
cmp dword ptr (20)[ebp],7
jne L19
call _print
add esp,0
jmp L20
L19:
mov edi,dword ptr (20)[ebp]
lea edi,(1)[edi]
push edi
call _queens
add esp,4
L20:
mov edi,dword ptr (-4)[ebp]
mov esi,dword ptr (20)[ebp]
lea ebx,[esi][edi]
mov dword ptr (_down)[ebx*4],1
mov ebx,edi
sub ebx,esi
mov dword ptr (_up+28)[ebx*4],1
mov dword ptr (_rows)[edi*4],1
L15:
L12:
inc dword ptr (-4)[ebp]
cmp dword ptr (-4)[ebp],8
jl L11
mov eax,0
L10:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _print
_print:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,4
mov dword ptr (-4)[ebp],0
L23:
mov edi,dword ptr (-4)[ebp]
mov edi,dword ptr (_x)[edi*4]
lea edi,(49)[edi]
push edi
lea edi,(L27)
push edi
call _printf
add esp,8
L24:
inc dword ptr (-4)[ebp]
cmp dword ptr (-4)[ebp],8
jl L23
lea edi,(L28)
push edi
call _printf
add esp,4
mov eax,0
L22:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
_TEXT ends
extrn _printf:near
_TEXT segment
_TEXT ends
_DATA segment
public _x
align 4
_x label byte
db 32 dup (0)
public _rows
align 4
_rows label byte
db 32 dup (0)
public _down
align 4
_down label byte
db 60 dup (0)
public _up
align 4
_up label byte
db 60 dup (0)
_DATA ends
_TEXT segment
align 1
L28 label byte
db 10
db 0
align 1
L27 label byte
db 37
db 99
db 32
db 0
_TEXT ends
end

View file

@ -0,0 +1,4 @@
0 1 2 3 1000 1001 1002 1003 2000 2001 2002 2003
0 1 2 3 1000 1001 1002 1003 2000 2001 2002 2003
0 1 2 3 1000 1001 1002 1003 2000 2001 2002 2003
0 1 2 3 1000 1001 1002 1003 2000 2001 2002 2003

View file

@ -0,0 +1,2 @@
tst/array.c:33: warning: missing return value
tst/array.c:48: warning: missing return value

View file

@ -0,0 +1,240 @@
.486
.model flat
extrn __fltused:near
extrn __ftol:near
public _main
_TEXT segment
_main:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,60
mov dword ptr (-8)[ebp],0
L2:
mov dword ptr (-4)[ebp],0
L6:
mov edi,dword ptr (-4)[ebp]
mov esi,dword ptr (-8)[ebp]
mov ebx,esi
sal ebx,4
imul esi,esi,1000
lea esi,[edi][esi]
mov dword ptr (_x)[ebx][edi*4],esi
L7:
inc dword ptr (-4)[ebp]
cmp dword ptr (-4)[ebp],4
jl L6
mov edi,dword ptr (-8)[ebp]
mov esi,edi
sal esi,4
lea esi,(_x)[esi]
mov dword ptr (_y)[edi*4],esi
L3:
inc dword ptr (-8)[ebp]
cmp dword ptr (-8)[ebp],3
jl L2
call _f
add esp,0
mov dword ptr (-8)[ebp],0
L10:
mov edi,dword ptr (-8)[ebp]
mov esi,edi
sal esi,4
lea esi,(-60)[ebp][esi]
mov dword ptr (-12)[ebp],esi
mov dword ptr (_y)[edi*4],esi
mov dword ptr (-4)[ebp],0
L14:
mov edi,dword ptr (-4)[ebp]
lea edi,[edi*4]
mov esi,dword ptr (-12)[ebp]
mov ebx,dword ptr (-8)[ebp]
sal ebx,4
mov ebx,dword ptr (_x)[ebx][edi]
mov dword ptr [esi][edi],ebx
L15:
inc dword ptr (-4)[ebp]
cmp dword ptr (-4)[ebp],4
jl L14
L11:
inc dword ptr (-8)[ebp]
cmp dword ptr (-8)[ebp],3
jl L10
lea edi,(_y)
push edi
lea edi,(-60)[ebp]
push edi
call _g
add esp,8
mov eax,0
L1:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _f
_f:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,8
mov dword ptr (-8)[ebp],0
L19:
mov dword ptr (-4)[ebp],0
L23:
mov edi,dword ptr (-4)[ebp]
mov esi,dword ptr (-8)[ebp]
sal esi,4
mov edi,dword ptr (_x)[esi][edi*4]
push edi
lea edi,(L27)
push edi
call _printf
add esp,8
L24:
inc dword ptr (-4)[ebp]
cmp dword ptr (-4)[ebp],4
jl L23
L20:
inc dword ptr (-8)[ebp]
cmp dword ptr (-8)[ebp],3
jl L19
lea edi,(L28)
push edi
call _printf
add esp,4
mov dword ptr (-8)[ebp],0
L29:
mov dword ptr (-4)[ebp],0
L33:
mov edi,dword ptr (-4)[ebp]
mov esi,dword ptr (-8)[ebp]
mov esi,dword ptr (_y)[esi*4]
mov edi,dword ptr [esi][edi*4]
push edi
lea edi,(L27)
push edi
call _printf
add esp,8
L34:
inc dword ptr (-4)[ebp]
cmp dword ptr (-4)[ebp],4
jl L33
L30:
inc dword ptr (-8)[ebp]
cmp dword ptr (-8)[ebp],3
jl L29
lea edi,(L28)
push edi
call _printf
add esp,4
mov eax,0
L18:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _g
_g:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,8
mov dword ptr (-8)[ebp],0
L38:
mov dword ptr (-4)[ebp],0
L42:
mov edi,dword ptr (-4)[ebp]
mov esi,dword ptr (-8)[ebp]
sal esi,4
mov ebx,dword ptr (20)[ebp]
lea esi,[ebx][esi]
mov edi,dword ptr [esi][edi*4]
push edi
lea edi,(L27)
push edi
call _printf
add esp,8
L43:
inc dword ptr (-4)[ebp]
cmp dword ptr (-4)[ebp],4
jl L42
L39:
inc dword ptr (-8)[ebp]
cmp dword ptr (-8)[ebp],3
jl L38
lea edi,(L28)
push edi
call _printf
add esp,4
mov dword ptr (-8)[ebp],0
L46:
mov dword ptr (-4)[ebp],0
L50:
mov edi,dword ptr (-4)[ebp]
mov esi,dword ptr (-8)[ebp]
mov ebx,dword ptr (24)[ebp]
mov esi,dword ptr [ebx][esi*4]
mov edi,dword ptr [esi][edi*4]
push edi
lea edi,(L27)
push edi
call _printf
add esp,8
L51:
inc dword ptr (-4)[ebp]
cmp dword ptr (-4)[ebp],4
jl L50
L47:
inc dword ptr (-8)[ebp]
cmp dword ptr (-8)[ebp],3
jl L46
lea edi,(L28)
push edi
call _printf
add esp,4
mov eax,0
L37:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
_TEXT ends
extrn _printf:near
_TEXT segment
_TEXT ends
_DATA segment
public _y
align 4
_y label byte
db 12 dup (0)
public _x
align 4
_x label byte
db 48 dup (0)
_DATA ends
_TEXT segment
align 1
L28 label byte
db 10
db 0
align 1
L27 label byte
db 32
db 37
db 100
db 0
_TEXT ends
end

View file

@ -0,0 +1,51 @@
char freq
011 8.1
012 6.1
040 11.9
! 0.2
" 1.5
% 0.6
& 0.4
' 0.4
( 2.9
) 2.9
* 0.8
+ 1.3
, 1.3
- 0.4
. 0.6
/ 1.0
0 2.5
1 1.9
2 0.6
3 0.2
7 0.4
8 0.2
; 3.8
< 0.8
= 2.7
> 0.2
[ 1.5
\ 0.8
] 1.5
a 3.1
c 4.4
e 2.3
f 6.0
g 1.3
h 1.0
i 5.0
l 1.0
m 0.2
n 3.3
o 2.1
p 1.0
q 0.4
r 4.2
s 0.6
t 3.8
u 1.2
v 0.6
w 0.2
{ 0.6
} 0.6

View file

View file

@ -0,0 +1,185 @@
.486
.model flat
extrn __fltused:near
extrn __ftol:near
public _main
_TEXT segment
_main:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,24
cmp dword ptr (20)[ebp],1
jg L2
fld dword ptr (L4)
fstp dword ptr (-16)[ebp]
jmp L3
L2:
mov edi,dword ptr (24)[ebp]
mov edi,dword ptr (4)[edi]
push edi
call _atof
add esp,4
fstp dword ptr (-20)[ebp]
fld dword ptr (-20)[ebp]
fdiv dword ptr (L5)
fstp dword ptr (-16)[ebp]
L3:
mov dword ptr (-4)[ebp],0
L6:
mov edi,dword ptr (-4)[ebp]
lea esi,(1)[edi]
mov dword ptr (-4)[ebp],esi
fld dword ptr (L4)
fstp dword ptr (_f)[edi*4]
L7:
cmp dword ptr (-4)[ebp],127
jle L6
mov dword ptr (-8)[ebp],0
jmp L11
L10:
mov edi,dword ptr (-12)[ebp]
lea edi,(_f)[edi*4]
fld dword ptr [edi]
fadd dword ptr (L13)
fstp dword ptr [edi]
inc dword ptr (-8)[ebp]
L11:
call _getchar
add esp,0
mov dword ptr (-12)[ebp],eax
cmp eax,-1
jne L10
lea edi,(L14)
push edi
call _printf
add esp,4
mov dword ptr (-4)[ebp],0
L15:
mov edi,dword ptr (-4)[ebp]
fld dword ptr (_f)[edi*4]
fstp dword ptr (-24)[ebp]
fld dword ptr (L4)
fcomp dword ptr (-24)[ebp]
fstsw ax
sahf
je L19
fld dword ptr (-24)[ebp]
mov edi,dword ptr (-8)[ebp]
push edi
fild dword ptr 0[esp]
add esp,4
fdivp st(1),st
fld dword ptr (-16)[ebp]
fcompp
fstsw ax
sahf
ja L19
cmp dword ptr (-4)[ebp],32
jg L21
mov edi,dword ptr (-4)[ebp]
push edi
lea edi,(L23)
push edi
call _printf
add esp,8
jmp L22
L21:
mov edi,dword ptr (-4)[ebp]
push edi
lea edi,(L24)
push edi
call _printf
add esp,8
L22:
fld dword ptr (L5)
mov edi,dword ptr (-4)[ebp]
fmul dword ptr (_f)[edi*4]
mov edi,dword ptr (-8)[ebp]
push edi
fild dword ptr 0[esp]
add esp,4
fdivp st(1),st
sub esp,8
fstp qword ptr [esp]
lea edi,(L25)
push edi
call _printf
add esp,12
L19:
L16:
inc dword ptr (-4)[ebp]
cmp dword ptr (-4)[ebp],127
jle L15
mov eax,0
L1:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
_TEXT ends
extrn _printf:near
_TEXT segment
_TEXT ends
extrn _getchar:near
_TEXT segment
_TEXT ends
extrn _atof:near
_TEXT segment
_TEXT ends
_DATA segment
public _f
align 4
_f label byte
db 512 dup (0)
_DATA ends
_TEXT segment
align 1
L25 label byte
db 9
db 37
db 46
db 49
db 102
db 10
db 0
align 1
L24 label byte
db 37
db 99
db 0
align 1
L23 label byte
db 37
db 48
db 51
db 111
db 0
align 1
L14 label byte
db 99
db 104
db 97
db 114
db 9
db 102
db 114
db 101
db 113
db 10
db 0
align 4
L13 label byte
dd 03f800000H
align 4
L5 label byte
dd 042c80000H
align 4
L4 label byte
dd 00H
_TEXT ends
end

View file

@ -0,0 +1,48 @@
Section s22 returned 0.
Decimal and octal/hex constants sometimes give
different results when assigned to longs.
Decimal and octal/hex constants sometimes give
different results when assigned to longs.
Section s241 returned 0.
Section s243 returned 0.
Section s244 returned 0.
Section s25 returned 0.
8 bits in chars.
32 bits in ints.
16 bits in shorts.
32 bits in longs.
32 bits in unsigneds.
32 bits in floats.
64 bits in doubles.
1.192093e-007 is the least number that can be added to 1. (float).
2.220446e-016 is the least number that can be added to 1. (double).
Section s26 returned 0.
Section s4 returned 0.
Section s61 returned 0.
Section s626 returned 0.
Section s71 returned 0.
Section s72 returned 0.
Section s757 returned 0.
Section s7813 returned 0.
Section s714 returned 0.
Section s715 returned 0.
Register count for char is unreliable.
Register count for pointer is unreliable.
Register count for int is unreliable.
Section s81 returned 0.
Section s84 returned 0.
char alignment: 1
short alignment: 2
int alignment: 4
long alignment: 4
unsigned alignment: 4
float alignment: 4
double alignment: 4
Sign extension in fields
Be especially careful with 1-bit fields!
Section s85 returned 0.
Section s86 returned 0.
Section s88 returned 0.
Section s9 returned 0.
No errors detected.

View file

@ -0,0 +1,25 @@
tst/cq.c:394: warning: overflow in converting constant expression from `unsigned long' to `long int'
tst/cq.c:394: warning: overflow in converting constant expression from `unsigned long' to `long int'
tst/cq.c:394: warning: overflow in converting constant expression from `unsigned long' to `long int'
tst/cq.c:395: warning: overflow in constant `4294967296'
tst/cq.c:395: warning: overflow in converting constant expression from `unsigned long' to `long int'
tst/cq.c:395: warning: overflow in constant `040000000000'
tst/cq.c:395: warning: overflow in converting constant expression from `unsigned long' to `long int'
tst/cq.c:395: warning: overflow in constant `0x100000000'
tst/cq.c:395: warning: overflow in converting constant expression from `unsigned long' to `long int'
tst/cq.c:396: warning: overflow in constant `68719476735'
tst/cq.c:396: warning: overflow in converting constant expression from `unsigned long' to `long int'
tst/cq.c:396: warning: overflow in constant `0777777777777'
tst/cq.c:396: warning: overflow in converting constant expression from `unsigned long' to `long int'
tst/cq.c:396: warning: overflow in constant `0xfffffffff'
tst/cq.c:396: warning: overflow in converting constant expression from `unsigned long' to `long int'
tst/cq.c:397: warning: overflow in constant `68719476736'
tst/cq.c:397: warning: overflow in converting constant expression from `unsigned long' to `long int'
tst/cq.c:397: warning: overflow in constant `01000000000000'
tst/cq.c:397: warning: overflow in converting constant expression from `unsigned long' to `long int'
tst/cq.c:397: warning: overflow in constant `0x1000000000'
tst/cq.c:397: warning: overflow in converting constant expression from `unsigned long' to `long int'
tst/cq.c:533: warning: missing return value
tst/cq.c:1169: warning: missing return value
tst/cq.c:5294: warning: unreachable code
tst/cq.c:5303: warning: missing return value

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,11 @@
1 1 1 1 1 1 1 1 1.000000 1.000000 1.000000
2 2 2 2 2 2 2 2 2.000000 2.000000 2.000000
3 3 3 3 3 3 3 3 3.000000 3.000000 3.000000
4 4 4 4 4 4 4 4 4.000000 4.000000 4.000000
5 5 5 5 5 5 5 5 5.000000 5.000000 5.000000
6 6 6 6 6 6 6 6 6.000000 6.000000 6.000000
7 7 7 7 7 7 7 7 7.000000 7.000000 7.000000
8 8 8 8 8 8 8 8 8.000000 8.000000 8.000000
9 9 9 9 9 9 9 9 9.000000 9.000000 9.000000
10 10 10 10 10 10 10 10 10.000000 10.000000 10.000000
11 11 11 11 11 11 11 11 11.000000 11.000000 11.000000

View file

@ -0,0 +1,2 @@
tst/cvt.c:32: warning: conversion from `pointer to void function(void)' to `pointer to void' is compiler dependent
tst/cvt.c:33: warning: conversion from `pointer to void' to `pointer to void function(void)' is compiler dependent

View file

@ -0,0 +1,742 @@
.486
.model flat
extrn __fltused:near
extrn __ftol:near
public _print
_TEXT segment
_print:
push ebx
push esi
push edi
push ebp
mov ebp,esp
fld qword ptr (_D)
sub esp,8
fstp qword ptr [esp]
fld qword ptr (_d)
sub esp,8
fstp qword ptr [esp]
fld dword ptr (_f)
sub esp,8
fstp qword ptr [esp]
mov edi,dword ptr (_L)
push edi
mov edi,dword ptr (_I)
push edi
mov di,word ptr (_S)
movzx edi,di
push edi
mov bl,byte ptr (_C)
movzx edi,bl
push edi
mov edi,dword ptr (_l)
push edi
mov edi,dword ptr (_i)
push edi
movsx edi,word ptr (_s)
push edi
movsx edi,byte ptr (_c)
push edi
lea edi,(L2)
push edi
call _printf
add esp,60
L1:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _main
_main:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,296
mov byte ptr (_c),1
movsx edi,byte ptr (_c)
mov esi,edi
mov word ptr (_s),si
mov dword ptr (_i),edi
mov dword ptr (_l),edi
mov esi,edi
mov ebx,esi
mov byte ptr (_C),bl
mov ebx,esi
mov word ptr (_S),bx
mov dword ptr (_I),esi
mov dword ptr (_L),esi
push edi
fild dword ptr 0[esp]
add esp,4
fstp dword ptr (_f)
push edi
fild dword ptr 0[esp]
add esp,4
fstp qword ptr (-8)[ebp]
fld qword ptr (-8)[ebp]
fstp qword ptr (_d)
fld qword ptr (-8)[ebp]
fstp qword ptr (_D)
call _print
add esp,0
mov word ptr (_s),2
movsx edi,word ptr (_s)
mov ebx,edi
mov byte ptr (_c),bl
mov dword ptr (_i),edi
mov dword ptr (_l),edi
mov esi,edi
mov ebx,esi
mov byte ptr (_C),bl
mov ebx,esi
mov word ptr (_S),bx
mov dword ptr (_I),esi
mov dword ptr (_L),esi
push edi
fild dword ptr 0[esp]
add esp,4
fstp dword ptr (_f)
push edi
fild dword ptr 0[esp]
add esp,4
fstp qword ptr (-16)[ebp]
fld qword ptr (-16)[ebp]
fstp qword ptr (_d)
fld qword ptr (-16)[ebp]
fstp qword ptr (_D)
call _print
add esp,0
mov dword ptr (_i),3
mov edi,dword ptr (_i)
mov ebx,edi
mov byte ptr (_c),bl
mov esi,edi
mov word ptr (_s),si
mov dword ptr (_l),edi
mov esi,edi
mov ebx,esi
mov byte ptr (_C),bl
mov ebx,esi
mov word ptr (_S),bx
mov dword ptr (_I),esi
mov dword ptr (_L),esi
push edi
fild dword ptr 0[esp]
add esp,4
fstp dword ptr (_f)
push edi
fild dword ptr 0[esp]
add esp,4
fstp qword ptr (-24)[ebp]
fld qword ptr (-24)[ebp]
fstp qword ptr (_d)
fld qword ptr (-24)[ebp]
fstp qword ptr (_D)
call _print
add esp,0
mov dword ptr (_l),4
mov edi,dword ptr (_l)
mov ebx,edi
mov byte ptr (_c),bl
mov esi,edi
mov word ptr (_s),si
mov dword ptr (_i),edi
mov esi,edi
mov ebx,esi
mov byte ptr (_C),bl
mov ebx,esi
mov word ptr (_S),bx
mov dword ptr (_I),esi
mov dword ptr (_L),esi
push edi
fild dword ptr 0[esp]
add esp,4
fstp dword ptr (_f)
push edi
fild dword ptr 0[esp]
add esp,4
fstp qword ptr (-32)[ebp]
fld qword ptr (-32)[ebp]
fstp qword ptr (_d)
fld qword ptr (-32)[ebp]
fstp qword ptr (_D)
call _print
add esp,0
mov byte ptr (_C),5
mov bl,byte ptr (_C)
movzx edi,bl
mov ebx,edi
mov byte ptr (_c),bl
mov esi,edi
mov word ptr (_s),si
mov dword ptr (_i),edi
mov dword ptr (_l),edi
mov esi,edi
mov ebx,esi
mov word ptr (_S),bx
mov dword ptr (_I),esi
mov dword ptr (_L),esi
push edi
fild dword ptr 0[esp]
add esp,4
fstp dword ptr (_f)
push edi
fild dword ptr 0[esp]
add esp,4
fstp qword ptr (-40)[ebp]
fld qword ptr (-40)[ebp]
fstp qword ptr (_d)
fld qword ptr (-40)[ebp]
fstp qword ptr (_D)
call _print
add esp,0
mov word ptr (_S),6
mov di,word ptr (_S)
movzx edi,di
mov ebx,edi
mov byte ptr (_c),bl
mov esi,edi
mov word ptr (_s),si
mov dword ptr (_i),edi
mov dword ptr (_l),edi
mov esi,edi
mov ebx,esi
mov byte ptr (_C),bl
mov dword ptr (_I),esi
mov dword ptr (_L),esi
push edi
fild dword ptr 0[esp]
add esp,4
fstp dword ptr (_f)
push edi
fild dword ptr 0[esp]
add esp,4
fstp qword ptr (-48)[ebp]
fld qword ptr (-48)[ebp]
fstp qword ptr (_d)
fld qword ptr (-48)[ebp]
fstp qword ptr (_D)
call _print
add esp,0
mov dword ptr (_I),7
mov edi,dword ptr (_I)
mov ebx,edi
mov byte ptr (_c),bl
mov ebx,edi
mov word ptr (_s),bx
mov dword ptr (_i),edi
mov dword ptr (_l),edi
mov ebx,edi
mov byte ptr (_C),bl
mov esi,edi
mov word ptr (_S),si
mov dword ptr (_L),edi
fld qword ptr (L4)
mov esi,edi
shr esi,1
push esi
fild dword ptr 0[esp]
add esp,4
fmulp st(1),st
and edi,1
push edi
fild dword ptr 0[esp]
add esp,4
faddp st(1),st
fstp qword ptr (-56)[ebp]
fld qword ptr (-56)[ebp]
fstp dword ptr (_f)
fld qword ptr (-56)[ebp]
fstp qword ptr (_d)
fld qword ptr (-56)[ebp]
fstp qword ptr (_D)
call _print
add esp,0
mov dword ptr (_L),8
mov edi,dword ptr (_L)
mov ebx,edi
mov byte ptr (_c),bl
mov ebx,edi
mov word ptr (_s),bx
mov dword ptr (_i),edi
mov dword ptr (_l),edi
mov ebx,edi
mov byte ptr (_C),bl
mov esi,edi
mov word ptr (_S),si
mov si,word ptr (_S)
movzx esi,si
mov dword ptr (_I),esi
fld qword ptr (L4)
mov esi,edi
shr esi,1
push esi
fild dword ptr 0[esp]
add esp,4
fmulp st(1),st
and edi,1
push edi
fild dword ptr 0[esp]
add esp,4
faddp st(1),st
fstp qword ptr (-64)[ebp]
fld qword ptr (-64)[ebp]
fstp dword ptr (_f)
fld qword ptr (-64)[ebp]
fstp qword ptr (_d)
fld qword ptr (-64)[ebp]
fstp qword ptr (_D)
call _print
add esp,0
fld dword ptr (L5)
fstp dword ptr (_f)
fld dword ptr (_f)
fstp dword ptr (-84)[ebp]
fld dword ptr (-84)[ebp]
call __ftol
mov edi,eax
mov ebx,edi
mov byte ptr (_c),bl
mov esi,edi
mov word ptr (_s),si
mov dword ptr (_i),edi
mov dword ptr (_l),edi
fld dword ptr (L9)
fcomp dword ptr (-84)[ebp]
fstsw ax
sahf
ja L7
fld dword ptr (-84)[ebp]
fsub dword ptr (L9)
call __ftol
mov edi,eax
lea edi,(080000000H)[edi]
mov dword ptr (-68)[ebp],edi
jmp L8
L7:
fld dword ptr (-84)[ebp]
call __ftol
mov edi,eax
mov dword ptr (-68)[ebp],edi
L8:
mov edi,dword ptr (-68)[ebp]
mov ebx,edi
mov byte ptr (_C),bl
fld dword ptr (L9)
fcomp dword ptr (_f)
fstsw ax
sahf
ja L11
fld dword ptr (_f)
fsub dword ptr (L9)
call __ftol
mov edi,eax
lea edi,(080000000H)[edi]
mov dword ptr (-72)[ebp],edi
jmp L12
L11:
fld dword ptr (_f)
call __ftol
mov edi,eax
mov dword ptr (-72)[ebp],edi
L12:
mov edi,dword ptr (-72)[ebp]
mov word ptr (_S),di
fld dword ptr (L9)
fcomp dword ptr (_f)
fstsw ax
sahf
ja L14
fld dword ptr (_f)
fsub dword ptr (L9)
call __ftol
mov edi,eax
lea edi,(080000000H)[edi]
mov dword ptr (-76)[ebp],edi
jmp L15
L14:
fld dword ptr (_f)
call __ftol
mov edi,eax
mov dword ptr (-76)[ebp],edi
L15:
mov edi,dword ptr (-76)[ebp]
mov dword ptr (_I),edi
fld dword ptr (L9)
fcomp dword ptr (_f)
fstsw ax
sahf
ja L17
fld dword ptr (_f)
fsub dword ptr (L9)
call __ftol
mov edi,eax
lea edi,(080000000H)[edi]
mov dword ptr (-80)[ebp],edi
jmp L18
L17:
fld dword ptr (_f)
call __ftol
mov edi,eax
mov dword ptr (-80)[ebp],edi
L18:
mov edi,dword ptr (-80)[ebp]
mov dword ptr (_L),edi
fld dword ptr (_f)
fstp qword ptr (-120)[ebp]
fld qword ptr (-120)[ebp]
fstp qword ptr (_d)
fld qword ptr (-120)[ebp]
fstp qword ptr (_D)
call _print
add esp,0
fld qword ptr (L19)
fstp qword ptr (_d)
fld qword ptr (_d)
fstp qword ptr (-144)[ebp]
fld qword ptr (-144)[ebp]
call __ftol
mov edi,eax
mov ebx,edi
mov byte ptr (_c),bl
mov esi,edi
mov word ptr (_s),si
mov dword ptr (_i),edi
mov dword ptr (_l),edi
fld qword ptr (L23)
fcomp qword ptr (-144)[ebp]
fstsw ax
sahf
ja L21
fld qword ptr (-144)[ebp]
fsub qword ptr (L23)
call __ftol
mov edi,eax
lea edi,(080000000H)[edi]
mov dword ptr (-124)[ebp],edi
jmp L22
L21:
fld qword ptr (-144)[ebp]
call __ftol
mov edi,eax
mov dword ptr (-124)[ebp],edi
L22:
mov edi,dword ptr (-124)[ebp]
mov ebx,edi
mov byte ptr (_C),bl
fld qword ptr (L23)
fcomp qword ptr (_d)
fstsw ax
sahf
ja L25
fld qword ptr (_d)
fsub qword ptr (L23)
call __ftol
mov edi,eax
lea edi,(080000000H)[edi]
mov dword ptr (-128)[ebp],edi
jmp L26
L25:
fld qword ptr (_d)
call __ftol
mov edi,eax
mov dword ptr (-128)[ebp],edi
L26:
mov edi,dword ptr (-128)[ebp]
mov word ptr (_S),di
fld qword ptr (L23)
fcomp qword ptr (_d)
fstsw ax
sahf
ja L28
fld qword ptr (_d)
fsub qword ptr (L23)
call __ftol
mov edi,eax
lea edi,(080000000H)[edi]
mov dword ptr (-132)[ebp],edi
jmp L29
L28:
fld qword ptr (_d)
call __ftol
mov edi,eax
mov dword ptr (-132)[ebp],edi
L29:
mov edi,dword ptr (-132)[ebp]
mov dword ptr (_I),edi
fld qword ptr (L23)
fcomp qword ptr (_d)
fstsw ax
sahf
ja L31
fld qword ptr (_d)
fsub qword ptr (L23)
call __ftol
mov edi,eax
lea edi,(080000000H)[edi]
mov dword ptr (-136)[ebp],edi
jmp L32
L31:
fld qword ptr (_d)
call __ftol
mov edi,eax
mov dword ptr (-136)[ebp],edi
L32:
mov edi,dword ptr (-136)[ebp]
mov dword ptr (_L),edi
fld qword ptr (_d)
fstp dword ptr (_f)
fld qword ptr (_d)
fstp qword ptr (_D)
call _print
add esp,0
fld qword ptr (L33)
fstp qword ptr (_D)
fld qword ptr (_D)
fstp qword ptr (-232)[ebp]
fld qword ptr (-232)[ebp]
call __ftol
mov edi,eax
mov ebx,edi
mov byte ptr (_c),bl
mov esi,edi
mov word ptr (_s),si
mov dword ptr (_i),edi
mov dword ptr (_l),edi
fld qword ptr (L37)
fcomp qword ptr (-232)[ebp]
fstsw ax
sahf
ja L35
fld qword ptr (-232)[ebp]
fsub qword ptr (L37)
call __ftol
mov edi,eax
lea edi,(080000000H)[edi]
mov dword ptr (-212)[ebp],edi
jmp L36
L35:
fld qword ptr (-232)[ebp]
call __ftol
mov edi,eax
mov dword ptr (-212)[ebp],edi
L36:
mov edi,dword ptr (-212)[ebp]
mov ebx,edi
mov byte ptr (_C),bl
fld qword ptr (L37)
fcomp qword ptr (_D)
fstsw ax
sahf
ja L39
fld qword ptr (_D)
fsub qword ptr (L37)
call __ftol
mov edi,eax
lea edi,(080000000H)[edi]
mov dword ptr (-216)[ebp],edi
jmp L40
L39:
fld qword ptr (_D)
call __ftol
mov edi,eax
mov dword ptr (-216)[ebp],edi
L40:
mov edi,dword ptr (-216)[ebp]
mov word ptr (_S),di
fld qword ptr (L37)
fcomp qword ptr (_D)
fstsw ax
sahf
ja L42
fld qword ptr (_D)
fsub qword ptr (L37)
call __ftol
mov edi,eax
lea edi,(080000000H)[edi]
mov dword ptr (-220)[ebp],edi
jmp L43
L42:
fld qword ptr (_D)
call __ftol
mov edi,eax
mov dword ptr (-220)[ebp],edi
L43:
mov edi,dword ptr (-220)[ebp]
mov dword ptr (_I),edi
fld qword ptr (L37)
fcomp qword ptr (_D)
fstsw ax
sahf
ja L45
fld qword ptr (_D)
fsub qword ptr (L37)
call __ftol
mov edi,eax
lea edi,(080000000H)[edi]
mov dword ptr (-224)[ebp],edi
jmp L46
L45:
fld qword ptr (_D)
call __ftol
mov edi,eax
mov dword ptr (-224)[ebp],edi
L46:
mov edi,dword ptr (-224)[ebp]
mov dword ptr (_L),edi
fld qword ptr (_D)
fstp dword ptr (_f)
fld qword ptr (_D)
fstp qword ptr (_d)
call _print
add esp,0
mov dword ptr (_p),0
mov dword ptr (_p),0
mov dword ptr (_p),0
mov dword ptr (_p),0
mov edi,dword ptr (_P)
mov dword ptr (_p),edi
mov dword ptr (_P),0
mov dword ptr (_P),0
mov dword ptr (_P),0
mov dword ptr (_P),0
mov edi,dword ptr (_p)
mov dword ptr (_P),edi
mov eax,0
L3:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
_TEXT ends
extrn _printf:near
_TEXT segment
_TEXT ends
_DATA segment
public _P
align 4
_P label byte
db 4 dup (0)
public _p
align 4
_p label byte
db 4 dup (0)
public _D
align 4
_D label byte
db 8 dup (0)
public _d
align 4
_d label byte
db 8 dup (0)
public _f
align 4
_f label byte
db 4 dup (0)
public _L
align 4
_L label byte
db 4 dup (0)
public _I
align 4
_I label byte
db 4 dup (0)
public _S
align 2
_S label byte
db 2 dup (0)
public _C
align 1
_C label byte
db 1 dup (0)
public _l
align 4
_l label byte
db 4 dup (0)
public _i
align 4
_i label byte
db 4 dup (0)
public _s
align 2
_s label byte
db 2 dup (0)
public _c
align 1
_c label byte
db 1 dup (0)
_DATA ends
_TEXT segment
align 4
L37 label byte
dd 00H
dd 041e00000H
align 4
L33 label byte
dd 00H
dd 040260000H
align 4
L23 label byte
dd 00H
dd 041e00000H
align 4
L19 label byte
dd 00H
dd 040240000H
align 4
L9 label byte
dd 04f000000H
align 4
L5 label byte
dd 041100000H
align 4
L4 label byte
dd 00H
dd 040000000H
align 1
L2 label byte
db 37
db 100
db 32
db 37
db 100
db 32
db 37
db 100
db 32
db 37
db 108
db 100
db 32
db 37
db 117
db 32
db 37
db 117
db 32
db 37
db 117
db 32
db 37
db 108
db 117
db 32
db 37
db 102
db 32
db 37
db 102
db 32
db 37
db 108
db 102
db 10
db 0
_TEXT ends
end

View file

@ -0,0 +1,5 @@
x = 1 2 3 4 -3 6
y = 3 8 9
x = 1 2 3 0 0 6
y = 2 8 16
p->a = 0x3, p->b = 0xf

View file

@ -0,0 +1,4 @@
tst/fields.c:6: warning: initializer exceeds bit-field width
tst/fields.c:8: warning: initializer exceeds bit-field width
tst/fields.c:30: warning: missing return value
tst/fields.c:34: warning: missing return value

View file

@ -0,0 +1,323 @@
.486
.model flat
extrn __fltused:near
extrn __ftol:near
_DATA segment
public _x
align 4
_x label byte
dd 1
db 2
db 3 dup (0)
db 03H
db 040H
db 2 dup (0)
db 050H
db 6
db 2 dup (0)
public _i
align 4
_i label byte
dd 16
public _y
align 4
_y label byte
db 023H
db 3 dup (0)
db 09H
db 00H
db 00H
db 00H
public _main
_DATA ends
_TEXT segment
_main:
push ebx
push esi
push edi
push ebp
mov ebp,esp
movsx edi,byte ptr (_x+13)
push edi
mov edi,dword ptr (_x+12)
sal edi,25
sar edi,29
push edi
mov edi,dword ptr (_x+8)
sal edi,16
sar edi,28
push edi
mov edi,dword ptr (_x+8)
sal edi,20
sar edi,20
push edi
movsx edi,byte ptr (_x+4)
push edi
mov edi,dword ptr (_x)
push edi
lea edi,(L4)
push edi
call _printf
add esp,28
mov edi,dword ptr (_y+4)
push edi
mov edi,dword ptr (_y)
mov esi,edi
shr esi,2
and esi,15
push esi
and edi,3
push edi
lea edi,(L10)
push edi
call _printf
add esp,16
mov edi,dword ptr (_x+8)
and edi,0ffff0fffH
mov esi,dword ptr (_i)
sal esi,28
sar esi,28
shl esi,12
and esi,0f000H
or edi,esi
mov dword ptr (_x+8),edi
mov edi,dword ptr (_x+12)
and edi,0ffffff8fH
mov dword ptr (_x+12),edi
movsx edi,byte ptr (_x+13)
push edi
mov edi,dword ptr (_x+12)
sal edi,25
sar edi,29
push edi
mov edi,dword ptr (_x+8)
sal edi,16
sar edi,28
push edi
mov edi,dword ptr (_x+8)
sal edi,20
sar edi,20
push edi
movsx edi,byte ptr (_x+4)
push edi
mov edi,dword ptr (_x)
push edi
lea edi,(L4)
push edi
call _printf
add esp,28
mov edi,dword ptr (_y)
and edi,0fffffffcH
or edi,2
mov dword ptr (_y),edi
mov edi,dword ptr (_i)
mov dword ptr (_y+4),edi
mov edi,dword ptr (_y+4)
push edi
mov edi,dword ptr (_y)
mov esi,edi
shr esi,2
and esi,15
push esi
and edi,3
push edi
lea edi,(L10)
push edi
call _printf
add esp,16
lea edi,(_x)
push edi
call _f2
add esp,4
mov eax,0
L3:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _f1
_f1:
push ebx
push esi
push edi
push ebp
mov ebp,esp
mov edi,dword ptr (20)[ebp]
and dword ptr [edi],0ffffffc3H
mov edi,dword ptr (20)[ebp]
mov esi,dword ptr [edi]
and esi,0fffffffcH
mov ebx,0
and ebx,3
and ebx,3
or esi,ebx
mov dword ptr [edi],esi
mov edi,dword ptr (20)[ebp]
mov edi,dword ptr [edi]
and edi,60
cmp edi,0
je L22
lea edi,(L24)
push edi
call _printf
add esp,4
L22:
mov edi,dword ptr (20)[ebp]
or dword ptr [edi],3
mov edi,dword ptr (20)[ebp]
or dword ptr [edi],60
mov edi,dword ptr (20)[ebp]
mov edi,dword ptr [edi]
mov esi,edi
shr esi,2
and esi,15
push esi
and edi,3
push edi
lea edi,(L25)
push edi
call _printf
add esp,12
mov eax,0
L21:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _f2
_f2:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,4
cmp dword ptr (_i),0
jne L28
mov dword ptr (-4)[ebp],1
jmp L29
L28:
mov dword ptr (-4)[ebp],0
L29:
mov edi,dword ptr (20)[ebp]
mov esi,dword ptr [edi]
and esi,0fffffffcH
mov ebx,dword ptr (-4)[ebp]
and ebx,3
and ebx,3
or esi,ebx
mov dword ptr [edi],esi
mov edi,dword ptr (20)[ebp]
push edi
call _f1
add esp,4
mov esi,dword ptr [edi]
and esi,0ffffffc3H
mov ebx,0
and ebx,15
lea ebx,[ebx*4]
and ebx,60
or esi,ebx
mov dword ptr [edi],esi
mov eax,0
L26:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
_TEXT ends
extrn _printf:near
_TEXT segment
_TEXT ends
_TEXT segment
align 1
L25 label byte
db 112
db 45
db 62
db 97
db 32
db 61
db 32
db 48
db 120
db 37
db 120
db 44
db 32
db 112
db 45
db 62
db 98
db 32
db 61
db 32
db 48
db 120
db 37
db 120
db 10
db 0
align 1
L24 label byte
db 112
db 45
db 62
db 98
db 32
db 33
db 61
db 32
db 48
db 33
db 10
db 0
align 1
L10 label byte
db 121
db 32
db 61
db 32
db 37
db 100
db 32
db 37
db 100
db 32
db 37
db 100
db 10
db 0
align 1
L4 label byte
db 120
db 32
db 61
db 32
db 37
db 100
db 32
db 37
db 100
db 32
db 37
db 100
db 32
db 37
db 100
db 32
db 37
db 100
db 32
db 37
db 100
db 10
db 0
_TEXT ends
end

View file

@ -0,0 +1,29 @@
tst/front.c:3: warning: missing return value
tst/front.c:10: warning: missing return value
tst/front.c:20: type error in argument 1 to `s'; found `pointer to struct D' expected `pointer to incomplete struct D defined at tst/front.c:14'
tst/front.c:21: warning: missing return value
tst/front.c:32: warning: missing return value
tst/front.c:36: operands of = have illegal types `pointer to int' and `pointer to const int'
tst/front.c:38: warning: missing return value
tst/front.c:62: operands of = have illegal types `pointer to char' and `pointer to const void'
tst/front.c:63: warning: missing return value
tst/front.c:68: warning: missing return value
tst/front.c:69: warning: inconsistent linkage for `yy' previously declared at tst/front.c:68
tst/front.c:69: warning: missing return value
tst/front.c:71: invalid storage class `static' for `int function goo'
tst/front.c:71: warning: declaration of `goo' does not match previous declaration at tst/front.c:70
tst/front.c:71: warning: missing return value
tst/front.c:74: warning: declaration of `xr' does not match previous declaration at tst/front.c:72
tst/front.c:74: warning: missing return value
tst/front.c:81: warning: missing return value
tst/front.c:82: warning: declaration of `ss2' does not match previous declaration at tst/front.c:81
tst/front.c:84: warning: inconsistent linkage for `ss5' previously declared at tst/front.c:80
tst/front.c:92: type error in argument 1 to `gx1'; found `pointer to double' expected `double'
tst/front.c:92: warning: missing return value
tst/front.c:95: redeclaration of `hx1' previously declared at tst/front.c:94
tst/front.c:98: warning: missing return value
tst/front.c:101: conflicting argument declarations for function `gg1'
tst/front.c:101: warning: missing return value
tst/front.c:112: type error in argument 4 to `qsort'; found `pointer to int function(pointer to pointer to char,pointer to pointer to char)' expected `pointer to int function(pointer to const void,pointer to const void)'
tst/front.c:113: warning: missing return value
tst/front.c:120: warning: missing return value

View file

@ -0,0 +1,436 @@
.486
.model flat
extrn __fltused:near
extrn __ftol:near
public _main
_TEXT segment
_main:
push ebx
push esi
push edi
push ebp
mov ebp,esp
push 0
call _exit
add esp,4
mov eax,0
L1:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _nested
_nested:
push ebx
push esi
push edi
push ebp
mov ebp,esp
cmp dword ptr (20)[ebp],4
jge L6
cmp dword ptr (24)[ebp],114
je L9
L6:
cmp dword ptr (20)[ebp],1
jne L8
mov edi,dword ptr (24)[ebp]
cmp edi,104
je L9
cmp edi,105
je L9
L8:
cmp dword ptr (20)[ebp],2
jne L3
mov edi,dword ptr (24)[ebp]
cmp edi,111
je L9
cmp edi,121
jne L3
L9:
mov edi,dword ptr (24)[ebp]
mov dword ptr (20)[ebp],edi
L3:
mov eax,0
L2:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _s
_s:
push ebx
push esi
push edi
push ebp
mov ebp,esp
L10:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
_TEXT ends
_DATA segment
public _Dy
align 4
_Dy label byte
dd 0
db 4 dup (0)
public _Dz
align 4
_Dz label byte
dd 1
db 4 dup (0)
public _Dfunc
_DATA ends
_TEXT segment
_Dfunc:
push ebx
push esi
push edi
push ebp
mov ebp,esp
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _f
_f:
push ebx
push esi
push edi
push ebp
mov ebp,esp
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _f1
_f1:
push ebx
push esi
push edi
push ebp
mov ebp,esp
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _f2
_f2:
push ebx
push esi
push edi
push ebp
mov ebp,esp
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _g
_g:
push ebx
push esi
push edi
push ebp
mov ebp,esp
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _h
_h:
push ebx
push esi
push edi
push ebp
mov ebp,esp
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _h1
_h1:
push ebx
push esi
push edi
push ebp
mov ebp,esp
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _h2
_h2:
push ebx
push esi
push edi
push ebp
mov ebp,esp
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
_TEXT ends
_DATA segment
align 4
L21 label byte
dd 1
public _set1
_DATA ends
_TEXT segment
_set1:
push ebx
push esi
push edi
push ebp
mov ebp,esp
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
_TEXT ends
_DATA segment
align 4
L23 label byte
dd 2
public _set2
_DATA ends
_TEXT segment
_set2:
push ebx
push esi
push edi
push ebp
mov ebp,esp
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
_goo:
push ebx
push esi
push edi
push ebp
mov ebp,esp
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _sss
_sss:
push ebx
push esi
push edi
push ebp
mov ebp,esp
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
_TEXT ends
_DATA segment
align 4
L27 label byte
db 4 dup (0)
public _rrr
_DATA ends
_TEXT segment
_rrr:
push ebx
push esi
push edi
push ebp
mov ebp,esp
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _setstatic
_setstatic:
push ebx
push esi
push edi
push ebp
mov ebp,esp
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _gx1
_gx1:
push ebx
push esi
push edi
push ebp
mov ebp,esp
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _ff1
_ff1:
push ebx
push esi
push edi
push ebp
mov ebp,esp
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _gg1
_gg1:
push ebx
push esi
push edi
push ebp
mov ebp,esp
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _hh1
_hh1:
push ebx
push esi
push edi
push ebp
mov ebp,esp
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _cmp
_cmp:
push ebx
push esi
push edi
push ebp
mov ebp,esp
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _sort
_sort:
push ebx
push esi
push edi
push ebp
mov ebp,esp
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _onearg
_onearg:
push ebx
push esi
push edi
push ebp
mov ebp,esp
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
_TEXT ends
extrn _exit:near
_TEXT segment
_TEXT ends
extrn _qsort:near
_TEXT segment
_TEXT ends
extrn _strcmp:near
_TEXT segment
_TEXT ends
_DATA segment
public _ss4
align 4
_ss4 label byte
db 4 dup (0)
align 4
_ss2 label byte
db 4 dup (0)
align 4
_ss5 label byte
db 4 dup (0)
public _ss3
align 4
_ss3 label byte
db 4 dup (0)
align 4
_ss1 label byte
db 4 dup (0)
align 4
_yy label byte
db 4 dup (0)
public _z
align 4
_z label byte
db 4 dup (0)
public _y
align 4
_y label byte
db 4 dup (0)
public _x
align 4
_x label byte
db 4 dup (0)
public _b
align 4
_b label byte
db 4 dup (0)
public _a
align 4
_a label byte
db 4 dup (0)
_DATA ends
end

View file

View file

@ -0,0 +1,9 @@
tst/incr.c:1: warning: missing return value
tst/incr.c:6: warning: expression with no effect elided
tst/incr.c:6: warning: expression with no effect elided
tst/incr.c:11: warning: missing return value
tst/incr.c:16: warning: expression with no effect elided
tst/incr.c:16: warning: expression with no effect elided
tst/incr.c:21: warning: missing return value
tst/incr.c:30: warning: missing return value
tst/incr.c:39: warning: missing return value

View file

@ -0,0 +1,166 @@
.486
.model flat
extrn __fltused:near
extrn __ftol:near
public _main
_TEXT segment
_main:
push ebx
push esi
push edi
push ebp
mov ebp,esp
mov eax,0
L1:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _memchar
_memchar:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,8
mov edi,dword ptr (-8)[ebp]
lea esi,(1)[edi]
mov dword ptr (-8)[ebp],esi
mov bl,byte ptr [edi]
mov byte ptr (-1)[ebp],bl
mov edi,dword ptr (-8)[ebp]
lea edi,(1)[edi]
mov dword ptr (-8)[ebp],edi
mov bl,byte ptr [edi]
mov byte ptr (-1)[ebp],bl
mov edi,dword ptr (-8)[ebp]
lea esi,(-1)[edi]
mov dword ptr (-8)[ebp],esi
mov bl,byte ptr [edi]
mov byte ptr (-1)[ebp],bl
mov edi,dword ptr (-8)[ebp]
lea edi,(-1)[edi]
mov dword ptr (-8)[ebp],edi
mov bl,byte ptr [edi]
mov byte ptr (-1)[ebp],bl
mov eax,0
L2:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _memint
_memint:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,8
mov edi,dword ptr (-8)[ebp]
lea esi,(4)[edi]
mov dword ptr (-8)[ebp],esi
mov edi,dword ptr [edi]
mov dword ptr (-4)[ebp],edi
mov edi,dword ptr (-8)[ebp]
lea edi,(4)[edi]
mov dword ptr (-8)[ebp],edi
mov edi,dword ptr [edi]
mov dword ptr (-4)[ebp],edi
mov edi,dword ptr (-8)[ebp]
lea esi,(-4)[edi]
mov dword ptr (-8)[ebp],esi
mov edi,dword ptr [edi]
mov dword ptr (-4)[ebp],edi
mov edi,dword ptr (-8)[ebp]
lea edi,(-4)[edi]
mov dword ptr (-8)[ebp],edi
mov edi,dword ptr [edi]
mov dword ptr (-4)[ebp],edi
mov eax,0
L3:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _regchar
_regchar:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,8
mov edi,dword ptr (-8)[ebp]
lea esi,(1)[edi]
mov dword ptr (-8)[ebp],esi
mov bl,byte ptr [edi]
mov byte ptr (-1)[ebp],bl
mov edi,dword ptr (-8)[ebp]
lea edi,(1)[edi]
mov dword ptr (-8)[ebp],edi
mov bl,byte ptr [edi]
mov byte ptr (-1)[ebp],bl
mov edi,dword ptr (-8)[ebp]
lea esi,(-1)[edi]
mov dword ptr (-8)[ebp],esi
mov bl,byte ptr [edi]
mov byte ptr (-1)[ebp],bl
mov edi,dword ptr (-8)[ebp]
lea edi,(-1)[edi]
mov dword ptr (-8)[ebp],edi
mov bl,byte ptr [edi]
mov byte ptr (-1)[ebp],bl
mov eax,0
L4:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _regint
_regint:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,8
mov edi,dword ptr (-8)[ebp]
lea esi,(4)[edi]
mov dword ptr (-8)[ebp],esi
mov edi,dword ptr [edi]
mov dword ptr (-4)[ebp],edi
mov edi,dword ptr (-8)[ebp]
lea edi,(4)[edi]
mov dword ptr (-8)[ebp],edi
mov edi,dword ptr [edi]
mov dword ptr (-4)[ebp],edi
mov edi,dword ptr (-8)[ebp]
lea esi,(-4)[edi]
mov dword ptr (-8)[ebp],esi
mov edi,dword ptr [edi]
mov dword ptr (-4)[ebp],edi
mov edi,dword ptr (-8)[ebp]
lea edi,(-4)[edi]
mov dword ptr (-8)[ebp],edi
mov edi,dword ptr [edi]
mov dword ptr (-4)[ebp],edi
mov eax,0
L5:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
_TEXT ends
end

View file

@ -0,0 +1,16 @@
1 2 3 4
5 6
7
if
for
else
while
1 2 3 if
4 5 0 for
6 7 8 else
9 10 11 while
1 2 3 if
4 5 0 for
6 7 8 else
9 10 11 while
0 0 0

View file

@ -0,0 +1,3 @@
tst/init.c:36: warning: missing return value
tst/init.c:49: warning: missing return value
tst/init.c:59: warning: missing return value

View file

@ -0,0 +1,336 @@
.486
.model flat
extrn __fltused:near
extrn __ftol:near
_DATA segment
public _words
align 4
_words label byte
dd 1
dd 2
dd 3
db 105
db 102
db 0
db 3 dup (0)
db 2 dup (0)
dd 4
dd 5
db 4 dup (0)
db 102
db 111
db 114
db 3 dup (0)
db 2 dup (0)
dd 6
dd 7
dd 8
db 101
db 108
db 115
db 101
db 0
db 1 dup (0)
db 2 dup (0)
dd 9
dd 10
dd 11
db 119
db 104
db 105
db 108
db 101
db 1 dup (0)
db 2 dup (0)
dd 0
db 8 dup (0)
db 8 dup (0)
public _wordlist
align 4
_wordlist label byte
dd _words
public _x
align 4
_x label byte
dd 1
dd 2
dd 3
dd 4
dd 0
dd 5
dd 6
db 12 dup (0)
dd 7
db 16 dup (0)
public _y
align 4
_y label byte
dd _x
dd _x+20
dd _x+40
dd 00H
public _main
_DATA ends
_TEXT segment
_main:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,8
mov dword ptr (-8)[ebp],0
jmp L8
L5:
mov dword ptr (-4)[ebp],0
jmp L12
L9:
mov edi,dword ptr (-4)[ebp]
mov esi,dword ptr (-8)[ebp]
mov esi,dword ptr (_y)[esi*4]
mov edi,dword ptr [esi][edi*4]
push edi
lea edi,(L13)
push edi
call _printf
add esp,8
L10:
inc dword ptr (-4)[ebp]
L12:
mov edi,dword ptr (-4)[ebp]
mov esi,dword ptr (-8)[ebp]
mov esi,dword ptr (_y)[esi*4]
cmp dword ptr [esi][edi*4],0
jne L9
lea edi,(L14)
push edi
call _printf
add esp,4
L6:
inc dword ptr (-8)[ebp]
L8:
mov edi,dword ptr (-8)[ebp]
mov edi,dword ptr (_y)[edi*4]
cmp edi,0
jne L5
call _f
add esp,0
mov edi,dword ptr (_wordlist)
push edi
call _g
add esp,4
mov eax,0
L4:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
_TEXT ends
_DATA segment
align 4
L16 label byte
dd L17
dd L18
dd L19
dd L20
dd 00H
public _f
_DATA ends
_TEXT segment
_f:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,4
lea edi,(L16)
mov dword ptr (-4)[ebp],edi
jmp L24
L21:
mov edi,dword ptr (-4)[ebp]
mov edi,dword ptr [edi]
push edi
lea edi,(L25)
push edi
call _printf
add esp,8
L22:
mov edi,dword ptr (-4)[ebp]
lea edi,(4)[edi]
mov dword ptr (-4)[ebp],edi
L24:
mov edi,dword ptr (-4)[ebp]
mov edi,dword ptr [edi]
cmp edi,0
jne L21
mov eax,0
L15:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _g
_g:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,4
jmp L30
L27:
mov dword ptr (-4)[ebp],0
jmp L34
L31:
mov edi,dword ptr (-4)[ebp]
mov esi,dword ptr (20)[ebp]
mov edi,dword ptr [esi][edi*4]
push edi
lea edi,(L35)
push edi
call _printf
add esp,8
L32:
inc dword ptr (-4)[ebp]
L34:
mov edi,dword ptr (-4)[ebp]
cmp edi,3
jb L31
mov edi,dword ptr (20)[ebp]
lea edi,(12)[edi]
push edi
lea edi,(L25)
push edi
call _printf
add esp,8
L28:
mov edi,dword ptr (20)[ebp]
lea edi,(20)[edi]
mov dword ptr (20)[ebp],edi
L30:
mov edi,dword ptr (20)[ebp]
cmp dword ptr [edi],0
jne L27
call _h
add esp,0
mov eax,0
L26:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _h
_h:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,4
mov dword ptr (-4)[ebp],0
jmp L40
L37:
imul edi,dword ptr (-4)[ebp],20
lea esi,(_words+12)[edi]
push esi
mov esi,dword ptr (_words+8)[edi]
push esi
mov esi,dword ptr (_words+4)[edi]
push esi
mov edi,dword ptr (_words)[edi]
push edi
lea edi,(L41)
push edi
call _printf
add esp,20
L38:
inc dword ptr (-4)[ebp]
L40:
mov edi,dword ptr (-4)[ebp]
cmp edi,5
jb L37
mov eax,0
L36:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
_TEXT ends
extrn _printf:near
_TEXT segment
_TEXT ends
_TEXT segment
align 1
L41 label byte
db 37
db 100
db 32
db 37
db 100
db 32
db 37
db 100
db 32
db 37
db 115
db 10
db 0
align 1
L35 label byte
db 37
db 100
db 32
db 0
align 1
L25 label byte
db 37
db 115
db 10
db 0
align 1
L20 label byte
db 119
db 104
db 105
db 108
db 101
db 0
align 1
L19 label byte
db 101
db 108
db 115
db 101
db 0
align 1
L18 label byte
db 102
db 111
db 114
db 0
align 1
L17 label byte
db 105
db 102
db 0
align 1
L14 label byte
db 10
db 0
align 1
L13 label byte
db 32
db 37
db 100
db 0
_TEXT ends
end

View file

@ -0,0 +1,14 @@
UCHAR_MAX: 000000ff=255
USHRT_MAX: 0000ffff=65535
UINT_MAX: ffffffff=-1
ULONG_MAX: ffffffff=-1
CHAR_MAX: 0000007f=127
SCHAR_MAX: 0000007f=127
SHRT_MAX: 00007fff=32767
INT_MAX: 7fffffff=2147483647
LONG_MAX: 7fffffff=2147483647
CHAR_MIN: ffffff80=-128
SCHAR_MIN: ffffff80=-128
SHRT_MIN: ffff8000=-32768
INT_MIN: 80000000=-2147483648
LONG_MIN: 80000000=-2147483648

View file

View file

@ -0,0 +1,414 @@
.486
.model flat
extrn __fltused:near
extrn __ftol:near
public _main
_TEXT segment
_main:
push ebx
push esi
push edi
push ebp
mov ebp,esp
push 255
push 255
lea edi,(L2)
push edi
call _printf
add esp,12
push 65535
push 65535
lea edi,(L3)
push edi
call _printf
add esp,12
push 0ffffffffH
push 0ffffffffH
lea edi,(L4)
push edi
call _printf
add esp,12
push 0ffffffffH
push 0ffffffffH
lea edi,(L5)
push edi
call _printf
add esp,12
push 127
push 127
lea edi,(L6)
push edi
call _printf
add esp,12
push 127
push 127
lea edi,(L7)
push edi
call _printf
add esp,12
push 32767
push 32767
lea edi,(L8)
push edi
call _printf
add esp,12
push 2147483647
push 2147483647
lea edi,(L9)
push edi
call _printf
add esp,12
push 2147483647
push 2147483647
lea edi,(L10)
push edi
call _printf
add esp,12
push -128
push -128
lea edi,(L11)
push edi
call _printf
add esp,12
push -128
push -128
lea edi,(L12)
push edi
call _printf
add esp,12
push -32768
push -32768
lea edi,(L13)
push edi
call _printf
add esp,12
push -2147483648
push -2147483648
lea edi,(L14)
push edi
call _printf
add esp,12
push -2147483648
push -2147483648
lea edi,(L15)
push edi
call _printf
add esp,12
mov eax,0
L1:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
_TEXT ends
extrn _printf:near
_TEXT segment
_TEXT ends
_TEXT segment
align 1
L15 label byte
db 76
db 79
db 78
db 71
db 95
db 77
db 73
db 78
db 58
db 9
db 37
db 48
db 56
db 108
db 120
db 61
db 37
db 108
db 100
db 10
db 0
align 1
L14 label byte
db 73
db 78
db 84
db 95
db 77
db 73
db 78
db 58
db 9
db 37
db 48
db 56
db 120
db 61
db 37
db 100
db 10
db 0
align 1
L13 label byte
db 83
db 72
db 82
db 84
db 95
db 77
db 73
db 78
db 58
db 9
db 37
db 48
db 56
db 120
db 61
db 37
db 100
db 10
db 0
align 1
L12 label byte
db 83
db 67
db 72
db 65
db 82
db 95
db 77
db 73
db 78
db 58
db 9
db 37
db 48
db 56
db 120
db 61
db 37
db 100
db 10
db 0
align 1
L11 label byte
db 67
db 72
db 65
db 82
db 95
db 77
db 73
db 78
db 58
db 9
db 37
db 48
db 56
db 120
db 61
db 37
db 100
db 10
db 0
align 1
L10 label byte
db 76
db 79
db 78
db 71
db 95
db 77
db 65
db 88
db 58
db 9
db 37
db 48
db 56
db 108
db 120
db 61
db 37
db 108
db 100
db 10
db 0
align 1
L9 label byte
db 73
db 78
db 84
db 95
db 77
db 65
db 88
db 58
db 9
db 37
db 48
db 56
db 120
db 61
db 37
db 100
db 10
db 0
align 1
L8 label byte
db 83
db 72
db 82
db 84
db 95
db 77
db 65
db 88
db 58
db 9
db 37
db 48
db 56
db 120
db 61
db 37
db 100
db 10
db 0
align 1
L7 label byte
db 83
db 67
db 72
db 65
db 82
db 95
db 77
db 65
db 88
db 58
db 9
db 37
db 48
db 56
db 120
db 61
db 37
db 100
db 10
db 0
align 1
L6 label byte
db 67
db 72
db 65
db 82
db 95
db 77
db 65
db 88
db 58
db 9
db 37
db 48
db 56
db 120
db 61
db 37
db 100
db 10
db 0
align 1
L5 label byte
db 85
db 76
db 79
db 78
db 71
db 95
db 77
db 65
db 88
db 58
db 9
db 37
db 48
db 56
db 108
db 120
db 61
db 37
db 108
db 100
db 10
db 0
align 1
L4 label byte
db 85
db 73
db 78
db 84
db 95
db 77
db 65
db 88
db 58
db 9
db 37
db 48
db 56
db 120
db 61
db 37
db 100
db 10
db 0
align 1
L3 label byte
db 85
db 83
db 72
db 82
db 84
db 95
db 77
db 65
db 88
db 58
db 9
db 37
db 48
db 56
db 120
db 61
db 37
db 100
db 10
db 0
align 1
L2 label byte
db 85
db 67
db 72
db 65
db 82
db 95
db 77
db 65
db 88
db 58
db 9
db 37
db 48
db 56
db 120
db 61
db 37
db 100
db 10
db 0
_TEXT ends
end

View file

@ -0,0 +1,179 @@
Lest this program stop prematurely, i.e. before displaying
`END OF TEST',
try to persuade the computer NOT to terminate execution when an
error like Over/Underflow or Division by Zero occurs, but rather
to persevere with a surrogate value after, perhaps, displaying some
warning. If persuasion avails naught, don't despair but run this
program anyway to see how many milestones it passes, and then
amend it to make further progress.
Answer questions with Y, y, N or n (unless otherwise indicated).
Diagnosis resumes after milestone Number 0 Page: 1
Users are invited to help debug and augment this program so it will
cope with unanticipated and newly uncovered arithmetic pathologies.
Please send suggestions and interesting results to
Richard Karpinski
Computer Center U-76
University of California
San Francisco, CA 94143-0704, USA
In doing so, please include the following information:
Precision: double;
Version: 10 February 1989;
Computer:
Compiler:
Optimization level:
Other relevant compiler options:
Diagnosis resumes after milestone Number 1 Page: 2
Running this program should reveal these characteristics:
Radix = 1, 2, 4, 8, 10, 16, 100, 256 ...
Precision = number of significant digits carried.
U2 = Radix/Radix^Precision = One Ulp
(OneUlpnit in the Last Place) of 1.000xxx .
U1 = 1/Radix^Precision = One Ulp of numbers a little less than 1.0 .
Adequacy of guard digits for Mult., Div. and Subt.
Whether arithmetic is chopped, correctly rounded, or something else
for Mult., Div., Add/Subt. and Sqrt.
Whether a Sticky Bit used correctly for rounding.
UnderflowThreshold = an underflow threshold.
E0 and PseudoZero tell whether underflow is abrupt, gradual, or fuzzy.
V = an overflow threshold, roughly.
V0 tells, roughly, whether Infinity is represented.
Comparisions are checked for consistency with subtraction
and for contamination with pseudo-zeros.
Sqrt is tested. Y^X is not tested.
Extra-precise subexpressions are revealed but NOT YET tested.
Decimal-Binary conversion is NOT YET tested for accuracy.
Diagnosis resumes after milestone Number 2 Page: 3
The program attempts to discriminate among
FLAWs, like lack of a sticky bit,
Serious DEFECTs, like lack of a guard digit, and
FAILUREs, like 2+2 == 5 .
Failures may confound subsequent diagnoses.
The diagnostic capabilities of this program go beyond an earlier
program called `MACHAR', which can be found at the end of the
book `Software Manual for the Elementary Functions' (1980) by
W. J. Cody and W. Waite. Although both programs try to discover
the Radix, Precision and range (over/underflow thresholds)
of the arithmetic, this program tries to cope with a wider variety
of pathologies, and to say how well the arithmetic is implemented.
The program is based upon a conventional radix representation for
floating-point numbers, but also allows logarithmic encoding
as used by certain early WANG machines.
BASIC version of this program (C) 1983 by Prof. W. M. Kahan;
see source comments for more history.
Diagnosis resumes after milestone Number 3 Page: 4
Program is now RUNNING tests on small integers:
-1, 0, 1/2, 1, 2, 3, 4, 5, 9, 27, 32 & 240 are O.K.
Searching for Radix and Precision.
Radix = 2.000000 .
Closest relative separation found is U1 = 1.1102230e-016 .
Recalculating radix and precision
confirms closest relative separation U1 .
Radix confirmed.
The number of significant digits of the Radix is 53.000000 .
Diagnosis resumes after milestone Number 30 Page: 5
Subtraction appears to be normalized, as it should be.
Checking for guard digit in *, /, and -.
*, /, and - appear to have guard digits, as they should.
Diagnosis resumes after milestone Number 40 Page: 6
Checking rounding on multiply, divide and add/subtract.
Multiplication appears to round correctly.
Division appears to round correctly.
Addition/Subtraction appears to round correctly.
Checking for sticky bit.
Sticky bit apparently used correctly.
Does Multiplication commute? Testing on 20 random pairs.
No failures found in 20 integer pairs.
Running test of square root(x).
Testing if sqrt(X * X) == X for 20 Integers X.
Test for sqrt monotonicity.
sqrt has passed a test for Monotonicity.
Testing whether sqrt is rounded or chopped.
Square root appears to be correctly rounded.
Diagnosis resumes after milestone Number 90 Page: 7
Testing powers Z^i for small Integers Z and i.
... no discrepancis found.
Seeking Underflow thresholds UfThold and E0.
Smallest strictly positive number found is E0 = 4.94066e-324 .
Since comparison denies Z = 0, evaluating (Z + Z) / Z should be safe.
What the machine gets for (Z + Z) / Z is 2.00000000000000000e+000 .
This is O.K., provided Over/Underflow has NOT just been signaled.
Underflow is gradual; it incurs Absolute Error =
(roundoff in UfThold) < E0.
The Underflow threshold is 2.22507385850720190e-308, below which
calculation may suffer larger Relative error than merely roundoff.
Since underflow occurs below the threshold
UfThold = (2.00000000000000000e+000) ^ (-1.02200000000000000e+003)
only underflow should afflict the expression
(2.00000000000000000e+000) ^ (-1.02200000000000000e+003);
actually calculating yields: 0.00000000000000000e+000 .
This computed value is O.K.
Testing X^((X + 1) / (X - 1)) vs. exp(2) = 7.38905609893065220e+000 as X -> 1.
Accuracy seems adequate.
Testing powers Z^Q at four nearly extreme values.
... no discrepancies found.
Diagnosis resumes after milestone Number 160 Page: 8
Searching for Overflow threshold:
This may generate an error.
Can `Z = -Y' overflow?
Trying it on Y = -1.#INF0000000000000e+000 .
Seems O.K.
Overflow threshold is V = 1.79769313486231570e+308 .
Overflow saturates at V0 = 1.#INF0000000000000e+000 .
No Overflow should be signaled for V * 1 = 1.79769313486231570e+308
nor for V / 1 = 1.79769313486231570e+308 .
Any overflow signal separating this * from the one
above is a DEFECT.
Diagnosis resumes after milestone Number 190 Page: 9
What message and/or values does Division by Zero produce?
Trying to compute 1 / 0 produces ... 1.#INF000e+000 .
Trying to compute 0 / 0 produces ... -1.#IND000e+000 .
Diagnosis resumes after milestone Number 220 Page: 10
No failures, defects nor flaws have been discovered.
Rounding appears to conform to the proposed IEEE standard P754,
except for possibly Double Rounding during Gradual Underflow.
The arithmetic diagnosed appears to be Excellent!
END OF TEST.

View file

@ -0,0 +1,16 @@
tst/paranoia.c:1867: warning: missing return value
tst/paranoia.c:1874: warning: missing return value
tst/paranoia.c:1884: warning: missing return value
tst/paranoia.c:1924: warning: missing return value
tst/paranoia.c:1939: warning: missing return value
tst/paranoia.c:1956: warning: missing return value
tst/paranoia.c:1975: warning: missing return value
tst/paranoia.c:1988: warning: missing return value
tst/paranoia.c:1995: warning: missing return value
tst/paranoia.c:2055: warning: missing return value
tst/paranoia.c:2062: warning: missing return value
tst/paranoia.c:2070: warning: missing return value
tst/paranoia.c:2087: warning: missing return value
tst/paranoia.c:2115: warning: missing return value
tst/paranoia.c:2144: warning: missing return value
tst/paranoia.c:2173: warning: missing return value

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,20 @@
exchange(1,9)
exchange(3,7)
exchange(5,6)
exchange(0,5)
exchange(0,3)
exchange(0,0)
exchange(1,2)
exchange(6,6)
exchange(8,9)
exchange(7,8)
-51
-1
0
1
3
10
18
32
567
789

View file

@ -0,0 +1,5 @@
tst/sort.c:23: warning: missing return value
tst/sort.c:30: warning: missing return value
tst/sort.c:37: warning: missing return value
tst/sort.c:41: warning: missing return value
tst/sort.c:65: warning: missing return value

View file

@ -0,0 +1,324 @@
.486
.model flat
extrn __fltused:near
extrn __ftol:near
_DATA segment
public _in
align 4
_in label byte
dd 10
dd 32
dd -1
dd 567
dd 3
dd 18
dd 1
dd -51
dd 789
dd 0
public _main
_DATA ends
_TEXT segment
_main:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,4
push 10
lea edi,(_in)
push edi
call _sort
add esp,8
mov dword ptr (-4)[ebp],0
jmp L5
L2:
mov edi,dword ptr (-4)[ebp]
mov edi,dword ptr (_in)[edi*4]
push edi
call _putd
add esp,4
push 10
call _putchar
add esp,4
L3:
inc dword ptr (-4)[ebp]
L5:
mov edi,dword ptr (-4)[ebp]
cmp edi,10
jb L2
mov eax,0
L1:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _putd
_putd:
push ebx
push esi
push edi
push ebp
mov ebp,esp
cmp dword ptr (20)[ebp],0
jge L7
push 45
call _putchar
add esp,4
neg dword ptr (20)[ebp]
L7:
mov eax,dword ptr (20)[ebp]
mov edi,10
cdq
idiv edi
cmp eax,0
je L9
mov eax,dword ptr (20)[ebp]
mov edi,10
cdq
idiv edi
push eax
call _putd
add esp,4
L9:
mov eax,dword ptr (20)[ebp]
mov edi,10
cdq
idiv edi
lea edi,(48)[edx]
push edi
call _putchar
add esp,4
mov eax,0
L6:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _sort
_sort:
push ebx
push esi
push edi
push ebp
mov ebp,esp
mov edi,dword ptr (24)[ebp]
sub edi,1
mov dword ptr (24)[ebp],edi
push edi
push 0
mov edi,dword ptr (20)[ebp]
mov dword ptr (_xx),edi
push edi
call _quick
add esp,12
mov eax,0
L11:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _quick
_quick:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,4
mov edi,dword ptr (28)[ebp]
cmp dword ptr (24)[ebp],edi
jl L13
jmp L12
L13:
mov edi,dword ptr (28)[ebp]
push edi
mov edi,dword ptr (24)[ebp]
push edi
mov edi,dword ptr (20)[ebp]
push edi
call _partition
add esp,12
mov dword ptr (-4)[ebp],eax
mov edi,dword ptr (-4)[ebp]
sub edi,1
push edi
mov edi,dword ptr (24)[ebp]
push edi
mov edi,dword ptr (20)[ebp]
push edi
call _quick
add esp,12
mov edi,dword ptr (28)[ebp]
push edi
mov edi,dword ptr (-4)[ebp]
lea edi,(1)[edi]
push edi
mov edi,dword ptr (20)[ebp]
push edi
call _quick
add esp,12
mov eax,0
L12:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _partition
_partition:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,8
inc dword ptr (28)[ebp]
mov edi,dword ptr (24)[ebp]
mov dword ptr (-8)[ebp],edi
mov edi,dword ptr (-8)[ebp]
mov esi,dword ptr (20)[ebp]
mov edi,dword ptr [esi][edi*4]
mov dword ptr (-4)[ebp],edi
jmp L17
L16:
inc dword ptr (24)[ebp]
jmp L20
L19:
inc dword ptr (24)[ebp]
L20:
mov edi,dword ptr (24)[ebp]
mov esi,dword ptr (20)[ebp]
mov ebx,dword ptr (-4)[ebp]
cmp dword ptr [esi][edi*4],ebx
jl L19
dec dword ptr (28)[ebp]
jmp L23
L22:
dec dword ptr (28)[ebp]
L23:
mov edi,dword ptr (28)[ebp]
mov esi,dword ptr (20)[ebp]
mov ebx,dword ptr (-4)[ebp]
cmp dword ptr [esi][edi*4],ebx
jg L22
mov edi,dword ptr (28)[ebp]
cmp dword ptr (24)[ebp],edi
jge L25
mov edi,dword ptr (20)[ebp]
mov esi,dword ptr (28)[ebp]
lea esi,[edi][esi*4]
push esi
mov esi,dword ptr (24)[ebp]
lea edi,[edi][esi*4]
push edi
call _exchange
add esp,8
L25:
L17:
mov edi,dword ptr (28)[ebp]
cmp dword ptr (24)[ebp],edi
jl L16
mov edi,dword ptr (20)[ebp]
mov esi,dword ptr (28)[ebp]
lea esi,[edi][esi*4]
push esi
mov esi,dword ptr (-8)[ebp]
lea edi,[edi][esi*4]
push edi
call _exchange
add esp,8
mov eax,dword ptr (28)[ebp]
L15:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _exchange
_exchange:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,4
mov edi,dword ptr (_xx)
mov esi,4
mov ebx,dword ptr (24)[ebp]
sub ebx,edi
mov eax,ebx
cdq
idiv esi
push eax
mov ebx,dword ptr (20)[ebp]
sub ebx,edi
mov eax,ebx
cdq
idiv esi
push eax
lea edi,(L28)
push edi
call _printf
add esp,12
mov edi,dword ptr (20)[ebp]
mov esi,dword ptr [edi]
mov dword ptr (-4)[ebp],esi
mov esi,dword ptr (24)[ebp]
mov esi,dword ptr [esi]
mov dword ptr [edi],esi
mov edi,dword ptr (24)[ebp]
mov esi,dword ptr (-4)[ebp]
mov dword ptr [edi],esi
mov eax,0
L27:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
_TEXT ends
extrn _printf:near
_TEXT segment
_TEXT ends
extrn _putchar:near
_TEXT segment
_TEXT ends
_DATA segment
public _xx
align 4
_xx label byte
db 4 dup (0)
_DATA ends
_TEXT segment
align 1
L28 label byte
db 101
db 120
db 99
db 104
db 97
db 110
db 103
db 101
db 40
db 37
db 100
db 44
db 37
db 100
db 41
db 10
db 0
_TEXT ends
end

View file

View file

@ -0,0 +1,6 @@
tst/spill.c:1: warning: missing return value
tst/spill.c:3: warning: missing return value
tst/spill.c:5: warning: missing return value
tst/spill.c:7: warning: missing return value
tst/spill.c:9: warning: missing return value
tst/spill.c:17: warning: missing return value

View file

@ -0,0 +1,259 @@
.486
.model flat
extrn __fltused:near
extrn __ftol:near
public _main
_TEXT segment
_main:
push ebx
push esi
push edi
push ebp
mov ebp,esp
mov eax,0
L1:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _f
_f:
push ebx
push esi
push edi
push ebp
mov ebp,esp
call _f
add esp,0
mov edi,eax
call _f
add esp,0
lea edi,[eax][edi]
mov dword ptr (20)[ebp],edi
mov eax,0
L2:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _f2
_f2:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,4
call _f
add esp,0
mov edi,eax
cmp dword ptr (20)[ebp],0
je L5
call _f
add esp,0
mov esi,eax
mov dword ptr (-4)[ebp],esi
jmp L6
L5:
mov dword ptr (-4)[ebp],1
L6:
mov esi,dword ptr (-4)[ebp]
lea edi,[esi][edi]
mov dword ptr (20)[ebp],edi
mov eax,0
L3:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _f3
_f3:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,44
mov dword ptr (-4)[ebp],0
mov dword ptr (-8)[ebp],0
mov dword ptr (-12)[ebp],0
mov dword ptr (-16)[ebp],0
mov dword ptr (-20)[ebp],0
mov dword ptr (-24)[ebp],0
mov dword ptr (-28)[ebp],0
mov dword ptr (-32)[ebp],0
mov dword ptr (-36)[ebp],0
mov dword ptr (-40)[ebp],0
mov edi,dword ptr (24)[ebp]
lea esi,(4)[edi]
mov dword ptr (24)[ebp],esi
cmp dword ptr (20)[ebp],0
je L9
call _f
add esp,0
mov esi,eax
mov dword ptr (-44)[ebp],esi
jmp L10
L9:
mov dword ptr (-44)[ebp],0
L10:
mov esi,dword ptr (-44)[ebp]
mov dword ptr [edi],esi
mov eax,0
L7:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _f4
_f4:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,52
mov dword ptr (-4)[ebp],0
mov dword ptr (-8)[ebp],0
mov dword ptr (-12)[ebp],0
mov dword ptr (-16)[ebp],0
mov dword ptr (-20)[ebp],0
mov dword ptr (-24)[ebp],0
mov edi,dword ptr (_i)
lea esi,[edi*8]
fld qword ptr (_a)[esi]
fstp qword ptr (-36)[ebp]
fld qword ptr (_b)[esi]
fstp qword ptr (-44)[ebp]
fld qword ptr (-36)[ebp]
fadd qword ptr (-44)[ebp]
fld qword ptr (L15)
fcompp
fstsw ax
sahf
je L13
cmp edi,0
je L13
fld qword ptr (-36)[ebp]
fsub qword ptr (-44)[ebp]
fld qword ptr (L15)
fcompp
fstsw ax
sahf
je L13
mov dword ptr (-28)[ebp],1
jmp L14
L13:
mov dword ptr (-28)[ebp],0
L14:
mov edi,dword ptr (-28)[ebp]
mov dword ptr (_i),edi
mov eax,0
L11:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _f5
_f5:
push ebx
push esi
push edi
push ebp
mov ebp,esp
mov edi,dword ptr (_k)
mov esi,dword ptr (_m)
mov ebx,dword ptr (_A)
mov edx,edi
imul edx,esi
lea edx,[ebx][edx*8]
mov ecx,dword ptr (_j)
mov eax,ecx
imul eax,esi
lea esi,[ebx][eax*8]
mov ebx,dword ptr (_n)
mov eax,dword ptr (_B)
imul edi,ebx
lea edi,[eax][edi*8]
imul ecx,ebx
lea ebx,[eax][ecx*8]
fld qword ptr [edx]
fmul qword ptr [esi]
fld qword ptr [edi]
fmul qword ptr [ebx]
faddp st(1),st
fstp qword ptr (_x)
fld qword ptr [edx]
fmul qword ptr [ebx]
fld qword ptr [edi]
fmul qword ptr [esi]
fsubp st(1),st
fstp qword ptr (_x)
mov eax,0
L16:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
_TEXT ends
_DATA segment
public _x
align 4
_x label byte
db 8 dup (0)
public _B
align 4
_B label byte
db 4 dup (0)
public _A
align 4
_A label byte
db 4 dup (0)
public _n
align 4
_n label byte
db 4 dup (0)
public _m
align 4
_m label byte
db 4 dup (0)
public _k
align 4
_k label byte
db 4 dup (0)
public _j
align 4
_j label byte
db 4 dup (0)
public _i
align 4
_i label byte
db 4 dup (0)
public _b
align 4
_b label byte
db 80 dup (0)
public _a
align 4
_a label byte
db 80 dup (0)
_DATA ends
_TEXT segment
align 4
L15 label byte
dd 00H
dd 00H
_TEXT ends
end

View file

@ -0,0 +1,6 @@
test 1
test 2
test 3
test 4
test 5.000000
{1 2 3 4} {1 2 3 4} {1 2 3 4} {1 2 3 4} {1 2 3 4} {1 2 3 4}

View file

@ -0,0 +1 @@
tst/stdarg.c:51: warning: missing return value

View file

@ -0,0 +1,415 @@
.486
.model flat
extrn __fltused:near
extrn __ftol:near
_DATA segment
public _x
align 4
_x label byte
dd 1
dd 2
dd 3
dd 4
public _main
_DATA ends
_TEXT segment
_main:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,8
lea edi,(L2)
push edi
call _print
add esp,4
lea edi,(L4)
push edi
lea edi,(L3)
push edi
call _print
add esp,8
push 10
push 3
lea edi,(L5)
push edi
call _print
add esp,12
push 10
push 4
lea edi,(L8)
push edi
lea edi,(L7)
push edi
lea edi,(L6)
push edi
call _print
add esp,20
push 10
fld qword ptr (L10)
sub esp,8
fstp qword ptr [esp]
lea edi,(L8)
push edi
lea edi,(L7)
push edi
lea edi,(L9)
push edi
call _print
add esp,24
lea edi,(_x)
mov dword ptr (-8)[ebp],edi
mov esi,edi
mov dword ptr (-4)[ebp],esi
sub esp,16
mov edi,esp
mov ecx,16
rep movsb
mov edi,dword ptr (-8)[ebp]
mov esi,edi
sub esp,16
mov edi,esp
mov ecx,16
rep movsb
mov edi,dword ptr (-8)[ebp]
mov esi,edi
sub esp,16
mov edi,esp
mov ecx,16
rep movsb
mov edi,dword ptr (-8)[ebp]
mov esi,edi
sub esp,16
mov edi,esp
mov ecx,16
rep movsb
mov edi,dword ptr (-8)[ebp]
mov esi,edi
sub esp,16
mov edi,esp
mov ecx,16
rep movsb
mov edi,dword ptr (-8)[ebp]
mov esi,edi
sub esp,16
mov edi,esp
mov ecx,16
rep movsb
lea edi,(L11)
push edi
call _print
add esp,100
mov eax,0
L1:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _print
_print:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,28
lea edi,(24)[ebp]
mov dword ptr (-4)[ebp],edi
jmp L17
L14:
mov edi,dword ptr (20)[ebp]
movsx edi,byte ptr [edi]
cmp edi,37
jne L18
mov edi,dword ptr (20)[ebp]
lea edi,(1)[edi]
mov dword ptr (20)[ebp],edi
movsx edi,byte ptr [edi]
mov dword ptr (-8)[ebp],edi
mov edi,dword ptr (-8)[ebp]
cmp edi,115
je L34
cmp edi,115
jg L39
L38:
mov edi,dword ptr (-8)[ebp]
cmp edi,98
jl L20
cmp edi,102
jg L20
jmp dword ptr (L40-392)[edi*4]
_TEXT ends
_TEXT segment
align 4
L40 label byte
dd L23
dd L28
dd L30
dd L20
dd L36
_TEXT ends
_TEXT segment
L39:
cmp dword ptr (-8)[ebp],119
je L32
jmp L20
L23:
mov edi,dword ptr (-4)[ebp]
lea edi,(16)[edi]
mov dword ptr (-28)[ebp],edi
mov dword ptr (-4)[ebp],edi
lea edi,(-24)[ebp]
mov esi,dword ptr (-28)[ebp]
lea esi,(-16)[esi]
mov ecx,16
rep movsb
mov edi,dword ptr (-12)[ebp]
push edi
mov edi,dword ptr (-16)[ebp]
push edi
mov edi,dword ptr (-20)[ebp]
push edi
mov edi,dword ptr (-24)[ebp]
push edi
lea edi,(L24)
push edi
call _printf
add esp,20
jmp L19
L28:
mov edi,dword ptr (-4)[ebp]
lea edi,(4)[edi]
mov dword ptr (-4)[ebp],edi
movsx edi,byte ptr (-4)[edi]
push edi
lea edi,(L29)
push edi
call _printf
add esp,8
jmp L19
L30:
mov edi,dword ptr (-4)[ebp]
lea edi,(4)[edi]
mov dword ptr (-4)[ebp],edi
mov edi,dword ptr (-4)[edi]
push edi
lea edi,(L31)
push edi
call _printf
add esp,8
jmp L19
L32:
mov edi,dword ptr (-4)[ebp]
lea edi,(4)[edi]
mov dword ptr (-4)[ebp],edi
movsx edi,word ptr (-4)[edi]
push edi
lea edi,(L33)
push edi
call _printf
add esp,8
jmp L19
L34:
mov edi,dword ptr (-4)[ebp]
lea edi,(4)[edi]
mov dword ptr (-4)[ebp],edi
mov edi,dword ptr (-4)[edi]
push edi
lea edi,(L35)
push edi
call _printf
add esp,8
jmp L19
L36:
mov edi,dword ptr (-4)[ebp]
lea edi,(8)[edi]
mov dword ptr (-4)[ebp],edi
fld qword ptr (-8)[edi]
sub esp,8
fstp qword ptr [esp]
lea edi,(L37)
push edi
call _printf
add esp,12
jmp L19
L20:
mov edi,dword ptr (20)[ebp]
movsx edi,byte ptr [edi]
push edi
lea edi,(L29)
push edi
call _printf
add esp,8
jmp L19
L18:
mov edi,dword ptr (20)[ebp]
movsx edi,byte ptr [edi]
push edi
lea edi,(L29)
push edi
call _printf
add esp,8
L19:
L15:
inc dword ptr (20)[ebp]
L17:
mov edi,dword ptr (20)[ebp]
movsx edi,byte ptr [edi]
cmp edi,0
jne L14
mov dword ptr (-4)[ebp],0
mov eax,0
L12:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
_TEXT ends
extrn _printf:near
_TEXT segment
_TEXT ends
_TEXT segment
align 1
L37 label byte
db 37
db 102
db 0
align 1
L35 label byte
db 37
db 115
db 0
align 1
L33 label byte
db 37
db 120
db 0
align 1
L31 label byte
db 37
db 100
db 0
align 1
L29 label byte
db 37
db 99
db 0
align 1
L24 label byte
db 123
db 37
db 100
db 32
db 37
db 100
db 32
db 37
db 100
db 32
db 37
db 100
db 125
db 0
align 1
L11 label byte
db 37
db 98
db 32
db 37
db 98
db 32
db 37
db 98
db 32
db 37
db 98
db 32
db 37
db 98
db 32
db 37
db 98
db 10
db 0
align 4
L10 label byte
dd 00H
dd 040140000H
align 1
L9 label byte
db 37
db 115
db 37
db 115
db 32
db 37
db 102
db 37
db 99
db 0
align 1
L8 label byte
db 115
db 116
db 0
align 1
L7 label byte
db 116
db 101
db 0
align 1
L6 label byte
db 37
db 115
db 37
db 115
db 32
db 37
db 119
db 37
db 99
db 0
align 1
L5 label byte
db 116
db 101
db 115
db 116
db 32
db 37
db 100
db 37
db 99
db 0
align 1
L4 label byte
db 50
db 0
align 1
L3 label byte
db 116
db 101
db 115
db 116
db 32
db 37
db 115
db 10
db 0
align 1
L2 label byte
db 116
db 101
db 115
db 116
db 32
db 49
db 10
db 0
_TEXT ends
end

View file

@ -0,0 +1,5 @@
(-1,-1) is not within [10,10; 310,310]
(1,1) is not within [10,10; 310,310]
(20,300) is within [10,10; 310,310]
(500,400) is not within [10,10; 310,310]
ab

View file

@ -0,0 +1,2 @@
tst/struct.c:49: warning: missing return value
tst/struct.c:68: warning: missing return value

View file

@ -0,0 +1,453 @@
.486
.model flat
extrn __fltused:near
extrn __ftol:near
public _addpoint
_TEXT segment
_addpoint:
push ebx
push esi
push edi
push ebp
mov ebp,esp
mov edi,dword ptr (32)[ebp]
add dword ptr (24)[ebp],edi
mov edi,dword ptr (36)[ebp]
add dword ptr (28)[ebp],edi
mov edi,dword ptr (20)[ebp]
lea esi,(24)[ebp]
mov ecx,8
rep movsb
L1:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _canonrect
_canonrect:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,32
mov edi,dword ptr (32)[ebp]
cmp dword ptr (24)[ebp],edi
jge L10
mov edi,dword ptr (24)[ebp]
mov dword ptr (-20)[ebp],edi
jmp L11
L10:
mov edi,dword ptr (32)[ebp]
mov dword ptr (-20)[ebp],edi
L11:
mov edi,dword ptr (-20)[ebp]
mov dword ptr (-16)[ebp],edi
mov edi,dword ptr (36)[ebp]
cmp dword ptr (28)[ebp],edi
jge L20
mov edi,dword ptr (28)[ebp]
mov dword ptr (-24)[ebp],edi
jmp L21
L20:
mov edi,dword ptr (36)[ebp]
mov dword ptr (-24)[ebp],edi
L21:
mov edi,dword ptr (-24)[ebp]
mov dword ptr (-12)[ebp],edi
mov edi,dword ptr (32)[ebp]
cmp dword ptr (24)[ebp],edi
jle L26
mov edi,dword ptr (24)[ebp]
mov dword ptr (-28)[ebp],edi
jmp L27
L26:
mov edi,dword ptr (32)[ebp]
mov dword ptr (-28)[ebp],edi
L27:
mov edi,dword ptr (-28)[ebp]
mov dword ptr (-8)[ebp],edi
mov edi,dword ptr (36)[ebp]
cmp dword ptr (28)[ebp],edi
jle L37
mov edi,dword ptr (28)[ebp]
mov dword ptr (-32)[ebp],edi
jmp L38
L37:
mov edi,dword ptr (36)[ebp]
mov dword ptr (-32)[ebp],edi
L38:
mov edi,dword ptr (-32)[ebp]
mov dword ptr (-4)[ebp],edi
mov edi,dword ptr (20)[ebp]
lea esi,(-16)[ebp]
mov ecx,16
rep movsb
L5:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _makepoint
_makepoint:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,8
mov edi,dword ptr (24)[ebp]
mov dword ptr (-8)[ebp],edi
mov edi,dword ptr (28)[ebp]
mov dword ptr (-4)[ebp],edi
mov edi,dword ptr (20)[ebp]
lea esi,(-8)[ebp]
mov ecx,8
rep movsb
L39:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _makerect
_makerect:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,16
lea edi,(-16)[ebp]
lea esi,(24)[ebp]
mov ecx,8
rep movsb
lea edi,(-8)[ebp]
lea esi,(32)[ebp]
mov ecx,8
rep movsb
lea esi,(-16)[ebp]
sub esp,16
mov edi,esp
mov ecx,16
rep movsb
mov edi,dword ptr (20)[ebp]
push edi
call _canonrect
add esp,20
L42:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _ptinrect
_ptinrect:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,4
mov edi,dword ptr (20)[ebp]
cmp edi,dword ptr (28)[ebp]
jl L53
cmp edi,dword ptr (36)[ebp]
jge L53
mov edi,dword ptr (32)[ebp]
cmp dword ptr (24)[ebp],edi
jl L53
mov edi,dword ptr (40)[ebp]
cmp dword ptr (24)[ebp],edi
jge L53
mov dword ptr (-4)[ebp],1
jmp L54
L53:
mov dword ptr (-4)[ebp],0
L54:
mov eax,dword ptr (-4)[ebp]
L45:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
_TEXT ends
_DATA segment
public _y
align 4
_y label byte
db 97
db 98
db 0
db 1 dup (0)
public _odd
_DATA ends
_TEXT segment
_odd:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,4
lea edi,(-4)[ebp]
lea esi,(20)[ebp]
mov ecx,4
rep movsb
lea edi,(-4)[ebp]
push edi
lea edi,(L56)
push edi
call _printf
add esp,8
mov eax,0
L55:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
_TEXT ends
_TEXT segment
align 4
L58 label byte
dd 0
dd 0
align 4
L59 label byte
dd 320
dd 320
align 4
L60 label byte
dd -1
dd -1
dd 1
dd 1
dd 20
dd 300
dd 500
dd 400
public _main
_TEXT ends
_TEXT segment
_main:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,108
lea edi,(-68)[ebp]
lea esi,(L58)
mov ecx,8
rep movsb
lea edi,(-76)[ebp]
lea esi,(L59)
mov ecx,8
rep movsb
lea edi,(-36)[ebp]
lea esi,(L60)
mov ecx,32
rep movsb
push -10
push -10
lea edi,(-84)[ebp]
push edi
call _makepoint
add esp,12
lea esi,(-84)[ebp]
sub esp,8
mov edi,esp
mov ecx,8
rep movsb
lea esi,(-76)[ebp]
sub esp,8
mov edi,esp
mov ecx,8
rep movsb
lea edi,(-92)[ebp]
push edi
call _addpoint
add esp,20
push 10
push 10
lea edi,(-100)[ebp]
push edi
call _makepoint
add esp,12
lea esi,(-100)[ebp]
sub esp,8
mov edi,esp
mov ecx,8
rep movsb
lea esi,(-68)[ebp]
sub esp,8
mov edi,esp
mov ecx,8
rep movsb
lea edi,(-108)[ebp]
push edi
call _addpoint
add esp,20
lea esi,(-108)[ebp]
sub esp,8
mov edi,esp
mov ecx,8
rep movsb
lea esi,(-92)[ebp]
sub esp,8
mov edi,esp
mov ecx,8
rep movsb
lea edi,(-52)[ebp]
push edi
call _makerect
add esp,20
mov dword ptr (-4)[ebp],0
jmp L64
L61:
mov edi,dword ptr (-4)[ebp]
lea edi,[edi*8]
mov esi,dword ptr (-32)[ebp][edi]
push esi
mov edi,dword ptr (-36)[ebp][edi]
push edi
lea edi,(-60)[ebp]
push edi
call _makepoint
add esp,12
mov edi,dword ptr (-56)[ebp]
push edi
mov edi,dword ptr (-4)[ebp]
mov edi,dword ptr (-36)[ebp][edi*8]
push edi
lea edi,(L65)
push edi
call _printf
add esp,12
lea esi,(-52)[ebp]
sub esp,16
mov edi,esp
mov ecx,16
rep movsb
lea esi,(-60)[ebp]
sub esp,8
mov edi,esp
mov ecx,8
rep movsb
call _ptinrect
add esp,24
cmp eax,0
jne L68
lea edi,(L70)
push edi
call _printf
add esp,4
L68:
mov edi,dword ptr (-40)[ebp]
push edi
mov edi,dword ptr (-44)[ebp]
push edi
mov edi,dword ptr (-48)[ebp]
push edi
mov edi,dword ptr (-52)[ebp]
push edi
lea edi,(L71)
push edi
call _printf
add esp,20
L62:
inc dword ptr (-4)[ebp]
L64:
mov edi,dword ptr (-4)[ebp]
cmp edi,4
jb L61
lea esi,(_y)
sub esp,4
mov edi,esp
mov ecx,4
rep movsb
call _odd
add esp,4
push 0
call _exit
add esp,4
mov eax,0
L57:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
_TEXT ends
extrn _exit:near
_TEXT segment
_TEXT ends
extrn _printf:near
_TEXT segment
_TEXT ends
_TEXT segment
align 1
L71 label byte
db 119
db 105
db 116
db 104
db 105
db 110
db 32
db 91
db 37
db 100
db 44
db 37
db 100
db 59
db 32
db 37
db 100
db 44
db 37
db 100
db 93
db 10
db 0
align 1
L70 label byte
db 110
db 111
db 116
db 32
db 0
align 1
L65 label byte
db 40
db 37
db 100
db 44
db 37
db 100
db 41
db 32
db 105
db 115
db 32
db 0
align 1
L56 label byte
db 37
db 115
db 10
db 0
_TEXT ends
end

View file

@ -0,0 +1,76 @@
b = 0x8
f = 0xc
n = 0xa
r = 0xd
t = 0x9
v = 0xb
x = 0x78
f:
x = 0
x = 1
x = 2
x = 2
x = 2
x = 2
x = 2
x = 7
x = 8
x = 9
x = 9
x = 9
x = 9
x = 9
x = 9
x = 9
x = 16
x = 17
x = 18
x = 19
x = 20
g:
1 1
1 2
2 3
2 4
2 5
3 6
d 6
3 7
d 7
3 8
d 8
d 9
d 10
h:
i = 8
i = 16
i = 120
i = 128
i = 248
i = 264
i = 272
i = 280
i = 288
i = 296
i = 304
i = 312
488 defaults
x = 0x1000000
x = 0x2000000
x = 0x3000000
x = 0x4000000
x = 0x5000000
x = 0x6000000 (default)
x = 0x7000000 (default)
0
1
2
3
4
5
0
1
2
3
4
5

View file

@ -0,0 +1,5 @@
tst/switch.c:55: warning: missing return value
tst/switch.c:73: warning: missing return value
tst/switch.c:97: warning: missing return value
tst/switch.c:112: warning: missing return value
tst/switch.c:137: warning: missing return value

View file

@ -0,0 +1,960 @@
.486
.model flat
extrn __fltused:near
extrn __ftol:near
public _main
_TEXT segment
_main:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,8
lea edi,(L6)
mov dword ptr (-4)[ebp],edi
jmp L5
L2:
mov edi,dword ptr (-4)[ebp]
movsx edi,byte ptr [edi]
push edi
call _backslash
add esp,4
push eax
mov edi,dword ptr (-4)[ebp]
movsx edi,byte ptr [edi]
push edi
lea edi,(L7)
push edi
call _printf
add esp,12
L3:
inc dword ptr (-4)[ebp]
L5:
mov edi,dword ptr (-4)[ebp]
movsx edi,byte ptr [edi]
cmp edi,0
jne L2
call _f
add esp,0
call _g
add esp,0
call _h
add esp,0
mov dword ptr (-8)[ebp],16777216
jmp L11
L8:
mov edi,dword ptr (-8)[ebp]
push edi
call _big
add esp,4
L9:
add dword ptr (-8)[ebp],16777216
L11:
mov edi,dword ptr (-8)[ebp]
and edi,117440512
cmp edi,0
jne L8
call _limit
add esp,0
mov eax,0
L1:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _backslash
_backslash:
push ebx
push esi
push edi
push ebp
mov ebp,esp
mov edi,dword ptr (20)[ebp]
cmp edi,102
je L16
cmp edi,102
jg L22
L21:
cmp dword ptr (20)[ebp],98
je L15
jmp L13
L22:
mov edi,dword ptr (20)[ebp]
cmp edi,110
je L17
cmp edi,110
jl L13
L23:
mov edi,dword ptr (20)[ebp]
cmp edi,114
je L18
cmp edi,116
je L19
cmp edi,118
je L20
jmp L13
L15:
mov eax,8
jmp L12
L16:
mov eax,12
jmp L12
L17:
mov eax,10
jmp L12
L18:
mov eax,13
jmp L12
L19:
mov eax,9
jmp L12
L20:
mov eax,11
jmp L12
L13:
mov eax,dword ptr (20)[ebp]
L12:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _f
_f:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,12
mov dword ptr (-8)[ebp],0
lea edi,(L25)
push edi
call _printf
add esp,4
mov dword ptr (-4)[ebp],0
L26:
mov edi,dword ptr (-4)[ebp]
mov dword ptr (-12)[ebp],edi
mov edi,dword ptr (-4)[ebp]
cmp edi,1
jl L30
cmp edi,20
jg L30
jmp dword ptr (L42-4)[edi*4]
_TEXT ends
_TEXT segment
align 4
L42 label byte
dd L32
dd L33
dd L30
dd L30
dd L30
dd L30
dd L34
dd L35
dd L36
dd L30
dd L30
dd L30
dd L30
dd L30
dd L30
dd L37
dd L38
dd L39
dd L40
dd L41
_TEXT ends
_TEXT segment
L32:
mov edi,dword ptr (-4)[ebp]
mov dword ptr (-8)[ebp],edi
jmp L31
L33:
mov edi,dword ptr (-4)[ebp]
mov dword ptr (-8)[ebp],edi
jmp L31
L34:
mov edi,dword ptr (-4)[ebp]
mov dword ptr (-8)[ebp],edi
jmp L31
L35:
mov edi,dword ptr (-4)[ebp]
mov dword ptr (-8)[ebp],edi
jmp L31
L36:
mov edi,dword ptr (-4)[ebp]
mov dword ptr (-8)[ebp],edi
jmp L31
L37:
mov edi,dword ptr (-4)[ebp]
mov dword ptr (-8)[ebp],edi
jmp L31
L38:
mov edi,dword ptr (-4)[ebp]
mov dword ptr (-8)[ebp],edi
jmp L31
L39:
mov edi,dword ptr (-4)[ebp]
mov dword ptr (-8)[ebp],edi
jmp L31
L40:
mov edi,dword ptr (-4)[ebp]
mov dword ptr (-8)[ebp],edi
jmp L31
L41:
mov edi,dword ptr (-4)[ebp]
mov dword ptr (-8)[ebp],edi
L30:
L31:
mov edi,dword ptr (-8)[ebp]
push edi
lea edi,(L44)
push edi
call _printf
add esp,8
L27:
inc dword ptr (-4)[ebp]
cmp dword ptr (-4)[ebp],20
jle L26
mov eax,0
L24:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _g
_g:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,4
lea edi,(L46)
push edi
call _printf
add esp,4
mov dword ptr (-4)[ebp],1
L47:
mov edi,dword ptr (-4)[ebp]
cmp edi,1001
jl L64
cmp edi,1004
jg L65
jmp dword ptr (L66-4004)[edi*4]
_TEXT ends
_TEXT segment
align 4
L66 label byte
dd L60
dd L60
dd L60
dd L60
_TEXT ends
_TEXT segment
L64:
mov edi,dword ptr (-4)[ebp]
cmp edi,1
jl L51
cmp edi,8
jg L51
jmp dword ptr (L68-4)[edi*4]
_TEXT ends
_TEXT segment
align 4
L68 label byte
dd L53
dd L53
dd L55
dd L55
dd L55
dd L57
dd L57
dd L57
_TEXT ends
_TEXT segment
L65:
mov edi,dword ptr (-4)[ebp]
cmp edi,3001
jl L51
cmp edi,3004
jg L51
jmp dword ptr (L70-12004)[edi*4]
_TEXT ends
_TEXT segment
align 4
L70 label byte
dd L62
dd L62
dd L62
dd L62
_TEXT ends
_TEXT segment
L53:
mov edi,dword ptr (-4)[ebp]
push edi
lea edi,(L54)
push edi
call _printf
add esp,8
jmp L52
L55:
mov edi,dword ptr (-4)[ebp]
push edi
lea edi,(L56)
push edi
call _printf
add esp,8
jmp L52
L57:
mov edi,dword ptr (-4)[ebp]
push edi
lea edi,(L58)
push edi
call _printf
add esp,8
L51:
mov edi,dword ptr (-4)[ebp]
push edi
lea edi,(L59)
push edi
call _printf
add esp,8
jmp L52
L60:
mov edi,dword ptr (-4)[ebp]
push edi
lea edi,(L61)
push edi
call _printf
add esp,8
jmp L52
L62:
mov edi,dword ptr (-4)[ebp]
push edi
lea edi,(L63)
push edi
call _printf
add esp,8
L52:
L48:
inc dword ptr (-4)[ebp]
cmp dword ptr (-4)[ebp],10
jle L47
mov eax,0
L45:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _h
_h:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,8
mov dword ptr (-8)[ebp],0
lea edi,(L73)
push edi
call _printf
add esp,4
mov dword ptr (-4)[ebp],1
L74:
mov edi,dword ptr (-4)[ebp]
cmp edi,264
je L86
cmp edi,264
jg L94
L93:
mov edi,dword ptr (-4)[ebp]
cmp edi,120
je L84
cmp edi,120
jg L96
L95:
mov edi,dword ptr (-4)[ebp]
cmp edi,8
je L83
cmp edi,8
jl L78
L97:
cmp dword ptr (-4)[ebp],16
je L82
jmp L78
L96:
mov edi,dword ptr (-4)[ebp]
cmp edi,128
je L80
cmp edi,128
jl L78
L98:
cmp dword ptr (-4)[ebp],248
je L87
jmp L78
L94:
mov edi,dword ptr (-4)[ebp]
cmp edi,288
je L91
cmp edi,288
jg L100
L99:
mov edi,dword ptr (-4)[ebp]
cmp edi,272
je L88
cmp edi,272
jl L78
L101:
cmp dword ptr (-4)[ebp],280
je L85
jmp L78
L100:
mov edi,dword ptr (-4)[ebp]
cmp edi,304
je L89
cmp edi,304
jg L103
L102:
cmp dword ptr (-4)[ebp],296
je L90
jmp L78
L103:
cmp dword ptr (-4)[ebp],312
je L92
jmp L78
L78:
inc dword ptr (-8)[ebp]
jmp L75
L80:
mov edi,dword ptr (-4)[ebp]
push edi
lea edi,(L81)
push edi
call _printf
add esp,8
jmp L79
L82:
mov edi,dword ptr (-4)[ebp]
push edi
lea edi,(L81)
push edi
call _printf
add esp,8
jmp L79
L83:
mov edi,dword ptr (-4)[ebp]
push edi
lea edi,(L81)
push edi
call _printf
add esp,8
jmp L79
L84:
mov edi,dword ptr (-4)[ebp]
push edi
lea edi,(L81)
push edi
call _printf
add esp,8
jmp L79
L85:
mov edi,dword ptr (-4)[ebp]
push edi
lea edi,(L81)
push edi
call _printf
add esp,8
jmp L79
L86:
mov edi,dword ptr (-4)[ebp]
push edi
lea edi,(L81)
push edi
call _printf
add esp,8
jmp L79
L87:
mov edi,dword ptr (-4)[ebp]
push edi
lea edi,(L81)
push edi
call _printf
add esp,8
jmp L79
L88:
mov edi,dword ptr (-4)[ebp]
push edi
lea edi,(L81)
push edi
call _printf
add esp,8
jmp L79
L89:
mov edi,dword ptr (-4)[ebp]
push edi
lea edi,(L81)
push edi
call _printf
add esp,8
jmp L79
L90:
mov edi,dword ptr (-4)[ebp]
push edi
lea edi,(L81)
push edi
call _printf
add esp,8
jmp L79
L91:
mov edi,dword ptr (-4)[ebp]
push edi
lea edi,(L81)
push edi
call _printf
add esp,8
jmp L79
L92:
mov edi,dword ptr (-4)[ebp]
push edi
lea edi,(L81)
push edi
call _printf
add esp,8
L79:
L75:
inc dword ptr (-4)[ebp]
cmp dword ptr (-4)[ebp],500
jle L74
mov edi,dword ptr (-8)[ebp]
push edi
lea edi,(L104)
push edi
call _printf
add esp,8
mov eax,0
L72:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _big
_big:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,4
mov edi,dword ptr (20)[ebp]
and edi,06000000H
mov dword ptr (-4)[ebp],edi
mov edi,dword ptr (-4)[ebp]
cmp edi,33554432
je L111
cmp edi,33554432
jg L115
L114:
mov edi,dword ptr (-4)[ebp]
cmp edi,-2
je L109
cmp edi,-1
je L109
cmp edi,0
je L109
jmp L106
L115:
mov edi,dword ptr (-4)[ebp]
cmp edi,67108864
je L112
jmp L106
L109:
mov edi,dword ptr (20)[ebp]
push edi
lea edi,(L110)
push edi
call _printf
add esp,8
jmp L107
L111:
mov edi,dword ptr (20)[ebp]
push edi
lea edi,(L110)
push edi
call _printf
add esp,8
jmp L107
L112:
mov edi,dword ptr (20)[ebp]
push edi
lea edi,(L110)
push edi
call _printf
add esp,8
jmp L107
L106:
mov edi,dword ptr (20)[ebp]
push edi
lea edi,(L113)
push edi
call _printf
add esp,8
L107:
mov eax,0
L105:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _limit
_limit:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,4
mov dword ptr (-4)[ebp],-2147483648
L117:
mov edi,dword ptr (-4)[ebp]
mov esi,-2147483648
cmp edi,-2147483648
jl L121
cmp edi,-2147483644
jg L121
lea edi,[edi*4]
lea esi,[esi*4]
sub edi,esi
jmp dword ptr (L134)[edi]
_TEXT ends
_TEXT segment
align 4
L134 label byte
dd L123
dd L125
dd L127
dd L129
dd L131
_TEXT ends
_TEXT segment
L123:
lea edi,(L124)
push edi
call _printf
add esp,4
jmp L122
L125:
lea edi,(L126)
push edi
call _printf
add esp,4
jmp L122
L127:
lea edi,(L128)
push edi
call _printf
add esp,4
jmp L122
L129:
lea edi,(L130)
push edi
call _printf
add esp,4
jmp L122
L131:
lea edi,(L132)
push edi
call _printf
add esp,4
jmp L122
L121:
lea edi,(L133)
push edi
call _printf
add esp,4
L122:
L118:
inc dword ptr (-4)[ebp]
cmp dword ptr (-4)[ebp],-2147483643
jle L117
mov dword ptr (-4)[ebp],2147483647
L135:
mov edi,dword ptr (-4)[ebp]
mov esi,2147483643
cmp edi,2147483643
jl L139
cmp edi,2147483647
jg L139
lea edi,[edi*4]
lea esi,[esi*4]
sub edi,esi
jmp dword ptr (L146)[edi]
_TEXT ends
_TEXT segment
align 4
L146 label byte
dd L145
dd L144
dd L143
dd L142
dd L141
_TEXT ends
_TEXT segment
L141:
lea edi,(L124)
push edi
call _printf
add esp,4
jmp L140
L142:
lea edi,(L126)
push edi
call _printf
add esp,4
jmp L140
L143:
lea edi,(L128)
push edi
call _printf
add esp,4
jmp L140
L144:
lea edi,(L130)
push edi
call _printf
add esp,4
jmp L140
L145:
lea edi,(L132)
push edi
call _printf
add esp,4
jmp L140
L139:
lea edi,(L133)
push edi
call _printf
add esp,4
L140:
L136:
dec dword ptr (-4)[ebp]
cmp dword ptr (-4)[ebp],2147483642
jge L135
mov eax,0
L116:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
_TEXT ends
extrn _printf:near
_TEXT segment
_TEXT ends
_TEXT segment
align 1
L133 label byte
db 53
db 10
db 0
align 1
L132 label byte
db 52
db 10
db 0
align 1
L130 label byte
db 51
db 10
db 0
align 1
L128 label byte
db 50
db 10
db 0
align 1
L126 label byte
db 49
db 10
db 0
align 1
L124 label byte
db 48
db 10
db 0
align 1
L113 label byte
db 120
db 32
db 61
db 32
db 48
db 120
db 37
db 120
db 32
db 40
db 100
db 101
db 102
db 97
db 117
db 108
db 116
db 41
db 10
db 0
align 1
L110 label byte
db 120
db 32
db 61
db 32
db 48
db 120
db 37
db 120
db 10
db 0
align 1
L104 label byte
db 37
db 100
db 32
db 100
db 101
db 102
db 97
db 117
db 108
db 116
db 115
db 10
db 0
align 1
L81 label byte
db 105
db 32
db 61
db 32
db 37
db 100
db 10
db 0
align 1
L73 label byte
db 104
db 58
db 10
db 0
align 1
L63 label byte
db 54
db 32
db 37
db 100
db 10
db 0
align 1
L61 label byte
db 53
db 32
db 37
db 100
db 10
db 0
align 1
L59 label byte
db 100
db 32
db 37
db 100
db 10
db 0
align 1
L58 label byte
db 51
db 32
db 37
db 100
db 10
db 0
align 1
L56 label byte
db 50
db 32
db 37
db 100
db 10
db 0
align 1
L54 label byte
db 49
db 32
db 37
db 100
db 10
db 0
align 1
L46 label byte
db 103
db 58
db 10
db 0
align 1
L44 label byte
db 120
db 32
db 61
db 32
db 37
db 100
db 10
db 0
align 1
L25 label byte
db 102
db 58
db 10
db 0
align 1
L7 label byte
db 37
db 99
db 32
db 61
db 32
db 48
db 120
db 37
db 120
db 10
db 0
align 1
L6 label byte
db 98
db 102
db 110
db 114
db 116
db 118
db 120
db 0
_TEXT ends
end

Some files were not shown because too many files have changed in this diff Show more