www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/13/10:46:23

From: Johan Levin <johan AT technologist DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: GAS segment override
Date: Tue, 11 Nov 1997 21:10:36 +0100
Organization: A customer of Tele2
Lines: 23
Message-ID: <3468BBBC.1220@technologist.com>
NNTP-Posting-Host: mn8.swip.net
Mime-Version: 1.0
Cache-Post-Path: mn8!s-49839 AT dialup146-1-19 DOT swipnet DOT se
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hi!

I'm making a simple ISR that will hook IRQ 0.
To set the ds to the correct value I read
___djgpp_ds_alias. This variable is relative to
the cs-segment.

How do I do something like:
	mov	ax, cs:[___djgpp_ds_alias]
I've tried:
	cs:
	movw	___djgpp_ds_alias, %ax
but it doesn't work. I get a sigsegv and in the dump
I can see that ds is set to an illegal value.
Allegro does it this way:
	.byte 0x2e
	movw	___djgpp_ds_alias, %ax

But I'd like a neater wayt than to use '.byte'.
'.byte' looks like a temporary solution.
Does anyone know if this is possible?

/Johan Levin

- Raw text -


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