home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sources / apple2 / 10 next >
Encoding:
Internet Message Format  |  1992-11-08  |  4.4 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!rutgers!igor.rutgers.edu!yoko.rutgers.edu!jac
  2. From: jac@yoko.rutgers.edu (Jonathan A. Chandross)
  3. Newsgroups: comp.sources.apple2
  4. Subject: v001SRC069:  coff (OMF Disassembler) 04/09
  5. Message-ID: <Nov.8.19.11.54.1992.16614@yoko.rutgers.edu>
  6. Date: 9 Nov 92 00:11:55 GMT
  7. Organization: Rutgers Univ., New Brunswick, N.J.
  8. Lines: 145
  9. Approved: jac@paul.rutgers.edu
  10.  
  11.  
  12. Submitted-by: Albert Chin-A-Young (26285659t@servax.fiu.edu)
  13. Posting-number: Volume 1, Source:69
  14. Archive-name: utility/gs/disassem/coff/part04
  15. Architecture: ONLY_2gs
  16. Version-number: 1.1
  17.  
  18.  
  19. =env.h.s
  20. -* environment defines
  21. -*
  22. -* 1992, tao Developer Project
  23. -
  24. -ORCA_ENV equ %00000001 ;if compiling for ORCA environment
  25. -GNO_ENV equ %00000010 ;if compiling for GNO environment
  26. -MERLIN_ENV equ %00000100 ;if compiling for MERLIN environment
  27. -ENV equ MERLIN_ENV ;default environment to compile for
  28. -
  29. -LINEFEED_CHAR equ $0a ;linefeed character
  30. -RETURN_CHAR equ $0d ;return character
  31. =env.mac.s
  32. -* environment macros
  33. -*
  34. -* 1992, tao Developer Project
  35. -
  36. -put_cr mac ;environment specific carriage return
  37. - do ENV&ORCA_ENV ;orca environment requires cr/lf
  38. - pea #RETURN_CHAR
  39. - _WriteChar
  40. - pea #LINEFEED_CHAR
  41. - _WriteChar
  42. - fin
  43. - do ENV&GNO_ENV ;gno environment requires cr/lf
  44. - pea #RETURN_CHAR
  45. - _WriteChar
  46. - pea #LINEFEED_CHAR
  47. - _WriteChar
  48. - fin
  49. - do ENV&MERLIN_ENV ;merlin environment requires cr
  50. - pea #RETURN_CHAR
  51. - _WriteChar
  52. - fin
  53. - eom
  54. =getopt.h.s
  55. -* UNIX getopt library
  56. -* declarations for getopt
  57. -*
  58. -* albert chin-a-young ... 26285659t@servax.fiu.edu
  59. -
  60. -
  61. -* For communication from 'getopt' to the caller.
  62. -* When 'getopt' finds an option that takes an argument,
  63. -* the argument value is returned here.
  64. -* Also, when 'ordering' is RETURN_IN_ORDER,
  65. -* each non-option ARGV-element is returned here.
  66. -
  67. -optarg ext
  68. -
  69. -* Index in ARGV of the next element to be scanned.
  70. -* This is used for communication to and from the caller
  71. -* and for communication between successive calls to 'getopt'.
  72. -*
  73. -* On entry to 'getopt', zero means this is the first call; initialize.
  74. -*
  75. -* When 'getopt' returns EOF, this is the index of the first of the
  76. -* non-option elements that the caller should itself scan.
  77. -*
  78. -* Otherwise, 'optind' communicates from one call to the next
  79. -* how much of ARGV has been scanned so far.
  80. -
  81. -optind ext
  82. -
  83. -* Callers store zero here to inhibit the error message 'getopt' prints
  84. -* for unrecognized options.
  85. -
  86. -opterr ext
  87. -
  88. -* If nonzero, '-' can introduce long-named options.
  89. -* Set by getopt_long_only.
  90. -
  91. -_getopt_long_only ext
  92. -
  93. -* The index in GETOPT_LONG_OPTIONS of the long-named option found.
  94. -* Only valid when a long-named option has been found by the most
  95. -* recent call to 'getopt'.
  96. -
  97. -option_index ext
  98. -
  99. -* function calls
  100. -*
  101. -init_getopt ext ;initialize command-line arguments
  102. -getopt ext
  103. -getopt_long ext
  104. -getopt_long_only ext
  105. -envopt ext
  106. -
  107. -argc ext ;number of command-line options
  108. -argv ext ;array of pointers to command-line options
  109. -
  110. -;option data structure offsets
  111. -`has_arg equ $00 ;if option has arguments
  112. -`flag equ `has_arg+2 ;pointer to variable to set
  113. -`val equ `flag+4 ;default value of option
  114. -`name equ `val+2 ;long name of option
  115. -
  116. -;argv data structure offsets
  117. -`lo equ $00 ;handle to array of command-line
  118. -`hi equ $04 ;options
  119. =getopt.mac.s
  120. -* UNIX getopt library
  121. -* macros
  122. -*
  123. -* 1992, tao Developer Project
  124. -
  125. -* Describe the long-named options requested by the application.
  126. -* _GETOPT_LONG_OPTIONS is a vector of 'struct option' terminated by an
  127. -* element containing a name which is zero.
  128. -*
  129. -* The field 'has_arg' is:
  130. -*   0 if the option does not take an argument,
  131. -*   1 if the option requires an argument,
  132. -*   2 if the option takes an optional argument.
  133. -*
  134. -* If the field 'flag' is nonzero, it points to a variable that is set
  135. -* to the value given in the field 'val' when the option is found, but
  136. -* left unchanged if the option is not found.
  137. -*
  138. -* To have a long-named option do something other than set an 'int' to
  139. -* a compiled-in constant, such as set a value from 'optarg', set the
  140. -* option's 'flag' field to zero and its 'val' field to a nonzero
  141. -* value (the equivalent single-letter option character, if there is
  142. -* one).  For long options that have a zero 'flag' field, 'getopt'
  143. -* returns the contents of the 'val' field.
  144. -
  145. -option mac
  146. - dw ]2 ;if option has arguments
  147. - adrl ]3 ;flags
  148. - dw ]4 ;value of variable if no option assigned
  149. - if N,]1 ;if at last label (NULL)
  150. - db 0
  151. - else
  152. - pStr ]1 ;name of option
  153. - fin
  154. - eom
  155. + END OF ARCHIVE
  156.