To: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: movedata vs dosmemput Date: Sun, 07 Aug 94 09:18:36 +0300 From: eliz AT is DOT elta DOT co DOT il movedata() and dosmemxxx() should do the same thing, but movedata() seems not always to work. The following short program illustrates this. Under DPMI, it GP faults when movedata() is used, but works ok if dosmemput() is used instead. (When invoked with GO32=nodpmi, it doesn't bomb, but prints garbage instead of argv[0].) -------------- file movd_tst.c ------------------- #include #include #include #include void main(int argc, char *argv[]) { char progname[128]; #ifdef MOVEDATA movedata(_go32_my_ds(), (u_int)argv[0], _go32_conventional_mem_selector(), _go32_info_block.linear_address_of_transfer_buffer, strlen(argv[0]) + 1); #else dosmemput(argv[0], strlen(argv[0]) + 1, _go32_info_block.linear_address_of_transfer_buffer); #endif dosmemget(_go32_info_block.linear_address_of_transfer_buffer, strlen(argv[0]) + 1, progname); printf("Copy: %s\n", progname); exit(0); } ----------------------------------------------------- What's the reason for that? I want to use movedata() because it's faster: it moves 32-bit words instead of bytes (my actual program moves more than a few bytes to conventional memory, so it could be a win). What am I doing wrong? Can anybody help me? Eli Zaretskii