comp.lang.ada
 help / color / mirror / Atom feed
From: "David C. Hoos, Sr." <david.c.hoos.sr@ada95.com>
To: <comp.lang.ada@ada.eu.org>
Cc: "Jeffrey Carter" <jrcarter@acm.org>, <chris.danx@ntlworld.com>
Subject: Re: Access types and classwide programming
Date: Sun, 16 Sep 2001 13:24:56 -0500
Date: 2001-09-16T13:24:56-05:00	[thread overview]
Message-ID: <mailman.1000664714.32675.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: 3BA4D81D.E899280D@acm.org

Address clauses apply only to an object, program unit, or label --
not to a type.

----- Original Message -----
From: "Jeffrey Carter" <jrcarter@acm.org>
Newsgroups: comp.lang.ada
To: <comp.lang.ada@ada.eu.org>
Sent: September 16, 2001 11:49 AM
Subject: Re: Access types and classwide programming


"chris.danx" wrote:
>
> "Jeffrey Carter" <jrcarter@acm.org> wrote in message
> news:3BA4447B.66842AB0@acm.org...
> >
> > Frequently, address clauses are a better approach to hardware
> > programming than address to access conversions.
>
> Do you mean
>
>     type X is something;
>     For x'address use blah;

Yes, that is an address clause for X.

>
> I'm afraid I'm quite new to Ada hardware programming, having never done any,
> but hoping to do some soon.  Perhaps there is something I can program to
> gain minimal familiarity with it.  Any suggestions?  (PC with Win9x)

Hardware programming for Win32 is somewhat complicated. A better
approach would be to start with a simple OS, such as DOS; it might be
possible to simulate this using a DOS compiler and running in a DOS box
under Win32. Something I did once involved direct access to the text
screen memory. Having defined a type for the screen memory, I could do
things such as

Display : Screen_Memory;
for Display'Address use ...;

Buffer : Screen_Memory;

-- Create desired image in Buffer

Display := Buffer;

or

Buffer := Display; -- Save current screen image

-- Output to screen

Display := Buffer; -- Restore saved image

This was the sort of thing I did for an overlapping text-windowing
system, in which I kept a stack of screen images and associated
information. Before a window was created, I would make a copy of the
screen and push it on the stack. When the current window was closed, I
would pop the top image off the stack and copy it to the screen.

I have also used address clauses to directly manipulate a VGA card to do
color graphics under DOS. Now we can use things like GtkAda to achieve
the same thing more portably.

--
Jeff Carter
"Sons of a silly person."
Monty Python & the Holy Grail
_______________________________________________
comp.lang.ada mailing list
comp.lang.ada@ada.eu.org
http://ada.eu.org/mailman/listinfo/comp.lang.ada





  reply	other threads:[~2001-09-16 18:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-15 19:36 Access types and classwide programming chris.danx
2001-09-15 20:28 ` chris.danx
2001-09-15 23:42 ` [Different Topic] Endianess? chris.danx
2001-09-16  6:22   ` Jeffrey Carter
2001-09-17  7:37   ` Juanma Barranquero
2001-09-17  7:53     ` Assigning the value of a deferred constant? Juanma Barranquero
2001-09-17 14:04       ` Ted Dennison
2001-09-17 14:36         ` Juanma Barranquero
2001-09-17 17:36           ` tmoran
2001-09-18  8:16             ` Juanma Barranquero
2001-09-18 18:40         ` Richard Riehle
2001-09-19  2:07           ` Vincent Marciante
2001-09-19  7:39           ` Juanma Barranquero
2001-09-16  6:19 ` Access types and classwide programming Jeffrey Carter
2001-09-16 13:37   ` chris.danx
2001-09-16 16:49     ` Jeffrey Carter
2001-09-16 18:24       ` David C. Hoos, Sr. [this message]
2001-09-17  6:15         ` Jeffrey Carter
2001-09-17  4:57     ` tmoran
2001-09-17 14:16       ` Ted Dennison
2001-09-16  9:32 ` tmoran
2001-09-17  9:41 ` John McCabe
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox