C语言 整数常量的后缀“disassemble”无效

x759pob2  于 2022-12-02  发布在  其他
关注(0)|答案(1)|浏览(273)

I'm writing an Intel 8080 Disassembler when I came across this problem.
Here's the code:

int 8080disassemble(unsigned char *cbuffer, int pc){
    unsigned char* code=&cbuffer[pc];
    int opbytes=1;
    printf("%04x ",pc);
    switch(*code){
        case 0x00:printf("NOP");
            break;
        case 0x01:printf("LXI B,#$%02x%02x",code[2],code[1]);opbytes=3;
            break;
        case 0x02:printf("STAX B");
            break;
        case 0x03:printf("INX B");
            break;
        case 0x04:printf("INR B");
            break;
        case 0x05:printf("DCR B");
            break;
        case 0x06:printf("MVI B,#$%02x",code[1]);opbytes=2;
            break;
    }
}

It's a header file, that's why there is no includings.
Thanks!
I tried making it a pointer but didn't work

fafcakar

fafcakar1#

C语言中的标识符(如函数和变量名)不允许以数字开头。编译器试图将8080disassemble解析为数字,当它到达d时会出现混乱。
请为函数选择其他名称,例如cpu_8080_disassembledisassemble_8080

相关问题