// bcc -ansi -Md -O iodump2.c -o iodump2.com #include unsigned char in_b(unsigned short port) { #asm push bp mov bp, sp mov dx, [bp + 4] in al, dx pop bp #endasm } int main(int argc, char *argv[]) { FILE *fp; unsigned short f, r; static unsigned char buf[256]; fp = fopen("iodump2.bin", "wb"); if (fp == NULL) goto fin0; for (f = 0; f < 256; f++) { for (r = 0; r < 256; r++) { buf[r] = in_b((f << 8) | (r << 0)); } fwrite(buf, sizeof(buf), 1, fp); } fclose(fp); fin0: return 0; }