delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/06/04/19:35:22

From: XXguille AT XXiies DOT XXes (Guillermo Rodriguez Garcia)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: accessing locked memory?
Date: Fri, 04 Jun 1999 22:31:09 GMT
Organization: Telefonica Transmision de Datos
Lines: 32
Message-ID: <37580e87.622567@noticias.iies.es>
References: <3757BC75 DOT 6F0DAD7F AT swipnet DOT se>
NNTP-Posting-Host: iies135.iies.es
Mime-Version: 1.0
X-Newsreader: Forte Agent 1.5/32.451
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

El día Fri, 04 Jun 1999 13:45:58 +0200, Anders David Skarin
<hobbit AT swipnet DOT se> escribió:

>word MOUSE_getX(void)
>{
>    __asm__("cli");
>    return (mouse.x);
>    __asm__("sti");
>}

Do you know what 'return' means? That __asm__("sti") has no chance of
ever being reached, so I guess you are turning off interrupts at the
very beginning of your program and then never turning them on again,
so your mouse handler won't be called and mouse.x will remain 0.

Anyway, you don't need to disable interrupts just to read that struct
member.

>but it wont return nothing but zero.. ...is this because the mouse
>struct is locked, and can only be accessed by the handler?

No.

>Question2: Does locked memory go inte conventional memory?

No.

Regards,
GUILLE
----
Guillermo Rodriguez Garcia
XXguille AT XXiies DOT XXes (ya sabes :-)

- Raw text -


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