Path: utzoo!utgpu!water!watmath!mks!alex From: alex@mks.UUCP (Alex White) Newsgroups: comp.sys.ibm.pc Subject: Bug in MSC5.0 routine _dos_read() in small model Keywords: Bug MSC5.0 _dos_read Message-ID: <410@mks.UUCP> Date: 24 Feb 88 14:08:42 GMT Organization: Mortice Kern Systems, Waterloo, Ont. Lines: 13 The routine _dos_read takes a far pointer as the buffer address. This pointer is loaded into DS:DX, and the int call is issued. The problem is that the number of bytes actually read is stored thru a pointer in the argument list - but this is done BEFORE the value of DS is restored. From the debugger, the code in _dos_read reads: ... int 21 mov bx,[bp+0c] # Fetch address of returned byte count mov [bx], ax # Store it pop ds # Restore ds as it was before we loaded the # far pointer buffer address Thus the byte count isn't returned - but perhaps worse is an arbitrary word in memory [possibly in the data you read in] has been destroyed.