void call_pal (CPUState *env, int palcode)

{

    target_ulong ret;



    if (logfile != NULL)

        fprintf(logfile, "%s: palcode %02x\n", __func__, palcode);

    switch (palcode) {

    case 0x83:

        /* CALLSYS */

        if (logfile != NULL)

            fprintf(logfile, "CALLSYS n " TARGET_FMT_ld "\n", env->ir[0]);

        ret = do_syscall(env, env->ir[IR_V0], env->ir[IR_A0], env->ir[IR_A1],

                         env->ir[IR_A2], env->ir[IR_A3], env->ir[IR_A4],

                         env->ir[IR_A5]);

        if (ret >= 0) {

            env->ir[IR_A3] = 0;

            env->ir[IR_V0] = ret;

        } else {

            env->ir[IR_A3] = 1;

            env->ir[IR_V0] = -ret;

        }

        break;

    case 0x9E:

        /* RDUNIQUE */

        env->ir[IR_V0] = env->unique;

        if (logfile != NULL)

            fprintf(logfile, "RDUNIQUE: " TARGET_FMT_lx "\n", env->unique);

        break;

    case 0x9F:

        /* WRUNIQUE */

        env->unique = env->ir[IR_A0];

        if (logfile != NULL)

            fprintf(logfile, "WRUNIQUE: " TARGET_FMT_lx "\n", env->unique);

        break;

    default:

        if (logfile != NULL)

            fprintf(logfile, "%s: unhandled palcode %02x\n",

                    __func__, palcode);

        exit(1);

    }

}

void call_pal (CPUState *env, int palcode)

{

    target_ulong ret;



    if (logfile != NULL)

        fprintf(logfile, "%s: palcode %02x\n", __func__, palcode);

    switch (palcode) {

    case 0x83:

        

        if (logfile != NULL)

            fprintf(logfile, "CALLSYS n " TARGET_FMT_ld "\n", env->ir[0]);

        ret = do_syscall(env, env->ir[IR_V0], env->ir[IR_A0], env->ir[IR_A1],

                         env->ir[IR_A2], env->ir[IR_A3], env->ir[IR_A4],

                         env->ir[IR_A5]);

        if (ret >= 0) {

            env->ir[IR_A3] = 0;

            env->ir[IR_V0] = ret;

        } else {

            env->ir[IR_A3] = 1;

            env->ir[IR_V0] = -ret;

        }

        break;

    case 0x9E:

        

        env->ir[IR_V0] = env->unique;

        if (logfile != NULL)

            fprintf(logfile, "RDUNIQUE: " TARGET_FMT_lx "\n", env->unique);

        break;

    case 0x9F:

        

        env->unique = env->ir[IR_A0];

        if (logfile != NULL)

            fprintf(logfile, "WRUNIQUE: " TARGET_FMT_lx "\n", env->unique);

        break;

    default:

        if (logfile != NULL)

            fprintf(logfile, "%s: unhandled palcode %02x\n",

                    __func__, palcode);

        exit(1);

    }

}

void FUNC_0 (CPUState *VAR_0, int VAR_1)

{

    target_ulong ret;



    if (logfile != NULL)

        fprintf(logfile, "%s: VAR_1 %02x\n", __func__, VAR_1);

    switch (VAR_1) {

    case 0x83:

        

        if (logfile != NULL)

            fprintf(logfile, "CALLSYS n " TARGET_FMT_ld "\n", VAR_0->ir[0]);

        ret = do_syscall(VAR_0, VAR_0->ir[IR_V0], VAR_0->ir[IR_A0], VAR_0->ir[IR_A1],

                         VAR_0->ir[IR_A2], VAR_0->ir[IR_A3], VAR_0->ir[IR_A4],

                         VAR_0->ir[IR_A5]);

        if (ret >= 0) {

            VAR_0->ir[IR_A3] = 0;

            VAR_0->ir[IR_V0] = ret;

        } else {

            VAR_0->ir[IR_A3] = 1;

            VAR_0->ir[IR_V0] = -ret;

        }

        break;

    case 0x9E:

        

        VAR_0->ir[IR_V0] = VAR_0->unique;

        if (logfile != NULL)

            fprintf(logfile, "RDUNIQUE: " TARGET_FMT_lx "\n", VAR_0->unique);

        break;

    case 0x9F:

        

        VAR_0->unique = VAR_0->ir[IR_A0];

        if (logfile != NULL)

            fprintf(logfile, "WRUNIQUE: " TARGET_FMT_lx "\n", VAR_0->unique);

        break;

    default:

        if (logfile != NULL)

            fprintf(logfile, "%s: unhandled VAR_1 %02x\n",

                    __func__, VAR_1);

        exit(1);

    }

}

void FUNC_0 (CPUState *VAR_0, int VAR_1)
{ target_ulong ret; if (logfile != NULL)
fprintf(logfile, "%s: VAR_1 %02x\n", __func__, VAR_1); switch (VAR_1) { case 0x83:
if (logfile != NULL)
fprintf(logfile, "CALLSYS n " TARGET_FMT_ld "\n", VAR_0->ir[0]); ret = do_syscall(VAR_0, VAR_0->ir[IR_V0], VAR_0->ir[IR_A0], VAR_0->ir[IR_A1],
VAR_0->ir[IR_A2], VAR_0->ir[IR_A3], VAR_0->ir[IR_A4],
VAR_0->ir[IR_A5]); if (ret >= 0) { VAR_0->ir[IR_A3] = 0; VAR_0->ir[IR_V0] = ret; } else { VAR_0->ir[IR_A3] = 1; VAR_0->ir[IR_V0] = -ret; } break; case 0x9E:
VAR_0->ir[IR_V0] = VAR_0->unique; if (logfile != NULL)
fprintf(logfile, "RDUNIQUE: " TARGET_FMT_lx "\n", VAR_0->unique); break; case 0x9F:
VAR_0->unique = VAR_0->ir[IR_A0]; if (logfile != NULL)
fprintf(logfile, "WRUNIQUE: " TARGET_FMT_lx "\n", VAR_0->unique); break; default:
if (logfile != NULL)
fprintf(logfile, "%s: unhandled VAR_1 %02x\n",
__func__, VAR_1); exit(1); } }