ورود

نسخه کامل مشاهده نسخه کامل : کمک به نوشتن پروژه اسمبلی در قبال شارژ 5000 تومانی



Mehdi.KinG
26-06-2011, 18:11
با سلام به خدمت دوستان عزیز
ببخشید نمیدونستم چطوری این درخواست رو بگم من فردا امتحان دارم ازتون خواهش میکنم اگه کسی میتونه این برنامه رو بنویسه به من کمک کنه من در قبال انجام این کار واسه تشکر از دوست عزیزی که به من کمک کرده یک شارژ 5000 تومانی ( همراه اول & ایرانسل ) هدیه میکنم .
پروژه : برنامه ضرب ماتریس N x N
زبان موردنظر : اسمبلی

Mehdi.KinG
26-06-2011, 18:33
از تمام دوستان عزیزم خواهش میکنم برادرانه که اگه کسی بلده منو کمک کنه 4 نمره واسه یه درس 3 واحده قرار بپره 120 تومن واسه این درس پول دادم خواهش میکنم کمک کنید اگه میدونید سایتهایی دیگه هستند مینویسند بگید منو اگه کسی هست که مینویسه به من معرفی کنید ممنونم از همه شما

hosseinriasati
26-06-2011, 18:38
یه سری به پیغام های خصوصیت بزن :20:

hosseinriasati
26-06-2011, 19:02
این یه روش خیلی آسون و ابتدایی واسه ضرب دو ماتریس 3*3 هست که درایه هاش توی آرایه های A و B ذخیره شده



; A, B, and C are arrays of 9 32 bit words each
; i, j, and k are 32 bit words used as loop counters

mov eax, 2 ; we loop from 2 down to 0
mov [i], eax
for_i:

mov eax, 2 ; same here
mov [j], eax
for_j:

mov eax, [i] ; we multiply i by 3 and add j ...
mul al, 3
add eax, [j]
xor ebx, ebx ; and store a zero at that index ...
mov [C+eax], ebx ; in the C array
mov edi, eax ; and we keep the index in edi for later

mov eax, 2 ; again, we loop down from 2
mov [k], eax
for_k:

mov eax, [k] ; now, we get B[3*k+j] into ebx
mul al, 3
add eax, [j]
mov ebx, [B+eax]

mov eax, [i] ; and we get A[i*3+k] into eax
mul al, 3
add eax, [k]
mov eax, [A+eax]

mul eax, ebx ; and we multiply them into edx:eax
add [C+edi], eax ; we add eax into the sum and toss edx

dec [k] ; count down the loop index
jns for_k ; and loop until it is -1

dec [j] ; same here
jns for_j

dec [i] ; same here
jns for_i

اینم ضرب ماتریس 2*2






name "2x2_matrix"

include "emu8086.inc"

org 100h ; directive make tiny com file.





.model small

.stack 100h

.data



size dw 3

A db ?,?,?,?,?,?,?,?,?

B db ?,?,?

C db ?,?,?



message_a db 10,13,"type the elements of matrix A:$"

message_b db 10,13,"type the elements of array B:$"

rez db 10,13,"the result is:$"



.code

start:

mov ax,@data

mov ds,ax



mov bx, 0 ;



read_a:

;compare with sizexsize

mov ax, size

mul size

cmp bx, ax

je reset_counter



;display message

mov dx, offset message_a

mov ah, 09h

int 21h



;read element

mov ah, 01h

int 21h

sub al, 30h

mov A[bx], al



inc bx

jmp read_a



reset_counter:

mov bx, 0

jmp read_b



read_b:

;compare with size

mov ax, size

cmp bx, ax

je calcul



;display message

mov dx, offset message_b

mov ah, 09h

int 21h



;read element

mov ah, 01h

int 21h

sub al, 30h

mov B[bx], al



inc bx

jmp read_b



calcul:

mov bx,0

mov cx,0



for_i:

mov ax, size

cmp bx, ax

je print



mov al,b.size

mul bx



mov al, A[bx+1]

mov bh, B[bx+1]

mul bh

add C[bx], ah



mov al, b.A[bx+2]

mov bl, b.B[bx+2]

mul al

add C[bx], ah



mov al, b.A[bx+3]

mov bl, b.B[bx+3]

mul al

add C[bx], ah



inc bx

jmp for_i



print:



mov dx, offset rez

mov ah,09h

int 21h



mov ax,size

mul size

mov cx,ax

mov ax,0

mov bx,0



print_c:



cmp bx,cx

je finish



mov al, C[bx]

CALL PRINT_NUM



inc bx

jmp print_c



DEFINE_PRINT_NUM

DEFINE_PRINT_NUM_UNS



finish:

ret



end start



end