| www.delorie.com/archives/browse.cgi | search |
| X-Authentication-Warning: | delorie.com: mailnull set sender to djgpp-bounces using -f |
| From: | "Joel Saunders" <jbs30000 AT aol DOT com> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Try this... |
| Date: | Tue, 5 Mar 2002 17:53:03 +0000 (UTC) |
| Organization: | Mailgate.ORG Server - http://www.Mailgate.ORG |
| Lines: | 45 |
| Message-ID: | <65f8aa920cde3ff34e24773b5831c770.62691@mygate.mailgate.org> |
| References: | <d26d20a2 DOT 0203050120 DOT 5157c02c AT posting DOT google DOT com> |
| NNTP-Posting-Host: | spider-ntc-ta053.proxy.aol.com |
| X-Trace: | news.mailgate.org 1015333447 25792 198.81.16.43 (Tue Mar 5 18:53:03 2002) |
| X-Complaints-To: | abuse AT mailgate DOT org |
| NNTP-Posting-Date: | Tue, 5 Mar 2002 17:53:03 +0000 (UTC) |
| Injector-Info: | news.mailgate.org; posting-host=spider-ntc-ta053.proxy.aol.com; posting-account=62691; posting-date=1015333447 |
| User-Agent: | Mailgate Web Server |
| X-URL: | http://mygate.mailgate.org/mynews/comp/comp.os.msdos.djgpp/65f8aa920cde3ff34e24773b5831c770.62691%40mygate.mailgate.org |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
#include <sys/farptr.h>
#include <stdio.h>
#include <crt0.h>
#include <dpmi.h>
#include <go32.h>
unsigned char SChar;
int _crt0_startup_flags = _CRT0_FLAG_LOCK_MEMORY;
static __dpmi_regs callback_regs;
static _go32_dpmi_seginfo info;
void Int_2F_Handler(_go32_dpmi_registers *r);
main()
{
unsigned short Offset, Segment;
Offset = _farpeekw(_dos_ds, 0xBC);
Segment = _farpeekw(_dos_ds, 0xBD);
printf("\nOld 0DH Segment%X\nOld 0DH Offset%X\n", Segment,
Offset);
__dpmi_regs r;
info.pm_offset = (long)Int_2F_Handler;
_go32_dpmi_allocate_real_mode_callback_iret(&info,
&callback_regs);
_go32_dpmi_set_real_mode_interrupt_vector(0x2F, &info);
r.x.ax = 0x252F;
r.x.ds = info.rm_segment;
r.x.dx = info.rm_offset;
__dpmi_int(0x21, &r);
Offset = _farpeekw(_dos_ds, 0xBC);
Segment = _farpeekw(_dos_ds, 0xBD);
printf("\nNew 0DH Segment%X\nNew 0DH Offset%X\n", Segment,
Offset);
/* __djgpp_exception_toggle(); */ /* Only needed if
exceptions linked */
r.x.ax = 0x3100;
r.x.dx = 16;
__dpmi_int(0x21, &r);
}
void Int_2F_Handler(_go32_dpmi_registers *r)
{
/* Your code here */
}
--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |