Home Random Page


CATEGORIES:

BiologyChemistryConstructionCultureEcologyEconomyElectronicsFinanceGeographyHistoryInformaticsLawMathematicsMechanicsMedicineOtherPedagogyPhilosophyPhysicsPolicyPsychologySociologySportTourism






Лабораторная работа 5

.486

.model flat, stdcall

option casemap:none

include/masm32/include/windows.inc

include/masm32/include/user32.inc

include/masm32/include/kernel32.inc

includelib/masm32/lib/user32.lib

includelib/masm32/lib/kernel32.lib

include/masm32/macros/macros.asm

uselib masm32,comctl32,ws2_32

.data

msg_title db "Title",0

A DB 1h

x dd 0,1,2,3,4,5,6,7,8,9,10,11

n dd 12

buffer db 128 dup(?)

format db "%d", 0

.code

start:

mov eax, 0

mov ecx, n

mov edx, 0

L:add eax, x[ebx]

add ebx, type x

dec ecx

cmp ecx, 0

jne L

invoke wsprintf, addr buffer, addr format, AL

invoke MessageBox, 0, addr buffer, addr msg_title, MB_OK

invoke ExitProcess, 0

end start

 

 

Лабораторная работа 6

.686

.model flat, stdcall

option casemap:none

include/masm32/include/windows.inc

include/masm32/include/kernel32.inc

includelib/masm32/lib/kernel32.lib

.data

x dd 0

y dd 4

.code

program:

push y

push x

call Procedure

push 0

call ExitProcess

Procedure proc

ret 8

Procedure endp

end program

 

 

 

 

Задание 2

.686

.model flat, с

option casemap:none

include/masm32/include/windows.inc

include/masm32/include/kernel32.inc

includelib/masm32/lib/kernel32.lib

.data

x dd 0

y dd 0

.code

program:

push y

push x

call Procedure

add esp, 8

push 0

Procedure proc

ret

Procedure endp

end program

 

 

Задание 3

.686

.model flat, c

option casemap:none

include/masm32/include/windows.inc

include/masm32/include/kernel32.inc

includelib/masm32/lib/kernel32.lib

.data

a dd 76

b dd -8

d dd ?

.code

program:

push offset d

push b

push a

call factorial

add esp, 8

mov d, eax

push 0

factorial proc

mov eax,[esp+4]

test eax,eax

jz L1

dec eax

push eax

call factorial

add esp,4

mul dword ptr[esp+4]

jmp L2

L1:inc eax

L2:ret

factorial endp

end program

 

 

 


Date: 2015-12-11; view: 1867


<== previous page | next page ==>
Лабораторная работа №2 | Plug your skills and knowledge gap
doclecture.net - lectures - 2014-2024 year. Copyright infringement or personal data (0.01 sec.)