⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 alp.c

📁 the program code converts the given 8085 opcode into mnemonics of assembly level programming... init
💻 C
字号:
#include<stdio.h>
#include<conio.h>
void main()
{
    FILE *fp;
    int i=0, j, r, a[100], temp, n, e;
    char st[10], st1[10], pat[]="data", c;
    clrscr();

    fp=fopen("C:/TURBOC3/my codes/mpa.dat","r");
    scanf("%d", &n);
    for(i=0;i<n;i++)
        scanf("%x", &a[i]);
    printf("\n********** THE MNEMONICS ARE : ***********\n");
    i=0;
    while(i<n)
    {
        temp=0;
        rewind(fp);
        while(1)
        {
            if(fscanf(fp, "%x", &r)==EOF)
                break;
            if(r==a[i])
            {
                e=1;
                while(1)
                {
                    fscanf(fp, "%s", &st);
//                    printf("\"%s\"",st);
                    if(strcmp(st,pat)==0)
                    {
                        temp++;
                        strcpy(st1,st);
                        fscanf(fp, "%s", &st);
                        if(strcmp(st,pat)==0)
                        {
                                printf("%x ", a[i+temp+1]);
                                printf("%x ", a[i+temp]);
                                temp++;
                        }
                        else
                            printf("%x ", a[i+temp]);
                    }
                    else if(strcmp(st,"xx")==0)
                        printf("");
                    else
                        printf("%s ",st);
                        c=fgetc(fp);
                        putchar(c);
                        if(c=='\n')
                            break;
                }
            }
            else
            {
                for(j=0;j<5;j++)
                fscanf(fp,"%s", &st);
            }
        }
        i=i+temp;
        i++;
    }
    fclose(fp);
    getch();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -