This commit is contained in:
Mario Fetka
2026-05-23 17:14:56 +02:00
parent b0652ae5d5
commit 347b9ee67f
2 changed files with 41 additions and 0 deletions

View File

@@ -1182,6 +1182,43 @@ static int tests_c32type(void)
}
static int tests_c32values(void)
{
uint8 out[32];
uint16 ax, bx, cx, dx, si, dsreg, esreg;
uint32 esi, ecx;
memset(out, 0, sizeof(out));
C32_LoadNios_Probe(0xD8C1, out);
ax = tests_get_word_lh(out + 0);
esi = tests_get_dword_lh2(out + 2);
ecx = tests_get_dword_lh2(out + 6);
bx = tests_get_word_lh(out + 10);
cx = tests_get_word_lh(out + 12);
dx = tests_get_word_lh(out + 14);
si = tests_get_word_lh(out + 16);
dsreg = tests_get_word_lh(out + 18);
esreg = tests_get_word_lh(out + 20);
fprintf(stdout, "TEST C32VALUES\n");
fprintf(stdout, "AX=%04X ESI=%08lX ECX=%08lX\n", ax, esi, ecx);
fprintf(stdout, "BX=%04X CX=%04X DX=%04X SI=%04X DS=%04X ES=%04X\n",
bx, cx, dx, si, dsreg, esreg);
fprintf(stdout, "\nPointer interpretation:\n");
fprintf(stdout, "ESI as seg:off = %04lX:%04lX\n",
(esi >> 16) & 0xffff, esi & 0xffff);
fprintf(stdout, "ECX as seg:off = %04lX:%04lX\n",
(ecx >> 16) & 0xffff, ecx & 0xffff);
fprintf(stdout, "16-bit regs suggest entry offsets: SI=%04X DX=%04X CX=%04X\n",
si, dx, cx);
fprintf(stdout, "\nNext build will call C32BEGINUSE using these pointers.\n");
return(0);
}
int func_tests(int argc, char *argv[], int mode)
{
if (argc >= 2) {
@@ -1194,6 +1231,9 @@ int func_tests(int argc, char *argv[], int mode)
if (tests_same_arg(argv[1], "C32TYPE"))
return tests_c32type();
if (tests_same_arg(argv[1], "C32VALUES"))
return tests_c32values();
if (tests_same_arg(argv[1], "NWREQ87"))
return tests_nwreq87(argc, argv);