Help Assembly matrix multiplication

Reply

Join Date: Apr 2008
Posts: 3
Reputation: resooul is an unknown quantity at this point 
Solved Threads: 0
resooul resooul is offline Offline
Newbie Poster

Help Assembly matrix multiplication

 
0
  #1
Apr 28th, 2008
  1. class Program
  2. {
  3. static void Main(string[] args)
  4. {
  5. int m = 0;
  6. int n = 0;
  7. Console.Write("Enter M : ");
  8. m = Convert.ToInt32(Console.ReadLine());
  9. Console.Write("Enter N : ");
  10. n = Convert.ToInt32(Console.ReadLine());
  11. Console.Write("{0} x {1} and {2} x 1 dimentional two matrix will be multiplied.\n",m,n,n);
  12. Console.Write("Enter {0} x {1} dimentional matrix elements \n", m, n);
  13. int[,] matrix1 = new Int32[m, n];
  14. int[,] matrix2 = new Int32[n, 1];
  15. int[,] matrix3 = new Int32[m, 1];
  16. for (int i = 0; i < m; i++)
  17. {
  18. for (int j = 0; j < n; j++)
  19. {
  20. Console.Write("[{0},{1}]. element = ", i, j);
  21. matrix1[i,j] = Convert.ToInt32(Console.ReadLine());
  22. }
  23. }
  24. Console.Write("Enter {0} x {1} dimentional matrix elements \n", n, 1);
  25. for (int i = 0; i < matrix2.GetLength(0); i++)
  26. {
  27. for (int j = 0; j < matrix2.GetLength(1); j++)
  28. {
  29. Console.Write("[{0},{1}]. element = ", i, j);
  30. matrix2[i, j] = Convert.ToInt32(Console.ReadLine());
  31. }
  32. }
  33. for (int i = 0; i < m; i++)
  34. {
  35. for (int k = 0; k < matrix2.GetLength(1); k++)
  36. {
  37. for (int j = 0; j < n; j++)
  38. {
  39. matrix3[i, k] += matrix1[i, j] * matrix2[j, k];
  40. }
  41. }
  42. }
  43. for (int i = 0; i < m; i++)
  44. {
  45. Console.WriteLine(matrix3[i, 0]);
  46. }
  47. Console.ReadLine();
  48. }
  49. }

This is the c# coded program which i wanna reach the assembly coded one. please helpme.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Assembly Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC