OpenCores
URL https://opencores.org/ocsvn/eco32/eco32/trunk

Subversion Repositories eco32

[/] [eco32/] [trunk/] [lcc/] [x86/] [win32/] [tst/] [8q.sbk] - Blame information for rev 18

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 hellwig
.486
2
.model flat
3
extrn __fltused:near
4
extrn __ftol:near
5
public _main
6
_TEXT segment
7
_main:
8
push ebx
9
push esi
10
push edi
11
push ebp
12
mov ebp,esp
13
sub esp,4
14
mov dword ptr (-4)[ebp],0
15
L2:
16
mov edi,dword ptr (-4)[ebp]
17
lea edi,[edi*4]
18
mov dword ptr (_down)[edi],1
19
mov dword ptr (_up)[edi],1
20
L3:
21
inc dword ptr (-4)[ebp]
22
cmp dword ptr (-4)[ebp],15
23
jl L2
24
mov dword ptr (-4)[ebp],0
25
L6:
26
mov edi,dword ptr (-4)[ebp]
27
mov dword ptr (_rows)[edi*4],1
28
L7:
29
inc dword ptr (-4)[ebp]
30
cmp dword ptr (-4)[ebp],8
31
jl L6
32
push 0
33
call _queens
34
add esp,4
35
mov eax,0
36
L1:
37
mov esp,ebp
38
pop ebp
39
pop edi
40
pop esi
41
pop ebx
42
ret
43
public _queens
44
_queens:
45
push ebx
46
push esi
47
push edi
48
push ebp
49
mov ebp,esp
50
sub esp,4
51
mov dword ptr (-4)[ebp],0
52
L11:
53
mov edi,dword ptr (-4)[ebp]
54
cmp dword ptr (_rows)[edi*4],0
55
je L15
56
mov esi,dword ptr (20)[ebp]
57
mov ebx,edi
58
sub ebx,esi
59
cmp dword ptr (_up+28)[ebx*4],0
60
je L15
61
lea edi,[esi][edi]
62
cmp dword ptr (_down)[edi*4],0
63
je L15
64
mov edi,dword ptr (-4)[ebp]
65
mov esi,dword ptr (20)[ebp]
66
lea ebx,[esi][edi]
67
mov dword ptr (_down)[ebx*4],0
68
mov ebx,edi
69
sub ebx,esi
70
mov dword ptr (_up+28)[ebx*4],0
71
mov dword ptr (_rows)[edi*4],0
72
mov edi,dword ptr (20)[ebp]
73
mov esi,dword ptr (-4)[ebp]
74
mov dword ptr (_x)[edi*4],esi
75
cmp dword ptr (20)[ebp],7
76
jne L19
77
call _print
78
add esp,0
79
jmp L20
80
L19:
81
mov edi,dword ptr (20)[ebp]
82
lea edi,(1)[edi]
83
push edi
84
call _queens
85
add esp,4
86
L20:
87
mov edi,dword ptr (-4)[ebp]
88
mov esi,dword ptr (20)[ebp]
89
lea ebx,[esi][edi]
90
mov dword ptr (_down)[ebx*4],1
91
mov ebx,edi
92
sub ebx,esi
93
mov dword ptr (_up+28)[ebx*4],1
94
mov dword ptr (_rows)[edi*4],1
95
L15:
96
L12:
97
inc dword ptr (-4)[ebp]
98
cmp dword ptr (-4)[ebp],8
99
jl L11
100
mov eax,0
101
L10:
102
mov esp,ebp
103
pop ebp
104
pop edi
105
pop esi
106
pop ebx
107
ret
108
public _print
109
_print:
110
push ebx
111
push esi
112
push edi
113
push ebp
114
mov ebp,esp
115
sub esp,4
116
mov dword ptr (-4)[ebp],0
117
L23:
118
mov edi,dword ptr (-4)[ebp]
119
mov edi,dword ptr (_x)[edi*4]
120
lea edi,(49)[edi]
121
push edi
122
lea edi,(L27)
123
push edi
124
call _printf
125
add esp,8
126
L24:
127
inc dword ptr (-4)[ebp]
128
cmp dword ptr (-4)[ebp],8
129
jl L23
130
lea edi,(L28)
131
push edi
132
call _printf
133
add esp,4
134
mov eax,0
135
L22:
136
mov esp,ebp
137
pop ebp
138
pop edi
139
pop esi
140
pop ebx
141
ret
142
_TEXT ends
143
extrn _printf:near
144
_TEXT segment
145
_TEXT ends
146
_DATA segment
147
public _x
148
align 4
149
_x label byte
150
db 32 dup (0)
151
public _rows
152
align 4
153
_rows label byte
154
db 32 dup (0)
155
public _down
156
align 4
157
_down label byte
158
db 60 dup (0)
159
public _up
160
align 4
161
_up label byte
162
db 60 dup (0)
163
_DATA ends
164
_TEXT segment
165
align 1
166
L28 label byte
167
db 10
168
db 0
169
align 1
170
L27 label byte
171
db 37
172
db 99
173
db 32
174
db 0
175
_TEXT ends
176
end

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.