小编jwi*_*l22的帖子

将C代码翻译为Assembly

我需要将此C代码转换为汇编语言代码

#include <stdio.h>
#include <stdlib.h>

int main(void)
{
    int answer, i;
    int right, wrong;
    right = 0;
    wrong = 0;

    for(i =1; i < 11; i = i+1){
        printf("What is %d + %d? ", i,i);
        scanf( "%d", &answer);

        if(answer == i + 1) {
            printf("right!  ");
            right++;
        }
        else {
            printf("Sorry, you're wrong.    ");
            printf("The answer is %d.   ", i + 1);
            wrong++;
        }
    }
    printf("You got %d right and %d wrong. ", right, wrong );
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

我真的只需要知道如何将变量与汇编语言中的字符串组合在一起,就像上面的C代码一样.我想我可以处理其他一切.有人可以告诉我.我是否必须使用某种参考[]. …

c x86 assembly masm irvine32

3
推荐指数
2
解决办法
1636
查看次数

C程序的Debug Assertion错误

这是错误消息图片的链接:

http://www.flickr.com/photos/76298377@N02/6798897020/in/photostream

这是实际的编程问题.这是3号

http://books.google.com/books?id=bSy1hBCLNl8C&pg=PA335&lpg=PA335&dq=sales.dat+c%2B%2B&source=bl&ots=mmN9b4WzsN&sig=miAD8-u4ly8K1Mou9ZNHv90Nscc&hl=en&sa=X&ei=2wdQT_-4OtSCsgK-l5WyDg&ved=0CDcQ6AEwAg# v =&onepage q = sales.dat%20C%2B%2B&F =假

这是源代码

#include <iostream>
#include <string>
#include<stdio.h>

using namespace std;

#define numItems     8
#define numSalesP   10

// the product prices 
float prices  [numItems] = {345.0,  853.0, 471.0, 933.0, 721.0, 663.0, 507.0, 259.00};

// the product numbers
int   prodNum [numItems] = {7,      8,     9,     10,    11,    12,    13,    14};

// the salespersons IDs
int   salesP  [numSalesP] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};

// the output file pointers …
Run Code Online (Sandbox Code Playgroud)

c c++ pointers project

-4
推荐指数
1
解决办法
1261
查看次数

标签 统计

c ×2

assembly ×1

c++ ×1

irvine32 ×1

masm ×1

pointers ×1

project ×1

x86 ×1