:
19.02.18

30.11.17
?
11.09.17

14.08.17

26.06.17

17.06.17

09.06.17
?
17.05.17
-?
04.05.17
:
29.04.17
:
.2018
.......
   1234
567891011
12131415161718
19202122232425
262728    
!!!
!!!
.
.
, .

, , , : ( )

! () . , Word, , , ( pic), , , .., .

: ( )

..

.-923

.

2001.

Š 3

ܠ 4

Š 17

ʠ 18

.

- .- , - .

. . , .

, - . , .

, , . , , , .

.

Windows- .data .code. 28 API. , .

mode1 (flat) (stdcall). flat . , 32- . .exe. stdcall .

include win32.inc.

Win32 API, extrn , .

35-68 , , . Windows , Win32.API:

* ;

* , ;

;

;

;

;

;

* .

, , , . Win32 API CreateWindowEx. . 2 : , .

CreateWindowExA , Windows, - . , ShowWindowA. hWnd , , , .

. , Register Class(Ex).

Windows , ebi, edi esi ,.. . EAX. , eax .

- , . , - , , , . SB_LINEUP , SB_LINEDOWN - . .

, , . , , ( ) 0 100. , SetScrollRange

Windows , , , .

Windows API, , (CreateWindow, ShowWindow .).

, .

:

InvalidateRect - . , .

:

hWnd , , 0, Windows *WM_ERASEBKGND and WM_NCPAINT*;

lpRect RECT, , . , .

BErase . true, BeginPaint

GetClientRect - . . (0,0).

:

hWnd : , .

lpRect: , .

, 0.

SetScrollRange - . .

:

hWnd : , , nBar.

nBar: . . , . . . , . , , .

ScrollWindow - , .

hWnd : , .

XAmount: .

YAmount: .

lpRect: RECT , . 0,

lpClipRect: RECT , .

, , .

SetScrollPos - , .

:

hWnd : , nBar.

nBar: .

:

- SB_CTL - , hWnd - .

- SB_GORS - .

- SB_VERT - .

nPos: , . .

bRedraw: , , . , .

, .

p486 ;

; i486

2. jumps ;

;

; ,

; c

;

3. model flat,STDCALL ; 32-

;

; STDCALL,

;

4. include win32.inc ; ,

;

5. L equ ; LARGE,

; ,

; ; 32-, L

6. extrn ginPaint:PROC ;

;Windows

7. extrn CreateWindowExA:PROC

8. extrn DefWindowProcA:PROC

9. extrn DispatchMessageA:PROC

10. extrn EndPaint:PROC

11. extrn ExitProcess:PROC

12. extrn GetMessageA:PROC

13. extrn GetModuleHandleA:PROC

14. extrn LoadCursorA:PROC

15. extrn LoadIconA:PROC

16. extrn PostQuitMessage:PROC

17. extrn RegisterClassA:PROC

18. extrn ShowWindow:PROC

19. extrn TextOutA:PROC

20. extrn UpdateWindow:PROC

21. extrn GetTextMetricsA:PROC

22. extrn SetCurrentDirectoryA:PROC

23. extrn FindFirstFileA:PROC

24. extrn FindNextFileA:PROC

25. extrn FindClose:PROC

26. extrn SetScrollPos:PROC

27. extrn InvalidateRect:PROC

28. extrn GetClientRect:PROC

29. extrn ScrollWindow:PROC

30. extrn GetDC:PROC

31. extrn ReleaseDC:PROC

32. extrn SetScrollRange:PROC

33. extrn TranslateMessage:PROC

34. .data ; ,

;

35. hFindFile dd 0

36. newhwnd dd 0

37. wc WNDCLASS

38. qq1 db '@@@@'

39. lppaint PAINTSTRUCT

40. qq2 db '@@@@'

41. msg MSGSTRUCT

42. tm TEXTMETRIC

43. rc RECT

44. charht dd 0

45. hInst dd 0

46. fl dw 0

47. szTitleName db ' ',0

48. szClassName db 'ASMCLASS32',0

49. Buffer db ' !',0

50. buf_v db 260 dup (0)

51. num dd 0

52. ;##########################

53. lpPathName dd 0

54. szP db 0

55. w32fd WIN32_FIND_DATA

56. lpFileName dd 0

57. fn db "*.*",0

58. ;##########################

59. nVertDifference dd 0

60. nVertPosition dd 0

61. cyStep dd 0

62. nFirst dd 0

63. nLast dd 0

64. cyMax dd 0

65. cyPos dd 0

66. cory dd 5

67. count dd 0

68. py dd 0

69. .code ; ,

;

70. start:

71. push L 0

72. call GetModuleHandleA ; ,

;,

; EXE- DLL

73. mov [hInst], eax ; hInst

74. reg_class:

75. ;************************************************

; WNDCLASS

76. mov [wc.clsStyle], CS_HREDRAW + CS_VREDRAW ;

77. mov [wc.clsLpfnWndProc], offset WndProc ;

78. mov wc.clsCbClsExtra], 0 ;

; ,

;

;

;

79. mov [wc.clsCbWndExtra], 0 ; ,

;

;

;

80. mov eax, [hInst]

81. mov [wc.clsHInstance], eax ;

;EXE- ,

; GetModuleHandle

82. call LoadIconA, 0, IDI_APPLICATION ;

;

83. mov [wc.clsHIcon], eax

84. call LoadCursorA, 0 ,IDC_ARROW ;

85. mov [wc.clsHCursor], eax

86. mov [wc.clsHbrBackground],COLOR_WINDOW +1

87. mov dword ptr [wc.clsLpszMenuName], 0

88. mov dword ptr [wc.clsLpszClassName], offset szClassName

89. call RegisterClassA, offset wc ; ,

; ; WNDCLASS

90. call CreateWindowExA, 0,offset szClassName,offset szTitleName,

; ,

;

91. WS_OVERLAPPEDWINDOW OR WS_VSCROLL,CW_USEDEFAULT,

92. CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,0,0,

93. [hInst], 0

94. mov [newhwnd], eax

95. call ShowWindow, [newhwnd], SW_SHOWNORMAL ;

;

;

96. call UpdateWindow, [newhwnd] ;

; ,

; WM_PAINT

; ,

;

;

97. msg_loop:

98. call GetMessageA, offset msg, 0, 0, 0 ;

;

;

99..if eax!= 0

100. call DispatchMessageA, offset msg ;

;

101. call TranslateMessage, offset msg

102. jmp msg_loop

103. ; .endif

104. call ExitProcess, [msg.msWPARAM] ;

105. ;*************************************************

106. ;

107. ;**************************************************

108. WndProc proc uses ebx edi esi, hwnd:DWORD, wmsg:DWORD,

109. wparam:DWORD, lparam:DWORD

110. LOCAL hDC:DWORD

111. cmp [wmsg], WM_DESTROY ;

;

112. je wmdestroy

113. cmp [wmsg], WM_SIZE ; ,

;

114. je wmsize

115. cmp [wmsg], WM_CREATE ;

; , ,

;

116. je wmcreate

117. cmp [wmsg],WM_PAINT ; ,

;

;

118. je wmpaint

119. cmp [wmsg],WM_VSCROLL ;

120. je wmscroll

121. jmp defwndproc

122. wmcreate:

123. call GetDC,[hwnd] ;

124. mov [hDC],eax

125. call GetTextMetricsA,[hDC],offset tm

126. mov ebx,0

127. mov bx,[tm.tmExtLeading] ;

128. add bx,[tm.tmHeight] ; ( )

129. mov [charht],ebx

130. call ReleaseDC,[hwnd],[hDC] ;

131. mov eax, 0

132. jmp finish

133. defwndproc:

134. call DefWindowProcA,[hwnd],[wmsg],[wparam],[lparam]

135. jmp finish

136. wmscroll:

137. call GetClientRect,[hwnd],offset rc ;

;

138. movzx eax,[word ptr wparam] ; wparam

;

139. cmp eax,SB_LINEDOWN ; ,

;

;

140. je sblinedown

141. cmp eax,SB_LINEUP ; ,

;

;

142. je sblineup

143. cmp eax,SB_ENDSCROLL ;

;

;

144. je bp3

145. sblinedown:

146. mov [cyStep],1 ;

147. jmp endvscroll_1

148. sblineup:

149. mov [cyStep],-1

150. jmp endvscroll

151. endvscroll:

152. cmp [cyPos],0

153. je bp3

154. endvscroll_1: mov eax,[cyPos] ;

;

155. add eax,[cyStep]

156. mov [cyPos],eax

157. mov eax,0

158. sbb eax,[charht] ;

159. mov ecx,[cyStep]

160. mov edx,0

161. mul ecx

162. mov ecx,eax

163. call ScrollWindow,[hwnd],0,ecx,0,0 ; ,

;

;

164. call InvalidateRect,[hwnd],offset rc,TRUE ;

;

;

165. call SetScrollPos,[hwnd],SB_VERT,[cyPos],TRUE ;

;

;

;

;

166. call UpdateWindow,[hwnd] ; ,

;

167. bp3: mov eax,0

168. jmp finish

169. wmdestroy:

170. call PostQuitMessage,0

171. mov eax, 0

172. jmp finish

173. wmsize: ;

;

;

174. mov eax,[lparam]

175. mov cl,16

176. rcr eax,cl

177. and eax,0ffffh

178. mov dx,0

179. mov cx,word ptr [charht]

180. div cx

181. movzx ecx,ax

182. mov eax,101

183. sbb eax,ecx

184. cmp eax,0

185. ja www1

186. mov eax,0

187. www1: mov [cyMax],ecx

188. call FindFirstFileA,offset fn,offset w32fd

189. mov [hFindFile],eax

190. mov esi,1

191. s_m4:

192. call FindNextFileA,[hFindFile],offset w32fd

193. cmp eax,0

194. je s_m5

195. inc esi

196. jmp s_m4

197. s_m5: mov [nLast],esi

198. mov eax,[cyMax]

199. cmp eax,[cyPos]

200. ja www2

201. mov [cyPos],eax

202. www2: push FALSE

203. push esi

204. push L 0

205. push SB_VERT

206. push [hwnd]

207. call SetScrollRange

208. push TRUE

209. push [cyPos]

210. push SB_VERT

211. push [hwnd]

212. call SetScrollPos

213. mov eax, 0

214. jmp finish

215. wmpaint:

216. call BeginPaint,[hwnd],offset lppaint ;

;

217. mov [hDC],eax

218. mov eax,[cyPos] ;

219. mov ecx,[charht] ;

220. mov dx,0

221. mul cx

222. movzx ecx,ax

223. mov [cory],5 ; -5

224. mov ecx,1 ; x -1

225. call FindFirstFileA,offset fn,offset w32fd ;

;

;

226. mov [hFindFile],eax

227. cmp ecx,[cyPos]

228. jne qqq1

229. mov esi,0

230. m3: mov dl,w32fd.cFileName[esi] ;

231. cmp dl,0

232. je m2

233. mov buf_v[esi],dl

234. inc esi

235. jmp m3

236. cmp [cyPos],0 ; ,

; qqql

237. jne qqq1

238. m2:

239. mov [num],esi

240. call TextOutA,[hDC],5,[cory],offset buf_v,[num] ;

;

;

;

241. qqq1: mov ebx,1

242. m6:

243. call FindNextFileA,[hFindFile],offset w32fd ;

244. cmp eax,0 ;

;

245. je kon

246. mov esi,0

247. mov edi,0

248. m4: mov dl,w32fd.cFileName[edi] ;

;

249. cmp dl,0

250. je m5

251. mov buf_v[esi],dl

252. inc edi

253. inc esi

254. jmp m4

255. m5: cmp ebx,[cyPos]

256. jb qqq2

257. mov eax,[charht]

258. add [cory],eax

259. call TextOutA,[hDC],5,[cory],offset buf_v,esi ;

;

260. qqq2: inc ebx ; ꠠ

261. jmp m6

262. kon: call EndPaint,[hwnd],offset lppaint ;

;

;

;

;

263. mov eax,0

264. jmp finish

265. finish:

266. ret

267. WndProc endp

268. public WndProc

269. end start ; .

        ( )

.

, . , , . Windows , . , , .

.

Windows 98: : . . .: BHV, 1999. T.1. 672 c.

.. Asstmbler. DOC, Windows Unix. M.: , 1999. 640 .


! () . , Word, , , ( pic), , , ..,
: 20.08.10 | [ + ]   [ - ]  
: 121
: 0
20.08.10
20.08.10
20.08.10
20.08.10
20.08.10
{dnmbottom}
70 000 , , , .