home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / ada / 3892 < prev    next >
Encoding:
Text File  |  1993-01-06  |  2.9 KB  |  59 lines

  1. Newsgroups: comp.lang.ada
  2. Path: sparky!uunet!elroy.jpl.nasa.gov!ames!agate!spool.mu.edu!umn.edu!The-Star.honeywell.com!saifr00.cfsat.honeywell.com!hawkinsg
  3. From: hawkinsg@saifr00.cfsat.honeywell.com (Glenn Hawkins)
  4. Subject: Basic embedded concepts and Ada
  5. Message-ID: <1993Jan6.022544.15622@saifr00.cfsat.honeywell.com>
  6. Organization: Honeywell Air Transport Systems Division
  7. Distribution: comp.lang.ada
  8. Date: Wed, 6 Jan 93 02:25:44 GMT
  9. Lines: 48
  10.  
  11. Howdy!
  12.  
  13. I have some REALLY basic embedded software design questions pertaining to Ada.
  14. Although I've got embedded programming experience (mainly in JOVIAL), I've never
  15. written anything so down-in-the-guts-of-the-hardware before.  All of my Ada 
  16. experience is in non-embedded applications, so if some of these questions seem 
  17. really stupid, I apologize in advance...
  18.  
  19. I'm in the middle of writing a device driver in Ada targeted to the AMD 29050.
  20. The interface hardware is somewhat complicated, with all sorts of odd-sized 
  21. status registers, control registers, etc. to assist the software in BIT
  22. and other hardware manipulations.  They are all laid out in a memory map, so I've
  23. already figured out that I need to "tie" the addresses of the objects representing
  24. these registers to the addresses specified in the memory map using rep specs.
  25. As a novice at this sort of thing, that wasn't immediately obvious to me :(.
  26.  
  27. I think that to set bits in these registers it would be easiest for
  28. me to define the objects representing the registers as 32-bit integers, allowing
  29. me to simply add constants (1, 2, 4, 8, etc.) representing the different bits
  30. I want to set. Just like I would in JOVIAL, C, etc.   Although our compiler is 
  31. pretty efficient with word and byte level accesses, it pretty much chokes on bit 
  32. level accesses, so representing the different registers as records of bits 
  33. (appropriately rep spec'ed, of course) doesn't seem practical.  I'm sure many 
  34. of you have successfully solved this problem.  Does my approach make sense?
  35. Are there any Ada-unique gotchas here?
  36.  
  37. Seeing if a bit has been set seems more difficult.  All the approaches I've looked
  38. at so far (multiplying by constants to simulate shifts, etc.) seem to be REALLY 
  39. messy, since I'm used to using shifts, ANDs, etc. to isolate "bits of
  40. interest".  I would like to avoid machine code insertions if possible.  Any ideas?
  41.  
  42. Question:  Will shifts, ANDs, ORs, etc be available in Ada 9x?
  43.   
  44. For my own edification, why aren't these types of things available now, since Ada
  45. was in part designed for embedded systems programming?  I really like Ada, but at
  46. first glance it seems as if the old girl is a bit deficient in this area...
  47.  
  48. Please respond via e-mail, unless you think it's of general interest to the net.
  49. Any help will be greatly appreciated...
  50.  
  51. My opinions are my own.
  52.  
  53. Glenn Hawkins  -- "hawkinsg@saifr00.cfsat.honeywell.com" 
  54. Senior Project Engineer
  55. Boeing 777 ACMF
  56. Honeywell ATSD 
  57. Phoenix, Az
  58.  
  59.