i have to print an statement based on whther a value is positive, negative or equal to zero in c++, but the logic of the decition has to be in assembler. the logic i have alredy works but when i try to move the string value to the string dedicated to the ouput i get a wrong operand type error.
#include <iostream>
#include <string>
int main(){
double r;
std::string mNeg="r its negative, r = ",
mPos="r its positive, r = ",
mEqu="r its equal to zero, r = ",
mOutput;
_asm{
.
.
.
.
calculate r
.
.
.
.
;comparison
equal:
fld r
ftst
fstsw ax
fwait
sahf
ja Jpos
jb Jneg
mov mOutput, mEqu ;<---this is where the error happens
jmp fin
Jpos:
mov mOutput, mPos ;<---this is where the error happens
jmp fin
Jneg:
mov mOutput, mNeg ;<---this is where the error happens
fin:
}
std::cout<<mOutput<<r; ;<---here i'm supposed to print the output
}