Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
- .486 ; create 32 bit code
- .model flat, stdcall ; 32 bit memory model
- option casemap :none ; case sensitive
- ; include files
- ; ~~~~~~~~~~~~~
- include \masm32\include\windows.inc ; main windows include file
- include \masm32\include\masm32.inc ; masm32 library include
- ; -------------------------
- ; Windows API include files
- ; -------------------------
- include \masm32\include\gdi32.inc
- include \masm32\include\user32.inc
- include \masm32\include\kernel32.inc
- include \masm32\include\Comctl32.inc
- include \masm32\include\comdlg32.inc
- include \masm32\include\shell32.inc
- include \masm32\include\oleaut32.inc
- include \masm32\include\ole32.inc
- include \masm32\include\msvcrt.inc
- include \masm32\include\dialogs.inc ; macro file for dialogs
- include \masm32\macros\macros.asm ; masm32 macro file
- ; libraries
- ; ~~~~~~~~~
- includelib \masm32\lib\masm32.lib ; masm32 static library
- ; ------------------------------------------
- ; import libraries for Windows API functions
- ; ------------------------------------------
- includelib \masm32\lib\gdi32.lib
- includelib \masm32\lib\user32.lib
- includelib \masm32\lib\kernel32.lib
- includelib \masm32\lib\Comctl32.lib
- includelib \masm32\lib\comdlg32.lib
- includelib \masm32\lib\shell32.lib
- includelib \masm32\lib\oleaut32.lib
- includelib \masm32\lib\ole32.lib
- includelib \masm32\lib\msvcrt.lib
- ; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
- ; ************************************************************************
- ; include \masm32\include\masm32rt.inc
- ; ************************************************************************
- .data?
- ;Result dd ?
- ;lpBuf1 db 1024 dup(?) ; temp Buffers
- .data
- buffer_for_string db 10 dup(0)
- title_string db "Ðåçóëüòàò: ",0
- ; szformat db "%u",0Dh,0Ah,0 ; èçìåíÿåì ôîðìàò âûâîäà íà dec
- szformat db "%d",0Dh,0Ah,0 ; èçìåíÿåì ôîðìàò âûâîäà íà hex
- a_ dd 100
- b_ dd 100
- c_ dd 100
- .code
- start:
- ; ************************************************************************
- main proc
- LOCAL Result :DWORD
- ; LOCAL var_00 :DWORD
- ; LOCAL var_01 :BYTE
- ; Çàòåì çäåñü(íèæå) çàïèøèòå ðåøåíèå.
- ; Çàïèñè âîçìîæíû òîëüêî äî íà÷àëà ñëåäóþùåé ëèíèè ðåøåòêè ...
- ; ###########################################################################
- ;16. (2*b – a + b * c) / (c / 4 - 1);
- mov eax,c_
- shl eax,2
- dec eax
- mov ecx,eax+
- mov eax,b_
- shl eax,1
- sub eax,a_
- mov edx,b_
- mov ebx,c_
- imul edx,ebx ; edx=1600,ebx=40
- add eax,edx
- cdq
- idiv ecx ; all(eax) / edx
- ; Ìåíÿåì èìÿ ðåãèñòðà íà èìÿ â êîòîðîì íàõîäèòñÿ âàø ðåçóëüòàò
- mov Result,eax
- ; ###########################################################################
- push Result
- push offset szformat
- push offset buffer_for_string
- call wsprintf
- push MB_OK
- push offset title_string
- push offset buffer_for_string
- push 0
- call MessageBox
- push 0
- call ExitProcess
- main endp
- ; ************************************************************************
- end start
- Comment ^
- Êàðêàñ ïðîãðàììû
- .386
- .MODEL Flat, STDCALL
- .DATA
- <Âàøà èíèöèàëèçèpóåìûå äàííûå>
- ......
- .DATA?
- <Âàøè íå èíèöèàëèçèpóåìûå äàííûå>
- ......
- .CONST
- <Âàøè êîíñòàíòû>
- ......
- .CODE
- <ìåòêà>
- <Âàø êîä>
- .....
- end <ìåòêà>
- ^
Advertisement
Add Comment
Please, Sign In to add comment