我如何才能将此c ++运行程序转换为汇编语言x86以在DOSBOX中运行?

#include <iostream>

使用名称空间std;

int main(){

    int ax,bx,cx;
    int disc;

    cout<<"Enter an integer for the following Discriminate Formula (B^2-4AC): "<< endl;
    cout<<"A = ";
    cin >>ax;
    cout<<"B = ";
    cin >>bx;
    cout<<"C = ";
    cin >>cx;


    disc = (bx*bx) - (4*ax*cx);

    if(disc > 0){
        cout<<"Discriminant is "<<disc
            <<" which is GREATER\n"<<endl;

    }
    else if(disc == 0){
        cout<<"Discriminant is "<<disc
            <<" which is EQUAL\n"<<endl;

    }
    else if(disc < 0){
        cout<<"Discriminant is "<<disc
            <<" which is LESS\n"<<endl;

    return 0;
}

}

这是正在运行的.cpp代码,我正在使用DosBox运行一些.asm文件,并通过wans对其进行转换。如果有转换器或其他有用的方法,请告诉我。谢谢!

评论