delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/28/21:14:42

From: rock2000 AT ntplx DOT com (Rock)
Newsgroups: comp.os.msdos.djgpp
Subject: Nasm and real-mode ISRs (bimodal)
Message-ID: <379739de.5187825@news.ntplx.com>
X-Newsreader: Forte Free Agent 1.11/32.235
Lines: 35
Date: Thu, 22 Jul 1999 15:50:01 GMT
NNTP-Posting-Host: 204.213.189.209
X-Trace: news.ntplx.net 932702016 204.213.189.209 (Thu, 22 Jul 1999 23:53:36 EDT)
NNTP-Posting-Date: Thu, 22 Jul 1999 23:53:36 EDT
Organization: NETPLEX Internet Services - http://www.ntplx.net/
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I'm trying to setup a bimodal ISR for the keyboard handler and I'm
having big problems under DJGPP (CWSDPMI). I tried just using a
protected mode handler, but I get segment violations RMCBs  (And I've
locked everything the handler touches). Here's my setup:

- Allocate some DOS memory for the real-mode ISR and key table.

- Copy the real mode ISR into the DOS memory. The key table will
reside in low memory so both ISRs can access it. It will be 128 bytes
into the DOS memory block (i.e. after the real mode ISR code).

My problem is with NASM. I can't seem to find a way to write the
real-mode ISR in a way that allows the routine to index the key table.
In other assemblers, I could use "ASSUME cs" to tell the assembler
that I want cs to point to my function and then simply index the table
as cs:[128 + keyIndex]. However, NASM doesn't support ASSUME, and
apparently cs is not coming in pointing directly to my routine.

It says you can write 

mov ax, seg blah
mov es, ax
mov bx, blah 

to have es:bx point to blah, but I tried that and NASM says that COFF
doesn't support anything but 32 bit relocations for the 2 lines above
with "blah" in them.

I even tried hacking it by using cs:ip and trying a get an offset
using that, but NASM won't let me access IP apparently. How the heck
do you make these routines with such limited tools? What am I missing?

Rock


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019