From: "Patrick Hogan" Newsgroups: comp.os.msdos.djgpp Subject: djgpp, assembler, dos interrupts and buffers Date: Mon, 9 Aug 1999 19:33:38 -0000 Organization: UUNET Internet Africa Lines: 46 Message-ID: <7on5op$1h2s$1@nnrp01.ops.uunet.co.za> NNTP-Posting-Host: 196-31-64-181.iafrica.com X-Trace: nnrp01.ops.uunet.co.za 934222425 50268 196.31.64.181 (9 Aug 1999 18:13:45 GMT) X-Complaints-To: abuse AT iafrica DOT com NNTP-Posting-Date: 9 Aug 1999 18:13:45 GMT X-Newsreader: Microsoft Outlook Express 4.72.3110.1 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hi, I'm trying to convert some C/C++ code (djgpp) into assembler for a project I'm working on. I've come across a major problem, djgpp doesen't like dos interrupts when dos buffers are involved. I do understand the difference between protected mode linear memory and the real mode memory but even compensating for this by providing the proper segment and offset, refuses to work. Let me provide an example : One function looks like this in C : _go32_dpmi_registers r; memset( &r, 0, sizeof(r) ); r.x.bx = 0x0009; r.x.es = segment_of_dos_buffer; r.x.si = offset_of_dos_buffer; _go32_dpmi_simulate_int( 0x7a, &r ); In NASM I tried : ; prototype: void _get_local_address(long dosseg, long dosofs); __get_local_address: push ebp mov ebp,esp mov es,[ebp+8] mov si,[ebp+12] mov bx, 0009h int 07Ah mov esp,ebp pop ebp ret Which compiles perfectly but crashes the program, so does inline AT&T (gas). I gather the problem is that calling int 07Ah is not the equivalent of _go32_dpmi_simulate_int( 0x7a, &r ), or it IS but somehow it screws up because of real/protected mode clashes. Could someone PLEASE point me to some documentation on real mode interrupts in protected mode programs. Or maybe help me in this headache? Thanks, Patrick Hogan logiknet AT iname DOT com http://come.to/logiknet