Author Topic: Program crashes  (Read 1856 times)

Offline Franciswalser

  • Jr. Member
  • *
  • Posts: 7
Program crashes
« on: February 08, 2023, 09:03:51 AM »

I have a DLL created in NASM and linked with GoLink. There's one function that computes Vector x Matrix multiplication. When I try to call this function in external program (Matlab), it crashes. I think there is some detail I missed in my code. I'd appreciate every help.

The code below is one that computes big matrix (in my case 4096x4096) multiplication in single precision. The final result is computed in cycles - each cycle works with 4x4 submatrix (accroding to length of the xmm registers).

To make it as clear as possible, I added some notes to help you quickly understand the code. However, I have a feeling that something is wrong with stack or just with parameter passing. The computation itself is correct (tested with debugger). Survey

Also, in debugger the whole computation works fine, even the jump back from the function works. I have no idea why Matlab crashes.
« Last Edit: February 09, 2023, 04:46:40 AM by Franciswalser »

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: Program crashes
« Reply #1 on: February 08, 2023, 11:03:10 AM »
Code below?

You probably haven't made enough posts to attach code. Cut and paste!

Code tags:

Put the word "code" in square brackets at the top of your code and "/code" in square brackets at the end. No quotes.

Good luck!