ass3 matmul matrix

56 views
Skip to first unread message

Taha Liaqat

unread,
Oct 27, 2020, 2:30:35 AM10/27/20
to cmpt-295-sfu
SFU ID: 301393248
Github username: tliaqat
Line and file: matmul.s line 103
Expected behavior: Store the result of dot.s in d
Observed behavior: d is filled with garbage values
Question: How do I transfer the result of dot.s to the matrix. The results are correct, but no matter how I try and transfer the result to the matrix, I get garbage values or all 0s

ali sedaghati

unread,
Oct 27, 2020, 12:50:03 PM10/27/20
to cmpt-295-sfu
After calling dot, you're invoking print_int and print_char. By taking a look at their body, you can see that they're changing the value of the a0 register.
So, before calling print_int, you have to save a0 first, and then move it back when printing is done.

Taha Liaqat

unread,
Oct 27, 2020, 3:01:50 PM10/27/20
to cmpt-295-sfu
I tried that, but moving the answer into the matrix still doesn't work properly. Im using mv which im not sure is correct, but its working for my other functions, and its still either not doing anything or printing garbage.

ali sedaghati

unread,
Oct 27, 2020, 3:15:44 PM10/27/20
to cmpt-295-sfu
First of all, you're not following the calling conventions. For example, in line 115 a6 should be replaced with proper s register. And, it seems that you're not increasing the offset of pointer which points to d. 
Reply all
Reply to author
Forward
0 new messages