POV-Ray : Newsgroups : povray.off-topic : Does anybody know this? : Re: Does anybody know this? Server Time
11 Oct 2024 11:10:07 EDT (-0400)
  Re: Does anybody know this?  
From: Darren New
Date: 2 Dec 2007 20:16:50
Message: <47535902@news.povray.org>
Jim Henderson wrote:
> Ahhhh, I was thinking you/we were talking about calling interrupts - 

Now you got me curious, and I pulled down my Ada textbook.

Turns out the interrupt procedures don't have arguments (other than, of 
course, knowing which interrupt it was). I suppose that makes sense at a 
machine level, except for the software interrupts.

You can have declarations like
   for X'address use A;
to make X get allocated at the address represented by A. Works for code 
or data, meaning you don't have to do anything funky to put code in a 
particular ROM address, for example.

You can, of course, say
   for X'address use Y'address;
to alias X and Y together, if they are, say, different types for the 
same hardware or something.

(Note: X'Y is the syntax for accessing compile-time property Y of object 
X, so in Ada, it would be something like X'size instead of sizeof(x))

There's also decomposed addresses, letting you extract the segment and 
offset from a segmented address.

There's also Atomic and Volatile declarations (with the obvious 
semantics), the 'alignment attribute, the 'bit_order attribute (to 
control the order of allocations that C would use for bitfields in 
structs), the 'storage_size expression that lets you overallocate 
storage for an object (so you can, for example, allocate one block of 
flash to a particular set of routines or data).

You can set the dispatch policies (like whether tasks are FIFO within 
the priorities, or whether they run to completion, or whatever), and 
(hey Warp) the 'Immediate_Reclamation attribute, which means storage for 
a declared object is reclaimed as soon as the object ceases to exist. ;-)

Given all that, it still can be a pretty annoying language to use.

> I'm fairly sure I didn't write them 
> in assembler, but it has been 20+ years since I did that, so maybe I did 
> do that.

I'm guessing you did the same sort of thing that old BASIC programs did, 
which was machine code in DATA statements poked into memory and then 
executed.  If your compiler translates integers to addresses in a 
straightforward way, it would be pretty easy to do that in C.

-- 
   Darren New / San Diego, CA, USA (PST)
     It's not feature creep if you put it
     at the end and adjust the release date.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.