www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/09/18/08:32:46

Date: Wed, 18 Sep 1996 15:06:42 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: morganp AT indy DOT net
Cc: djgpp AT delorie DOT com
Subject: Re: Timimg.
In-Reply-To: <51o2mk$1rb@news.indy.net>
Message-Id: <Pine.SUN.3.91.960918150239.1273I-100000@is>
Mime-Version: 1.0

On Tue, 17 Sep 1996 morganp AT indy DOT net wrote:

> void Delay(int clicks)
> {
> unsigned int *clock = (unsigned int *)0x0000046CL;
> unsigned int now;
> now = *clock;
> while(abs(*clock - now) < clicks){}
[snip]
> This code however. isn't working. I know it's easy but I'm lost. I

Of course, it's easy: just read the DJGPP FAQ list.  It explains in 
section 18.4 how to access absolute addresses from your program.  Since 
DJGPP is a protected-mode environment, you cannot just put any address 
into a pointer and dereference it.

The latest version of the DJGPP FAQ list is available as v2/faq201b.zip 
from the same place you get DJGPP.

- Raw text -


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