delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/24/07:54:56

Date: Thu, 24 Apr 1997 14:43:07 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: a DOT phillips AT bohm DOT anu DOT edu DOT au
cc: djgpp AT delorie DOT com
Subject: Re: Help: Using the clock to seed srand()
In-Reply-To: <335C6DB3.39D@student.anu.edu.au>
Message-ID: <Pine.SUN.3.91.970424144239.11402W-100000@is>
MIME-Version: 1.0

On Tue, 22 Apr 1997, Alistair Phillips wrote:

> I have declared clock as
> 
> unsigned int clock = (unsigned int *)0x0000046CL;
> 
> then I call it
> 
> srand(*clock);
> 
> it compiles and links OK but when I run it I get a huge error message

You are using real-mode tricks in a protected-mode program, which is
why your program crashes.  You can't access absolute addresses in that
way, because protected mode doesn't allow that.

Please read the DJGPP FAQ list, section 18.4, for an explanation of
how to do that in DJGPP.  The FAQ is available as v2/faq210b.zip from
the same place you get DJGPP.

- Raw text -


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