home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / acorn / tech / 1005 < prev    next >
Encoding:
Text File  |  1992-12-14  |  1.1 KB  |  73 lines

  1. Newsgroups: comp.sys.acorn.tech
  2. Path: sparky!uunet!mcsun!sunic!ugle.unit.no!solan1.solan.unit.no!troeste
  3. From: troeste@solan.unit.no (Trygve R|ste)
  4. Subject: ObjAsm: Conditional includes
  5. Message-ID: <1992Dec14.123731.3037@ugle.unit.no>
  6. Sender: news@ugle.unit.no (NetNews Administrator)
  7. Organization: Norwegian Institute of Technology
  8. Date: Mon, 14 Dec 92 12:37:31 GMT
  9. Lines: 62
  10.  
  11. #ifndef _objasm_problem
  12. #define _objasm_problem
  13.  
  14. A problem with ObjAsm is the that the headerfile containg the register names, 
  15. only can be included once. If it is included more than one time, you get an
  16. error saying that the registername is already defined.
  17.  
  18. Here is an example:
  19.  
  20. ; >h.regs
  21.  
  22. r0 RN 0
  23. r1 RN 1
  24. ...
  25.  
  26. END
  27.  
  28. ; >h.someinclude
  29.  
  30. GET h.regs
  31.  
  32. ...
  33.  
  34. END
  35.  
  36.  
  37. ; >s.some objasm file
  38.  
  39. GET h.regs
  40. GET h.someinclude
  41.  
  42. ...
  43.  
  44. END
  45.  
  46.  
  47. Now h.regs. will be included twice, resulting in an error. In Ansi-C, this is
  48. cured in an elegant way:
  49.  
  50. /* >h.include1
  51.  
  52. #ifndef _h_include1
  53. #define _h_include1
  54.  
  55. /* body of includefile: */
  56.  
  57. void function a();
  58. void function b();
  59.  
  60. struct ...
  61.  
  62. ...
  63.  
  64. #endif
  65.  
  66.  
  67. Now, the body of the includefile is only inserted once. Is something like this
  68. possible in ObjAsm/AAsm?
  69.  
  70. -Trygve
  71.  
  72. #endif
  73.