Fix Access Violation Error in x64 Assembly MASM Procedure for Complex Number Square Root Calculation
Here is a numerical simulation application for a job I'm engaged in that involves complex number calculations on Intel Core i7-12700K processor. As part of this simulation, I wrote a procedure in x64 assembly
MASM
to calculate the square root of a complex number.
As I execute the procedure, I encounter an access violation error
at the ret
statement:
Right now I suspect the issue might be related to stack corruption, or improper use of the ret instruction, Please I need help in identifying the root cause of the access violation and correcting the code.1 Reply
i replaced each call to sqrt() C function with the mnemonic sqrtsd since the values i am dealing with are all stored in SSE registers
xmm0
, xmm1
, xmm2
, ...
and it worked