Mail Archives: djgpp/1996/07/19/14:31:15
In article <philpri DOT 40 DOT 837639716 AT ee2 DOT ee DOT cit DOT ac DOT nz>,
Richard Philp <philpri AT ee2 DOT ee DOT cit DOT ac DOT nz> wrote:
> I've been needing to do some embedded code in some of my programs latly,
>but theres a problem with one of the opcodes: LES . I've try lesl, but the
>assembler doesn't like it, and when I make the program a library, with this
>command in it, it keeps on crashing, and coming up with a sigsev error (Or
>something similer. I know I've misspelt it.). Anyone know why? Or can
>someone give me a reason for why the assembler doesn't like les?
>Or is there an equlivent?
les is a real-mode instruction used like so
les bx, _some_variable
It loads es with the segment of _some_variable, and bx with the offset.
You probably could do
movw %ds, %es /* assuming it's not already equal */
movl $_some_variable, %ebx
but I'm not sure when you'd need this, unless you're calling a realmode
interrupt. Then you'd
__dpmi_regs regs;
memset(®s, 0, sizeof regs);
regs.x.es = linear_address_of_some_variable / 16;
regs.x.bx = linear_address_of_some_variable & 0xf;
/* plus set up other regs */
__dpmi_int(whatever, ®s);
It's kinda hard to give advice on this without some more info as to
what you're trying to do.
If you need a reference of real-mode instructions get
ftp://x2ftp.oulu.fi/pub/msdos/programming/gpe/pcgpe10.zip
and extract intel.doc, or it might be intel.txt.
--Brennan
--
brennan AT rt66 DOT com | fsck /u
- Raw text -