diff --git a/nwtests.c b/nwtests.c index 607b17d..3fb3b97 100644 --- a/nwtests.c +++ b/nwtests.c @@ -1518,6 +1518,53 @@ static int tests_c32openref(int argc, char *argv[]) } +static int tests_c32mapconn_value(UI conn16, UI label) +{ + uint8 regs[16]; + uint8 reply[128]; + int rc; + + memset(regs, 0, sizeof(regs)); + memset(reply, 0, sizeof(reply)); + + /* + * Exact first half of __C32MapConn16To32: + * reg.CX = conn16 + * reg.ES:DI = reply buffer + * NWCVLMREQ(flags=2, regblk, p1=0Dh, p2=10h, p3=0) + */ + tests_set_reg_word(regs, 4, FP_OFF(reply)); /* DI */ + tests_set_reg_word(regs, 6, FP_SEG(reply)); /* ES */ + tests_set_reg_word(regs, 12, conn16); /* CX */ + + fprintf(stdout, "\nC32MAPCONN value=%u label=%u\n", conn16, label); + tests_dump_vlm_regs("REG in :", regs); + fprintf(stdout, "Call NWCVLMREQ flags=2 p1=000D p2=0010 p3=0000\n"); + + rc = Net_Call_NWCVLMREQ(2, regs, 0x000D, 0x0010, 0); + + fprintf(stdout, "NWCVLMREQ rc=%04X\n", rc); + tests_dump_vlm_regs("REG out:", regs); + tests_dump_bytes("REPLY:", reply, 64); + fprintf(stdout, "REPLY text: %s\n", reply); + + return rc; +} + +static int tests_c32mapconnone(int argc, char *argv[]) +{ + UI val; + + if (argc < 3) { + fprintf(stdout, "Usage: TESTS C32MAPCONNONE value\n"); + return(1); + } + + val = (UI)atoi(argv[2]); + return tests_c32mapconn_value(val, val); +} + + int func_tests(int argc, char *argv[], int mode) { if (argc >= 2) { @@ -1548,6 +1595,9 @@ int func_tests(int argc, char *argv[], int mode) if (tests_same_arg(argv[1], "C32OPENREF")) return tests_c32openref(argc, argv); + if (tests_same_arg(argv[1], "C32MAPCONNONE")) + return tests_c32mapconnone(argc, argv); + if (tests_same_arg(argv[1], "NWREQ87C32MATRIX")) return tests_nwreq87c32matrix();