Created
March 12, 2012 15:53
-
-
Save spellancer/2022923 to your computer and use it in GitHub Desktop.
laba4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.DATA | |
Matr DB 13,10,'Ishodnya matrica: ',13,10,0 | |
Result1 DB ' ' | |
ResStr1 DB 16 DUP (' '),13,10,0 | |
res2 db ' ' | |
ResStr2 DB 5 DUP (' '),13,10,0 | |
Perechod DB 13,10,' ',13,10,0 | |
result db 13,10,'Result: ',13,10,0 | |
ots db ' ',0 | |
A SDWORD 20,3,4,5,6 | |
SDWORD 3,4,5,6,6 | |
SDWORD 0,7,8,9,7 | |
SDWORD -9,7,-8,1,8 | |
x sdword 1200 | |
.DATA? | |
z SDWORD ?,?,?,?,? | |
y sdword ? | |
z1 sdword ? | |
buffer DB 10 DUP (?) | |
inbuf DB 100 DUP (?) | |
.CODE | |
Start: | |
mov eax,x | |
mov edi,0 | |
mov ecx,5 | |
mov edx,0 | |
cycle1: | |
push ecx | |
mov ecx,4 | |
mov ebx,0 | |
push eax | |
cycle2: | |
cmp eax,A[ebx+edi] | |
jle con1 | |
mov eax,A[ebx+edi] | |
con1: | |
add ebx,20 | |
loop cycle2 | |
mov z[edx],eax | |
pop eax | |
pop ecx | |
add edi,4 | |
add edx,4 | |
loop cycle1 | |
Invoke StdOut,ADDR Perechod | |
Invoke StdOut,ADDR Matr | |
mov EBX,0 | |
mov ECX,4 | |
cycle3: | |
push ECX | |
mov ECX,5 | |
mov z1,5 | |
mov EAX,0 | |
Invoke StdOut,ADDR Perechod | |
cycle4: | |
Invoke dwtoa,A[EBX],ADDR ResStr1 | |
Invoke StdOut,ADDR Result1 | |
mov ECX,z1 | |
dec z1 | |
add EBX,4 | |
loop cycle4 | |
pop ECX | |
loop cycle3 | |
Invoke StdOut,ADDR Perechod | |
Invoke StdOut,ADDR result | |
mov ebx,0 | |
mov ecx,5 | |
mov z1,5 | |
output: | |
Invoke dwtoa,z[ebx],ADDR ResStr2 | |
Invoke StdOut,ADDR res2 | |
mov ECX,z1 | |
dec z1 | |
add ebx,4 | |
loop output | |
; | |
; Add you statements | |
; | |
XOR EAX,EAX | |
Invoke StdOut,ADDR MsgExit | |
Invoke StdIn,ADDR inbuf,LengthOf inbuf | |
Invoke ExitProcess,0 | |
End Start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment