laag-nasm 2.13.03.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (455) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +57 -0
  3. data/LICENSE.txt +29 -0
  4. data/README.org +34 -0
  5. data/ext/laag/nasm/extconf.rb +16 -0
  6. data/laag-nasm.gemspec +20 -0
  7. data/lib/laag/nasm.rb +29 -0
  8. data/patches/Makefile.in.patch +13 -0
  9. data/vendor/repo.or.cz/nasm/.gitignore +102 -0
  10. data/vendor/repo.or.cz/nasm/AUTHORS +137 -0
  11. data/vendor/repo.or.cz/nasm/CHANGES +2 -0
  12. data/vendor/repo.or.cz/nasm/ChangeLog +2905 -0
  13. data/vendor/repo.or.cz/nasm/INSTALL +102 -0
  14. data/vendor/repo.or.cz/nasm/LICENSE +29 -0
  15. data/vendor/repo.or.cz/nasm/Makefile.in +855 -0
  16. data/vendor/repo.or.cz/nasm/Mkfiles/README +46 -0
  17. data/vendor/repo.or.cz/nasm/Mkfiles/msvc.mak +732 -0
  18. data/vendor/repo.or.cz/nasm/Mkfiles/openwcom.mak +706 -0
  19. data/vendor/repo.or.cz/nasm/README +23 -0
  20. data/vendor/repo.or.cz/nasm/SubmittingPatches +116 -0
  21. data/vendor/repo.or.cz/nasm/TODO +376 -0
  22. data/vendor/repo.or.cz/nasm/aclocal.m4 +139 -0
  23. data/vendor/repo.or.cz/nasm/asm/assemble.c +2957 -0
  24. data/vendor/repo.or.cz/nasm/asm/assemble.h +54 -0
  25. data/vendor/repo.or.cz/nasm/asm/directiv.c +566 -0
  26. data/vendor/repo.or.cz/nasm/asm/directiv.dat +92 -0
  27. data/vendor/repo.or.cz/nasm/asm/error.c +202 -0
  28. data/vendor/repo.or.cz/nasm/asm/eval.c +1014 -0
  29. data/vendor/repo.or.cz/nasm/asm/eval.h +49 -0
  30. data/vendor/repo.or.cz/nasm/asm/exprdump.c +79 -0
  31. data/vendor/repo.or.cz/nasm/asm/exprlib.c +200 -0
  32. data/vendor/repo.or.cz/nasm/asm/float.c +952 -0
  33. data/vendor/repo.or.cz/nasm/asm/float.h +54 -0
  34. data/vendor/repo.or.cz/nasm/asm/labels.c +540 -0
  35. data/vendor/repo.or.cz/nasm/asm/listing.c +346 -0
  36. data/vendor/repo.or.cz/nasm/asm/listing.h +113 -0
  37. data/vendor/repo.or.cz/nasm/asm/nasm.c +1855 -0
  38. data/vendor/repo.or.cz/nasm/asm/parser.c +1167 -0
  39. data/vendor/repo.or.cz/nasm/asm/parser.h +45 -0
  40. data/vendor/repo.or.cz/nasm/asm/phash.pl +109 -0
  41. data/vendor/repo.or.cz/nasm/asm/pptok.dat +96 -0
  42. data/vendor/repo.or.cz/nasm/asm/pptok.pl +271 -0
  43. data/vendor/repo.or.cz/nasm/asm/pragma.c +218 -0
  44. data/vendor/repo.or.cz/nasm/asm/preproc-nop.c +188 -0
  45. data/vendor/repo.or.cz/nasm/asm/preproc.c +5459 -0
  46. data/vendor/repo.or.cz/nasm/asm/preproc.h +55 -0
  47. data/vendor/repo.or.cz/nasm/asm/quote.c +479 -0
  48. data/vendor/repo.or.cz/nasm/asm/quote.h +44 -0
  49. data/vendor/repo.or.cz/nasm/asm/rdstrnum.c +68 -0
  50. data/vendor/repo.or.cz/nasm/asm/segalloc.c +51 -0
  51. data/vendor/repo.or.cz/nasm/asm/stdscan.c +345 -0
  52. data/vendor/repo.or.cz/nasm/asm/stdscan.h +49 -0
  53. data/vendor/repo.or.cz/nasm/asm/strfunc.c +359 -0
  54. data/vendor/repo.or.cz/nasm/asm/tokens.dat +135 -0
  55. data/vendor/repo.or.cz/nasm/asm/tokhash.pl +284 -0
  56. data/vendor/repo.or.cz/nasm/autogen.sh +9 -0
  57. data/vendor/repo.or.cz/nasm/common/common.c +122 -0
  58. data/vendor/repo.or.cz/nasm/config/msvc.h +192 -0
  59. data/vendor/repo.or.cz/nasm/config/unknown.h +51 -0
  60. data/vendor/repo.or.cz/nasm/config/watcom.h +74 -0
  61. data/vendor/repo.or.cz/nasm/configure.ac +253 -0
  62. data/vendor/repo.or.cz/nasm/contrib/MSVC6.txt +25 -0
  63. data/vendor/repo.or.cz/nasm/contrib/VSrules/nasm.README +16 -0
  64. data/vendor/repo.or.cz/nasm/contrib/VSrules/nasm.rules +79 -0
  65. data/vendor/repo.or.cz/nasm/disasm/disasm.c +1735 -0
  66. data/vendor/repo.or.cz/nasm/disasm/disasm.h +49 -0
  67. data/vendor/repo.or.cz/nasm/disasm/ndisasm.c +397 -0
  68. data/vendor/repo.or.cz/nasm/disasm/sync.c +132 -0
  69. data/vendor/repo.or.cz/nasm/disasm/sync.h +45 -0
  70. data/vendor/repo.or.cz/nasm/doc/Makefile.in +86 -0
  71. data/vendor/repo.or.cz/nasm/doc/README +20 -0
  72. data/vendor/repo.or.cz/nasm/doc/afmmetrics.ph +102 -0
  73. data/vendor/repo.or.cz/nasm/doc/changes.src +2588 -0
  74. data/vendor/repo.or.cz/nasm/doc/findfont.ph +180 -0
  75. data/vendor/repo.or.cz/nasm/doc/genps.pl +1294 -0
  76. data/vendor/repo.or.cz/nasm/doc/inslist.pl +108 -0
  77. data/vendor/repo.or.cz/nasm/doc/internal.doc +290 -0
  78. data/vendor/repo.or.cz/nasm/doc/local.css +1 -0
  79. data/vendor/repo.or.cz/nasm/doc/nasmdoc.css +150 -0
  80. data/vendor/repo.or.cz/nasm/doc/nasmdoc.src +8309 -0
  81. data/vendor/repo.or.cz/nasm/doc/nasmlogo.eps +212 -0
  82. data/vendor/repo.or.cz/nasm/doc/nasmlogw.png +0 -0
  83. data/vendor/repo.or.cz/nasm/doc/psfonts.ph +53 -0
  84. data/vendor/repo.or.cz/nasm/doc/pspdf.pl +98 -0
  85. data/vendor/repo.or.cz/nasm/doc/pswidth.ph +25 -0
  86. data/vendor/repo.or.cz/nasm/doc/rdsrc.pl +1111 -0
  87. data/vendor/repo.or.cz/nasm/doc/ttfmetrics.ph +63 -0
  88. data/vendor/repo.or.cz/nasm/headers/c +33 -0
  89. data/vendor/repo.or.cz/nasm/headers/doc +33 -0
  90. data/vendor/repo.or.cz/nasm/headers/mac +33 -0
  91. data/vendor/repo.or.cz/nasm/headers/perl +33 -0
  92. data/vendor/repo.or.cz/nasm/include/compiler.h +277 -0
  93. data/vendor/repo.or.cz/nasm/include/disp8.h +45 -0
  94. data/vendor/repo.or.cz/nasm/include/error.h +135 -0
  95. data/vendor/repo.or.cz/nasm/include/hashtbl.h +85 -0
  96. data/vendor/repo.or.cz/nasm/include/iflag.h +173 -0
  97. data/vendor/repo.or.cz/nasm/include/insns.h +76 -0
  98. data/vendor/repo.or.cz/nasm/include/labels.h +60 -0
  99. data/vendor/repo.or.cz/nasm/include/md5.h +21 -0
  100. data/vendor/repo.or.cz/nasm/include/nasm.h +1246 -0
  101. data/vendor/repo.or.cz/nasm/include/nasmint.h +219 -0
  102. data/vendor/repo.or.cz/nasm/include/nasmlib.h +524 -0
  103. data/vendor/repo.or.cz/nasm/include/opflags.h +271 -0
  104. data/vendor/repo.or.cz/nasm/include/perfhash.h +52 -0
  105. data/vendor/repo.or.cz/nasm/include/raa.h +46 -0
  106. data/vendor/repo.or.cz/nasm/include/rbtree.h +51 -0
  107. data/vendor/repo.or.cz/nasm/include/rdoff.h +169 -0
  108. data/vendor/repo.or.cz/nasm/include/saa.h +94 -0
  109. data/vendor/repo.or.cz/nasm/include/strlist.h +55 -0
  110. data/vendor/repo.or.cz/nasm/include/tables.h +70 -0
  111. data/vendor/repo.or.cz/nasm/include/ver.h +47 -0
  112. data/vendor/repo.or.cz/nasm/install-sh +250 -0
  113. data/vendor/repo.or.cz/nasm/macros/altreg.mac +107 -0
  114. data/vendor/repo.or.cz/nasm/macros/fp.mac +54 -0
  115. data/vendor/repo.or.cz/nasm/macros/ifunc.mac +48 -0
  116. data/vendor/repo.or.cz/nasm/macros/macros.pl +294 -0
  117. data/vendor/repo.or.cz/nasm/macros/smartalign.mac +189 -0
  118. data/vendor/repo.or.cz/nasm/macros/standard.mac +226 -0
  119. data/vendor/repo.or.cz/nasm/misc/Doxyfile +752 -0
  120. data/vendor/repo.or.cz/nasm/misc/Nindent +18 -0
  121. data/vendor/repo.or.cz/nasm/misc/README +2 -0
  122. data/vendor/repo.or.cz/nasm/misc/c16.mac +82 -0
  123. data/vendor/repo.or.cz/nasm/misc/c32.mac +52 -0
  124. data/vendor/repo.or.cz/nasm/misc/crcgen.c +44 -0
  125. data/vendor/repo.or.cz/nasm/misc/exebin.mac +57 -0
  126. data/vendor/repo.or.cz/nasm/misc/exebin2.mac +114 -0
  127. data/vendor/repo.or.cz/nasm/misc/fmtinsns.pl +40 -0
  128. data/vendor/repo.or.cz/nasm/misc/genfma.pl +63 -0
  129. data/vendor/repo.or.cz/nasm/misc/hints.txt +26 -0
  130. data/vendor/repo.or.cz/nasm/misc/magic +6 -0
  131. data/vendor/repo.or.cz/nasm/misc/myC32.mac +121 -0
  132. data/vendor/repo.or.cz/nasm/misc/nasm.sl +320 -0
  133. data/vendor/repo.or.cz/nasm/misc/nasmstab +296 -0
  134. data/vendor/repo.or.cz/nasm/misc/omfdump.c +517 -0
  135. data/vendor/repo.or.cz/nasm/misc/pmw.bat +9 -0
  136. data/vendor/repo.or.cz/nasm/misc/proc32.ash +441 -0
  137. data/vendor/repo.or.cz/nasm/misc/scitech.mac +1223 -0
  138. data/vendor/repo.or.cz/nasm/misc/xcrcgen.c +80 -0
  139. data/vendor/repo.or.cz/nasm/nasm.spec.in +83 -0
  140. data/vendor/repo.or.cz/nasm/nasm.spec.sed +3 -0
  141. data/vendor/repo.or.cz/nasm/nasm.txt +306 -0
  142. data/vendor/repo.or.cz/nasm/nasmlib/badenum.c +43 -0
  143. data/vendor/repo.or.cz/nasm/nasmlib/bsi.c +77 -0
  144. data/vendor/repo.or.cz/nasm/nasmlib/crc64.c +189 -0
  145. data/vendor/repo.or.cz/nasm/nasmlib/file.c +259 -0
  146. data/vendor/repo.or.cz/nasm/nasmlib/file.h +128 -0
  147. data/vendor/repo.or.cz/nasm/nasmlib/filename.c +69 -0
  148. data/vendor/repo.or.cz/nasm/nasmlib/hashtbl.c +232 -0
  149. data/vendor/repo.or.cz/nasm/nasmlib/ilog2.c +168 -0
  150. data/vendor/repo.or.cz/nasm/nasmlib/malloc.c +108 -0
  151. data/vendor/repo.or.cz/nasm/nasmlib/md5c.c +247 -0
  152. data/vendor/repo.or.cz/nasm/nasmlib/mmap.c +139 -0
  153. data/vendor/repo.or.cz/nasm/nasmlib/path.c +186 -0
  154. data/vendor/repo.or.cz/nasm/nasmlib/perfhash.c +55 -0
  155. data/vendor/repo.or.cz/nasm/nasmlib/perfhash.pl +362 -0
  156. data/vendor/repo.or.cz/nasm/nasmlib/raa.c +173 -0
  157. data/vendor/repo.or.cz/nasm/nasmlib/rbtree.c +119 -0
  158. data/vendor/repo.or.cz/nasm/nasmlib/readnum.c +172 -0
  159. data/vendor/repo.or.cz/nasm/nasmlib/realpath.c +135 -0
  160. data/vendor/repo.or.cz/nasm/nasmlib/saa.c +431 -0
  161. data/vendor/repo.or.cz/nasm/nasmlib/srcfile.c +128 -0
  162. data/vendor/repo.or.cz/nasm/nasmlib/string.c +242 -0
  163. data/vendor/repo.or.cz/nasm/nasmlib/strlist.c +100 -0
  164. data/vendor/repo.or.cz/nasm/nasmlib/ver.c +51 -0
  165. data/vendor/repo.or.cz/nasm/nasmlib/zerobuf.c +42 -0
  166. data/vendor/repo.or.cz/nasm/ndisasm.txt +94 -0
  167. data/vendor/repo.or.cz/nasm/nsis/NASMMultiUser.nsh +478 -0
  168. data/vendor/repo.or.cz/nasm/nsis/getpearch.pl +76 -0
  169. data/vendor/repo.or.cz/nasm/nsis/nasm-un.ico +0 -0
  170. data/vendor/repo.or.cz/nasm/nsis/nasm.ico +0 -0
  171. data/vendor/repo.or.cz/nasm/nsis/nasm.nsi +241 -0
  172. data/vendor/repo.or.cz/nasm/output/codeview.c +814 -0
  173. data/vendor/repo.or.cz/nasm/output/dwarf.h +566 -0
  174. data/vendor/repo.or.cz/nasm/output/elf.h +537 -0
  175. data/vendor/repo.or.cz/nasm/output/legacy.c +112 -0
  176. data/vendor/repo.or.cz/nasm/output/nulldbg.c +93 -0
  177. data/vendor/repo.or.cz/nasm/output/nullout.c +51 -0
  178. data/vendor/repo.or.cz/nasm/output/outaout.c +954 -0
  179. data/vendor/repo.or.cz/nasm/output/outaout.mac +37 -0
  180. data/vendor/repo.or.cz/nasm/output/outas86.c +650 -0
  181. data/vendor/repo.or.cz/nasm/output/outas86.mac +37 -0
  182. data/vendor/repo.or.cz/nasm/output/outbin.c +1713 -0
  183. data/vendor/repo.or.cz/nasm/output/outbin.mac +40 -0
  184. data/vendor/repo.or.cz/nasm/output/outcoff.c +1242 -0
  185. data/vendor/repo.or.cz/nasm/output/outcoff.mac +43 -0
  186. data/vendor/repo.or.cz/nasm/output/outdbg.c +425 -0
  187. data/vendor/repo.or.cz/nasm/output/outelf.c +3370 -0
  188. data/vendor/repo.or.cz/nasm/output/outelf.h +156 -0
  189. data/vendor/repo.or.cz/nasm/output/outelf.mac +41 -0
  190. data/vendor/repo.or.cz/nasm/output/outform.c +120 -0
  191. data/vendor/repo.or.cz/nasm/output/outform.h +379 -0
  192. data/vendor/repo.or.cz/nasm/output/outieee.c +1528 -0
  193. data/vendor/repo.or.cz/nasm/output/outlib.c +58 -0
  194. data/vendor/repo.or.cz/nasm/output/outlib.h +63 -0
  195. data/vendor/repo.or.cz/nasm/output/outmacho.c +2387 -0
  196. data/vendor/repo.or.cz/nasm/output/outmacho.mac +49 -0
  197. data/vendor/repo.or.cz/nasm/output/outobj.c +2725 -0
  198. data/vendor/repo.or.cz/nasm/output/outobj.mac +49 -0
  199. data/vendor/repo.or.cz/nasm/output/outrdf.mac +40 -0
  200. data/vendor/repo.or.cz/nasm/output/outrdf2.c +791 -0
  201. data/vendor/repo.or.cz/nasm/output/outrdf2.mac +43 -0
  202. data/vendor/repo.or.cz/nasm/output/pecoff.h +532 -0
  203. data/vendor/repo.or.cz/nasm/output/stabs.h +144 -0
  204. data/vendor/repo.or.cz/nasm/perllib/crc64.ph +158 -0
  205. data/vendor/repo.or.cz/nasm/perllib/gensv.pl +34 -0
  206. data/vendor/repo.or.cz/nasm/perllib/phash.ph +200 -0
  207. data/vendor/repo.or.cz/nasm/perllib/random_sv_vectors.ph +67 -0
  208. data/vendor/repo.or.cz/nasm/rdoff/README +185 -0
  209. data/vendor/repo.or.cz/nasm/rdoff/collectn.c +44 -0
  210. data/vendor/repo.or.cz/nasm/rdoff/collectn.h +22 -0
  211. data/vendor/repo.or.cz/nasm/rdoff/doc/Makefile +37 -0
  212. data/vendor/repo.or.cz/nasm/rdoff/doc/rdoff.texi +137 -0
  213. data/vendor/repo.or.cz/nasm/rdoff/doc/v1-v2.txt +62 -0
  214. data/vendor/repo.or.cz/nasm/rdoff/hash.c +122 -0
  215. data/vendor/repo.or.cz/nasm/rdoff/hash.h +17 -0
  216. data/vendor/repo.or.cz/nasm/rdoff/ldrdf.1 +41 -0
  217. data/vendor/repo.or.cz/nasm/rdoff/ldrdf.c +1395 -0
  218. data/vendor/repo.or.cz/nasm/rdoff/ldsegs.h +59 -0
  219. data/vendor/repo.or.cz/nasm/rdoff/rdf2bin.1 +65 -0
  220. data/vendor/repo.or.cz/nasm/rdoff/rdf2bin.c +431 -0
  221. data/vendor/repo.or.cz/nasm/rdoff/rdf2com.1 +1 -0
  222. data/vendor/repo.or.cz/nasm/rdoff/rdf2ihx.1 +1 -0
  223. data/vendor/repo.or.cz/nasm/rdoff/rdf2ith.1 +1 -0
  224. data/vendor/repo.or.cz/nasm/rdoff/rdf2srec.1 +1 -0
  225. data/vendor/repo.or.cz/nasm/rdoff/rdfdump.1 +24 -0
  226. data/vendor/repo.or.cz/nasm/rdoff/rdfdump.c +347 -0
  227. data/vendor/repo.or.cz/nasm/rdoff/rdflib.1 +39 -0
  228. data/vendor/repo.or.cz/nasm/rdoff/rdflib.c +434 -0
  229. data/vendor/repo.or.cz/nasm/rdoff/rdfload.c +213 -0
  230. data/vendor/repo.or.cz/nasm/rdoff/rdfload.h +29 -0
  231. data/vendor/repo.or.cz/nasm/rdoff/rdfutils.h +165 -0
  232. data/vendor/repo.or.cz/nasm/rdoff/rdlar.c +492 -0
  233. data/vendor/repo.or.cz/nasm/rdoff/rdlar.h +34 -0
  234. data/vendor/repo.or.cz/nasm/rdoff/rdlib.c +290 -0
  235. data/vendor/repo.or.cz/nasm/rdoff/rdlib.h +62 -0
  236. data/vendor/repo.or.cz/nasm/rdoff/rdoff.c +621 -0
  237. data/vendor/repo.or.cz/nasm/rdoff/rdx.1 +21 -0
  238. data/vendor/repo.or.cz/nasm/rdoff/rdx.c +90 -0
  239. data/vendor/repo.or.cz/nasm/rdoff/segtab.c +172 -0
  240. data/vendor/repo.or.cz/nasm/rdoff/segtab.h +45 -0
  241. data/vendor/repo.or.cz/nasm/rdoff/symtab.c +159 -0
  242. data/vendor/repo.or.cz/nasm/rdoff/symtab.h +55 -0
  243. data/vendor/repo.or.cz/nasm/rdoff/test/Makefile +10 -0
  244. data/vendor/repo.or.cz/nasm/rdoff/test/makelib.sh +14 -0
  245. data/vendor/repo.or.cz/nasm/rdoff/test/rdfseg.asm +20 -0
  246. data/vendor/repo.or.cz/nasm/rdoff/test/rdfseg2.asm +12 -0
  247. data/vendor/repo.or.cz/nasm/rdoff/test/rdftest1.asm +54 -0
  248. data/vendor/repo.or.cz/nasm/rdoff/test/rdftest2.asm +33 -0
  249. data/vendor/repo.or.cz/nasm/rdoff/test/rdtlib.asm +48 -0
  250. data/vendor/repo.or.cz/nasm/rdoff/test/rdtmain.asm +47 -0
  251. data/vendor/repo.or.cz/nasm/rdoff/test/testlib.asm +18 -0
  252. data/vendor/repo.or.cz/nasm/stdlib/snprintf.c +29 -0
  253. data/vendor/repo.or.cz/nasm/stdlib/strlcpy.c +51 -0
  254. data/vendor/repo.or.cz/nasm/stdlib/strnlen.c +46 -0
  255. data/vendor/repo.or.cz/nasm/stdlib/vsnprintf.c +51 -0
  256. data/vendor/repo.or.cz/nasm/test/Makefile +106 -0
  257. data/vendor/repo.or.cz/nasm/test/_file_.asm +5 -0
  258. data/vendor/repo.or.cz/nasm/test/_version.asm +2 -0
  259. data/vendor/repo.or.cz/nasm/test/a32offs.asm +9 -0
  260. data/vendor/repo.or.cz/nasm/test/absolute.asm +40 -0
  261. data/vendor/repo.or.cz/nasm/test/addr64x.asm +18 -0
  262. data/vendor/repo.or.cz/nasm/test/align13.asm +19 -0
  263. data/vendor/repo.or.cz/nasm/test/align13s.asm +20 -0
  264. data/vendor/repo.or.cz/nasm/test/alonesym-obj.asm +166 -0
  265. data/vendor/repo.or.cz/nasm/test/andbyte.asm +15 -0
  266. data/vendor/repo.or.cz/nasm/test/aoutso.asm +99 -0
  267. data/vendor/repo.or.cz/nasm/test/aouttest.asm +86 -0
  268. data/vendor/repo.or.cz/nasm/test/aouttest.c +36 -0
  269. data/vendor/repo.or.cz/nasm/test/avx.asm +46 -0
  270. data/vendor/repo.or.cz/nasm/test/avx005.asm +529 -0
  271. data/vendor/repo.or.cz/nasm/test/avx2.asm +1608 -0
  272. data/vendor/repo.or.cz/nasm/test/avx512cd.asm +106 -0
  273. data/vendor/repo.or.cz/nasm/test/avx512er.asm +144 -0
  274. data/vendor/repo.or.cz/nasm/test/avx512f.asm +7000 -0
  275. data/vendor/repo.or.cz/nasm/test/avx512pf.asm +88 -0
  276. data/vendor/repo.or.cz/nasm/test/bcd.asm +23 -0
  277. data/vendor/repo.or.cz/nasm/test/binexe.asm +35 -0
  278. data/vendor/repo.or.cz/nasm/test/bintest.asm +59 -0
  279. data/vendor/repo.or.cz/nasm/test/bisect.sh +22 -0
  280. data/vendor/repo.or.cz/nasm/test/br1879590.asm +25 -0
  281. data/vendor/repo.or.cz/nasm/test/br2003451.asm +17 -0
  282. data/vendor/repo.or.cz/nasm/test/br2030823.asm +7 -0
  283. data/vendor/repo.or.cz/nasm/test/br2148476.asm +221 -0
  284. data/vendor/repo.or.cz/nasm/test/br2222615.asm +19 -0
  285. data/vendor/repo.or.cz/nasm/test/br2496848.asm +42 -0
  286. data/vendor/repo.or.cz/nasm/test/br3005117.asm +26 -0
  287. data/vendor/repo.or.cz/nasm/test/br3026808.asm +20 -0
  288. data/vendor/repo.or.cz/nasm/test/br3028880.asm +8 -0
  289. data/vendor/repo.or.cz/nasm/test/br3041451.asm +59 -0
  290. data/vendor/repo.or.cz/nasm/test/br3058845.asm +14 -0
  291. data/vendor/repo.or.cz/nasm/test/br3066383.asm +70 -0
  292. data/vendor/repo.or.cz/nasm/test/br3074517.asm +12 -0
  293. data/vendor/repo.or.cz/nasm/test/br3092924.asm +25 -0
  294. data/vendor/repo.or.cz/nasm/test/br3104312.asm +11 -0
  295. data/vendor/repo.or.cz/nasm/test/br3109604.asm +9 -0
  296. data/vendor/repo.or.cz/nasm/test/br3174983.asm +9 -0
  297. data/vendor/repo.or.cz/nasm/test/br3187743.asm +7 -0
  298. data/vendor/repo.or.cz/nasm/test/br3189064.asm +7 -0
  299. data/vendor/repo.or.cz/nasm/test/br3200749.asm +9 -0
  300. data/vendor/repo.or.cz/nasm/test/br3385573.asm +11 -0
  301. data/vendor/repo.or.cz/nasm/test/br3392252.asm +43 -0
  302. data/vendor/repo.or.cz/nasm/test/br3392259.asm +8 -0
  303. data/vendor/repo.or.cz/nasm/test/br3392363.asm +4 -0
  304. data/vendor/repo.or.cz/nasm/test/br3392392.asm +16 -0
  305. data/vendor/repo.or.cz/nasm/test/br3392396.asm +5 -0
  306. data/vendor/repo.or.cz/nasm/test/br3392411.asm +22 -0
  307. data/vendor/repo.or.cz/nasm/test/br3392418.asm +3 -0
  308. data/vendor/repo.or.cz/nasm/test/br3392439.asm +25 -0
  309. data/vendor/repo.or.cz/nasm/test/br3392442.asm +6 -0
  310. data/vendor/repo.or.cz/nasm/test/br560575.asm +17 -0
  311. data/vendor/repo.or.cz/nasm/test/br560873.asm +27 -0
  312. data/vendor/repo.or.cz/nasm/test/br890790.asm +7 -0
  313. data/vendor/repo.or.cz/nasm/test/br890790_i.asm +1 -0
  314. data/vendor/repo.or.cz/nasm/test/br978756.asm +7 -0
  315. data/vendor/repo.or.cz/nasm/test/changed.asm +383 -0
  316. data/vendor/repo.or.cz/nasm/test/cofftest.asm +85 -0
  317. data/vendor/repo.or.cz/nasm/test/cofftest.c +35 -0
  318. data/vendor/repo.or.cz/nasm/test/crc32.asm +37 -0
  319. data/vendor/repo.or.cz/nasm/test/cv8struc.asm +14 -0
  320. data/vendor/repo.or.cz/nasm/test/dtbcd.asm +72 -0
  321. data/vendor/repo.or.cz/nasm/test/elf64so.asm +118 -0
  322. data/vendor/repo.or.cz/nasm/test/elfso.asm +100 -0
  323. data/vendor/repo.or.cz/nasm/test/elftest.asm +87 -0
  324. data/vendor/repo.or.cz/nasm/test/elftest.c +38 -0
  325. data/vendor/repo.or.cz/nasm/test/elftest64.c +43 -0
  326. data/vendor/repo.or.cz/nasm/test/elif.asm +39 -0
  327. data/vendor/repo.or.cz/nasm/test/expimp.asm +90 -0
  328. data/vendor/repo.or.cz/nasm/test/far64.asm +10 -0
  329. data/vendor/repo.or.cz/nasm/test/float.asm +186 -0
  330. data/vendor/repo.or.cz/nasm/test/float8.asm +135 -0
  331. data/vendor/repo.or.cz/nasm/test/floatb.asm +35 -0
  332. data/vendor/repo.or.cz/nasm/test/floatexp.asm +382 -0
  333. data/vendor/repo.or.cz/nasm/test/floatize.asm +19 -0
  334. data/vendor/repo.or.cz/nasm/test/floattest.asm +28 -0
  335. data/vendor/repo.or.cz/nasm/test/floatx.asm +525 -0
  336. data/vendor/repo.or.cz/nasm/test/fpu.asm +127 -0
  337. data/vendor/repo.or.cz/nasm/test/fwdopt.asm +133 -0
  338. data/vendor/repo.or.cz/nasm/test/fwdoptpp.asm +150 -0
  339. data/vendor/repo.or.cz/nasm/test/gas2nasm.py +104 -0
  340. data/vendor/repo.or.cz/nasm/test/gather.asm +11 -0
  341. data/vendor/repo.or.cz/nasm/test/gotoff64.asm +25 -0
  342. data/vendor/repo.or.cz/nasm/test/hexfp.asm +25 -0
  343. data/vendor/repo.or.cz/nasm/test/hle.asm +19 -0
  344. data/vendor/repo.or.cz/nasm/test/ifelse.asm +46 -0
  345. data/vendor/repo.or.cz/nasm/test/ifenv.asm +31 -0
  346. data/vendor/repo.or.cz/nasm/test/ifmacro.asm +413 -0
  347. data/vendor/repo.or.cz/nasm/test/iftoken.asm +317 -0
  348. data/vendor/repo.or.cz/nasm/test/iftoken.pl +32 -0
  349. data/vendor/repo.or.cz/nasm/test/ilog2.asm +271 -0
  350. data/vendor/repo.or.cz/nasm/test/imacro.asm +8 -0
  351. data/vendor/repo.or.cz/nasm/test/imm.asm +23 -0
  352. data/vendor/repo.or.cz/nasm/test/imm64.asm +61 -0
  353. data/vendor/repo.or.cz/nasm/test/immwarn.asm +91 -0
  354. data/vendor/repo.or.cz/nasm/test/imul.asm +117 -0
  355. data/vendor/repo.or.cz/nasm/test/inc1.asm +6 -0
  356. data/vendor/repo.or.cz/nasm/test/inc2.asm +8 -0
  357. data/vendor/repo.or.cz/nasm/test/incbin.asm +7 -0
  358. data/vendor/repo.or.cz/nasm/test/incbin.data +2 -0
  359. data/vendor/repo.or.cz/nasm/test/inctest.asm +15 -0
  360. data/vendor/repo.or.cz/nasm/test/insnlbl.asm +12 -0
  361. data/vendor/repo.or.cz/nasm/test/invlpga.asm +11 -0
  362. data/vendor/repo.or.cz/nasm/test/jmp64.asm +19 -0
  363. data/vendor/repo.or.cz/nasm/test/lar_lsl.asm +124 -0
  364. data/vendor/repo.or.cz/nasm/test/larlsl.asm +23 -0
  365. data/vendor/repo.or.cz/nasm/test/lnxhello.asm +54 -0
  366. data/vendor/repo.or.cz/nasm/test/local.asm +19 -0
  367. data/vendor/repo.or.cz/nasm/test/loopoffs.asm +12 -0
  368. data/vendor/repo.or.cz/nasm/test/lwp.asm +213 -0
  369. data/vendor/repo.or.cz/nasm/test/macro-defaults.asm +64 -0
  370. data/vendor/repo.or.cz/nasm/test/macroerr.asm +12 -0
  371. data/vendor/repo.or.cz/nasm/test/macroerr.inc +3 -0
  372. data/vendor/repo.or.cz/nasm/test/mmxsize.asm +38 -0
  373. data/vendor/repo.or.cz/nasm/test/movd.asm +12 -0
  374. data/vendor/repo.or.cz/nasm/test/movd64.asm +15 -0
  375. data/vendor/repo.or.cz/nasm/test/movimm.asm +28 -0
  376. data/vendor/repo.or.cz/nasm/test/movnti.asm +10 -0
  377. data/vendor/repo.or.cz/nasm/test/mpx-64.asm +120 -0
  378. data/vendor/repo.or.cz/nasm/test/mpx.asm +89 -0
  379. data/vendor/repo.or.cz/nasm/test/multisection.asm +96 -0
  380. data/vendor/repo.or.cz/nasm/test/nasmformat.asm +17 -0
  381. data/vendor/repo.or.cz/nasm/test/new +9 -0
  382. data/vendor/repo.or.cz/nasm/test/newrdwr.asm +24 -0
  383. data/vendor/repo.or.cz/nasm/test/nop.asm +17 -0
  384. data/vendor/repo.or.cz/nasm/test/nullfile.asm +4 -0
  385. data/vendor/repo.or.cz/nasm/test/objexe.asm +30 -0
  386. data/vendor/repo.or.cz/nasm/test/objlink.c +33 -0
  387. data/vendor/repo.or.cz/nasm/test/objtest.asm +85 -0
  388. data/vendor/repo.or.cz/nasm/test/optimization.asm +104 -0
  389. data/vendor/repo.or.cz/nasm/test/org.asm +18 -0
  390. data/vendor/repo.or.cz/nasm/test/paste.asm +12 -0
  391. data/vendor/repo.or.cz/nasm/test/pcrel.asm +52 -0
  392. data/vendor/repo.or.cz/nasm/test/perf/label.pl +18 -0
  393. data/vendor/repo.or.cz/nasm/test/perf/macro.pl +18 -0
  394. data/vendor/repo.or.cz/nasm/test/perf/token.pl +23 -0
  395. data/vendor/repo.or.cz/nasm/test/performtest.pl +192 -0
  396. data/vendor/repo.or.cz/nasm/test/pextrw.asm +3 -0
  397. data/vendor/repo.or.cz/nasm/test/pinsr16.asm +53 -0
  398. data/vendor/repo.or.cz/nasm/test/pinsr32.asm +53 -0
  399. data/vendor/repo.or.cz/nasm/test/pinsr64.asm +68 -0
  400. data/vendor/repo.or.cz/nasm/test/popcnt.asm +32 -0
  401. data/vendor/repo.or.cz/nasm/test/ppindirect.asm +42 -0
  402. data/vendor/repo.or.cz/nasm/test/pragma.asm +12 -0
  403. data/vendor/repo.or.cz/nasm/test/prefix66.asm +28 -0
  404. data/vendor/repo.or.cz/nasm/test/ptr.asm +4 -0
  405. data/vendor/repo.or.cz/nasm/test/pushseg.asm +17 -0
  406. data/vendor/repo.or.cz/nasm/test/r13.asm +15 -0
  407. data/vendor/repo.or.cz/nasm/test/radix.asm +54 -0
  408. data/vendor/repo.or.cz/nasm/test/rdpid.asm +21 -0
  409. data/vendor/repo.or.cz/nasm/test/reldef.asm +57 -0
  410. data/vendor/repo.or.cz/nasm/test/relocs.asm +20 -0
  411. data/vendor/repo.or.cz/nasm/test/riprel.asm +5357 -0
  412. data/vendor/repo.or.cz/nasm/test/riprel.pl +29 -0
  413. data/vendor/repo.or.cz/nasm/test/riprel2.asm +11 -0
  414. data/vendor/repo.or.cz/nasm/test/sha-64.asm +30 -0
  415. data/vendor/repo.or.cz/nasm/test/sha.asm +31 -0
  416. data/vendor/repo.or.cz/nasm/test/smartalign16.asm +36 -0
  417. data/vendor/repo.or.cz/nasm/test/smartalign32.asm +36 -0
  418. data/vendor/repo.or.cz/nasm/test/smartalign64.asm +36 -0
  419. data/vendor/repo.or.cz/nasm/test/splitea.asm +11 -0
  420. data/vendor/repo.or.cz/nasm/test/sreg.asm +65 -0
  421. data/vendor/repo.or.cz/nasm/test/strlen.asm +5 -0
  422. data/vendor/repo.or.cz/nasm/test/struc.asm +33 -0
  423. data/vendor/repo.or.cz/nasm/test/test67.asm +38 -0
  424. data/vendor/repo.or.cz/nasm/test/testdos.asm +13 -0
  425. data/vendor/repo.or.cz/nasm/test/testnos3.asm +973 -0
  426. data/vendor/repo.or.cz/nasm/test/time.asm +11 -0
  427. data/vendor/repo.or.cz/nasm/test/times.asm +21 -0
  428. data/vendor/repo.or.cz/nasm/test/timesneg.asm +3 -0
  429. data/vendor/repo.or.cz/nasm/test/tmap.nas +1447 -0
  430. data/vendor/repo.or.cz/nasm/test/uscore.asm +15 -0
  431. data/vendor/repo.or.cz/nasm/test/utf.asm +82 -0
  432. data/vendor/repo.or.cz/nasm/test/vaesenc.asm +22 -0
  433. data/vendor/repo.or.cz/nasm/test/vex.asm +9 -0
  434. data/vendor/repo.or.cz/nasm/test/vgather.asm +76 -0
  435. data/vendor/repo.or.cz/nasm/test/vmread.asm +26 -0
  436. data/vendor/repo.or.cz/nasm/test/weirdpaste.asm +29 -0
  437. data/vendor/repo.or.cz/nasm/test/xchg.asm +96 -0
  438. data/vendor/repo.or.cz/nasm/test/xcrypt.asm +24 -0
  439. data/vendor/repo.or.cz/nasm/test/xmm0.asm +12 -0
  440. data/vendor/repo.or.cz/nasm/test/zerobyte.asm +22 -0
  441. data/vendor/repo.or.cz/nasm/tools/cleanfile +176 -0
  442. data/vendor/repo.or.cz/nasm/tools/cleanpatch +258 -0
  443. data/vendor/repo.or.cz/nasm/tools/mkdep.pl +261 -0
  444. data/vendor/repo.or.cz/nasm/tools/release +105 -0
  445. data/vendor/repo.or.cz/nasm/tools/syncfiles.pl +137 -0
  446. data/vendor/repo.or.cz/nasm/tools/tag-release +58 -0
  447. data/vendor/repo.or.cz/nasm/version +1 -0
  448. data/vendor/repo.or.cz/nasm/version.pl +189 -0
  449. data/vendor/repo.or.cz/nasm/x86/disp8.c +131 -0
  450. data/vendor/repo.or.cz/nasm/x86/insns-iflags.ph +280 -0
  451. data/vendor/repo.or.cz/nasm/x86/insns.dat +5371 -0
  452. data/vendor/repo.or.cz/nasm/x86/insns.pl +1043 -0
  453. data/vendor/repo.or.cz/nasm/x86/regs.dat +138 -0
  454. data/vendor/repo.or.cz/nasm/x86/regs.pl +204 -0
  455. metadata +520 -0
@@ -0,0 +1,212 @@
1
+ %!PS-Adobe-3.0 EPSF-3.0
2
+ %%Creator: cairo 1.10.2 (http://cairographics.org)
3
+ %%CreationDate: Sun Feb 26 02:08:42 2012
4
+ %%Pages: 1
5
+ %%BoundingBox: 44 42 306 306
6
+ %%DocumentData: Clean7Bit
7
+ %%LanguageLevel: 2
8
+ %%EndComments
9
+ %%BeginProlog
10
+ /cairo_eps_state save def
11
+ /dict_count countdictstack def
12
+ /op_count count 1 sub def
13
+ userdict begin
14
+ /q { gsave } bind def
15
+ /Q { grestore } bind def
16
+ /cm { 6 array astore concat } bind def
17
+ /w { setlinewidth } bind def
18
+ /J { setlinecap } bind def
19
+ /j { setlinejoin } bind def
20
+ /M { setmiterlimit } bind def
21
+ /d { setdash } bind def
22
+ /m { moveto } bind def
23
+ /l { lineto } bind def
24
+ /c { curveto } bind def
25
+ /h { closepath } bind def
26
+ /re { exch dup neg 3 1 roll 5 3 roll moveto 0 rlineto
27
+ 0 exch rlineto 0 rlineto closepath } bind def
28
+ /S { stroke } bind def
29
+ /f { fill } bind def
30
+ /f* { eofill } bind def
31
+ /n { newpath } bind def
32
+ /W { clip } bind def
33
+ /W* { eoclip } bind def
34
+ /BT { } bind def
35
+ /ET { } bind def
36
+ /pdfmark where { pop globaldict /?pdfmark /exec load put }
37
+ { globaldict begin /?pdfmark /pop load def /pdfmark
38
+ /cleartomark load def end } ifelse
39
+ /BDC { mark 3 1 roll /BDC pdfmark } bind def
40
+ /EMC { mark /EMC pdfmark } bind def
41
+ /cairo_store_point { /cairo_point_y exch def /cairo_point_x exch def } def
42
+ /Tj { show currentpoint cairo_store_point } bind def
43
+ /TJ {
44
+ {
45
+ dup
46
+ type /stringtype eq
47
+ { show } { -0.001 mul 0 cairo_font_matrix dtransform rmoveto } ifelse
48
+ } forall
49
+ currentpoint cairo_store_point
50
+ } bind def
51
+ /cairo_selectfont { cairo_font_matrix aload pop pop pop 0 0 6 array astore
52
+ cairo_font exch selectfont cairo_point_x cairo_point_y moveto } bind def
53
+ /Tf { pop /cairo_font exch def /cairo_font_matrix where
54
+ { pop cairo_selectfont } if } bind def
55
+ /Td { matrix translate cairo_font_matrix matrix concatmatrix dup
56
+ /cairo_font_matrix exch def dup 4 get exch 5 get cairo_store_point
57
+ /cairo_font where { pop cairo_selectfont } if } bind def
58
+ /Tm { 2 copy 8 2 roll 6 array astore /cairo_font_matrix exch def
59
+ cairo_store_point /cairo_font where { pop cairo_selectfont } if } bind def
60
+ /g { setgray } bind def
61
+ /rg { setrgbcolor } bind def
62
+ /d1 { setcachedevice } bind def
63
+ %%EndProlog
64
+ %%Page: 1 1
65
+ %%BeginPageSetup
66
+ %%PageBoundingBox: 44 42 306 306
67
+ %%EndPageSetup
68
+ q 44 42 262 264 rectclip q
69
+ 0.501961 g
70
+ 279.656 304.422 m 265.238 304.422 253.559 292.734 253.559 278.32 c
71
+ 253.559 273.254 255.023 268.539 257.523 264.535 c 240.906 247.918 l
72
+ 220.031 266.812 192.352 278.32 161.977 278.32 c 96.988 278.32 44.297
73
+ 225.633 44.297 160.64 c 44.297 95.648 96.988 42.965 161.977 42.965 c
74
+ 226.969 42.965 279.656 95.648 279.656 160.64 c 279.656 191.012 268.145
75
+ 218.695 249.254 239.574 c 265.871 256.191 l 269.875 253.691 274.59
76
+ 252.223 279.66 252.223 c 294.07 252.223 305.754 263.906 305.754 278.32
77
+ c 305.754 292.73 294.07 304.422 279.656 304.422 c h
78
+ 279.656 304.422 m f
79
+ 1 g
80
+ 107.184 140.832 m 107 140.492 106.547 140.324 105.816 140.324 c 97.219
81
+ 140.324 l 96.07 140.324 95.5 140.871 95.5 141.965 c 95.5 145.406 95.508
82
+ 148.82 95.535 152.207 c 95.562 155.594 95.574 159.008 95.574 162.445 c
83
+ 95.574 164.637 95.195 166.187 94.441 167.098 c 93.684 168.008 92.469
84
+ 168.465 90.805 168.465 c 89.555 168.465 88.199 168.164 86.742 167.566 c
85
+ 85.281 166.965 84.086 166.508 83.145 166.195 c 83.145 141.965 l 83.145
86
+ 141.547 83.051 141.172 82.871 140.828 c 82.688 140.492 82.234 140.324
87
+ 81.504 140.324 c 72.984 140.324 l 72.309 140.324 71.852 140.465 71.617
88
+ 140.754 c 71.379 141.039 71.266 141.445 71.266 141.965 c 71.266 177.14
89
+ l 71.266 177.664 71.379 178.078 71.617 178.39 c 71.852 178.703 72.309
90
+ 178.863 72.984 178.863 c 81.504 178.863 l 82.23 178.863 82.688 178.676
91
+ 82.871 178.312 c 83.055 177.949 83.145 177.558 83.145 177.14 c 83.145
92
+ 175.265 l 83.195 175.265 83.238 175.25 83.262 175.226 c 83.289 175.199
93
+ 83.324 175.187 83.379 175.187 c 85.098 176.492 87.105 177.547 89.398
94
+ 178.351 c 91.688 179.16 93.773 179.566 95.648 179.566 c 98.414 179.566
95
+ 100.59 179.109 102.176 178.199 c 103.77 177.285 104.953 176.086 105.734
96
+ 174.601 c 106.52 173.117 106.996 171.461 107.18 169.637 c 107.363
97
+ 167.812 107.453 165.988 107.453 164.168 c 107.453 141.965 l 107.461
98
+ 141.547 107.367 141.172 107.184 140.832 c h
99
+ 107.184 140.832 m f
100
+ 137.324 145.015 m 136.281 144.078 135.16 143.269 133.965 142.594 c
101
+ 132.766 141.914 131.543 141.355 130.289 140.914 c 129.039 140.469
102
+ 127.812 140.16 126.613 139.976 c 125.414 139.793 124.32 139.703 123.332
103
+ 139.703 c 121.039 139.703 119.176 140.027 117.742 140.68 c 116.309
104
+ 141.328 115.199 142.18 114.422 143.223 c 113.637 144.262 113.102
105
+ 145.473 112.82 146.855 c 112.531 148.234 112.391 149.68 112.391 151.195
106
+ c 112.336 153.594 112.66 155.621 113.367 157.293 c 114.07 158.961
107
+ 115.074 160.301 116.375 161.316 c 117.68 162.332 119.27 163.066 121.145
108
+ 163.508 c 123.02 163.949 125.105 164.172 127.398 164.172 c 136.391
109
+ 164.172 l 136.391 165.422 l 136.391 166.254 136.293 166.961 136.117
110
+ 167.531 c 135.93 168.105 135.594 168.574 135.102 168.937 c 134.605
111
+ 169.305 133.914 169.578 133.027 169.762 c 132.141 169.941 130.969
112
+ 170.035 129.512 170.035 c 128.938 170.035 128.219 170.008 127.359
113
+ 169.957 c 126.5 169.902 125.605 169.851 124.664 169.797 c 123.727
114
+ 169.746 122.785 169.668 121.848 169.562 c 120.91 169.461 120.051
115
+ 169.379 119.27 169.328 c 118.176 169.226 117.457 169.226 117.121
116
+ 169.328 c 116.781 169.433 116.508 169.879 116.301 170.66 c 115.441
117
+ 174.723 l 115.336 175.398 115.43 175.957 115.715 176.402 c 116 176.844
118
+ 116.742 177.301 117.941 177.769 c 118.828 178.086 119.855 178.355
119
+ 121.031 178.594 c 122.203 178.828 123.402 179.023 124.625 179.18 c
120
+ 125.852 179.336 127.062 179.453 128.262 179.531 c 129.461 179.609
121
+ 130.504 179.644 131.391 179.644 c 135.035 179.644 137.969 179.308
122
+ 140.184 178.629 c 142.398 177.953 144.09 176.988 145.266 175.738 c
123
+ 146.438 174.488 147.203 172.949 147.57 171.125 c 147.934 169.301
124
+ 148.117 167.219 148.117 164.871 c 148.117 152.523 l 148.117 151.687
125
+ 148.156 151.035 148.238 150.566 c 148.312 150.098 148.457 149.746
126
+ 148.664 149.512 c 148.871 149.277 149.16 149.105 149.523 149.004 c
127
+ 149.887 148.898 150.383 148.82 151.008 148.769 c 151.688 148.715
128
+ 152.129 148.598 152.336 148.418 c 152.547 148.234 152.652 147.91
129
+ 152.652 147.441 c 152.652 142.433 l 152.652 141.394 151.895 140.715
130
+ 150.383 140.402 c 148.926 140.039 147.309 139.855 145.535 139.855 c
131
+ 143.609 139.855 141.914 140.183 140.453 140.832 c 138.996 141.484
132
+ 138.004 142.851 137.484 144.937 c h
133
+ 136.152 156.586 m 129.121 156.586 l 127.66 156.586 126.512 156.246
134
+ 125.68 155.57 c 124.844 154.89 124.426 153.637 124.426 151.816 c
135
+ 124.426 150.617 124.676 149.781 125.172 149.316 c 125.664 148.848
136
+ 126.59 148.609 127.945 148.609 c 129.145 148.609 130.539 148.894
137
+ 132.129 149.469 c 133.719 150.039 135.062 150.668 136.156 151.344 c
138
+ 136.156 156.586 l h
139
+ 136.152 156.586 m f
140
+ 187.52 152.488 m 187.52 150.043 187.035 148 186.074 146.367 c 185.105
141
+ 144.726 183.82 143.414 182.203 142.426 c 180.586 141.437 178.746
142
+ 140.726 176.691 140.281 c 174.633 139.844 172.484 139.621 170.242
143
+ 139.621 c 169.305 139.621 168.289 139.66 167.195 139.734 c 166.102
144
+ 139.812 164.992 139.93 163.875 140.082 c 162.754 140.238 161.684
145
+ 140.418 160.668 140.629 c 159.652 140.832 158.754 141.066 157.969
146
+ 141.328 c 156.668 141.793 155.832 142.269 155.469 142.762 c 155.105
147
+ 143.25 155.051 144.015 155.312 145.047 c 156.172 148.769 l 156.328
148
+ 149.496 156.562 149.941 156.879 150.094 c 157.191 150.254 157.789
149
+ 150.254 158.676 150.094 c 160.5 149.781 162.477 149.535 164.613 149.351
150
+ c 166.754 149.168 168.5 149.078 169.855 149.078 c 171.832 149.078
151
+ 173.238 149.301 174.074 149.746 c 174.91 150.191 175.324 150.933
152
+ 175.324 151.98 c 175.324 153.129 175.012 153.898 174.391 154.293 c
153
+ 173.762 154.683 172.617 154.984 170.949 155.191 c 168.812 155.508
154
+ 166.816 155.875 164.965 156.289 c 163.117 156.707 161.488 157.336
155
+ 160.082 158.172 c 158.676 159.008 157.57 160.133 156.758 161.543 c
156
+ 155.949 162.953 155.551 164.808 155.551 167.105 c 155.551 169.195
157
+ 155.949 171.023 156.754 172.59 c 157.551 174.156 158.652 175.465
158
+ 160.051 176.508 c 161.449 177.555 163.121 178.336 165.066 178.859 c
159
+ 167.004 179.383 169.125 179.64 171.418 179.64 c 172.305 179.64 173.281
160
+ 179.601 174.352 179.523 c 175.418 179.445 176.5 179.34 177.594 179.211
161
+ c 178.688 179.078 179.746 178.906 180.762 178.699 c 181.777 178.484
162
+ 182.703 178.226 183.535 177.91 c 184.578 177.543 185.348 177.16 185.84
163
+ 176.765 c 186.336 176.371 186.453 175.676 186.191 174.676 c 185.332
164
+ 170.656 l 185.125 169.926 184.906 169.48 184.668 169.324 c 184.434
165
+ 169.168 183.875 169.14 182.988 169.246 c 182.102 169.351 181.141
166
+ 169.465 180.098 169.598 c 179.055 169.726 178.027 169.832 177.012
167
+ 169.91 c 175.996 169.988 175.039 170.055 174.156 170.105 c 173.27
168
+ 170.156 172.516 170.183 171.891 170.183 c 169.91 170.234 168.668
169
+ 170.012 168.176 169.519 c 167.68 169.027 167.434 168.363 167.434
170
+ 167.531 c 167.434 166.543 167.891 165.91 168.809 165.625 c 169.723
171
+ 165.336 170.887 165.066 172.301 164.805 c 174.34 164.547 176.273
172
+ 164.219 178.105 163.832 c 179.938 163.441 181.547 162.805 182.934
173
+ 161.922 c 184.316 161.035 185.43 159.855 186.266 158.371 c 187.102
174
+ 156.89 187.52 154.93 187.52 152.488 c h
175
+ 187.52 152.488 m f
176
+ 250.336 140.832 m 250.152 140.492 249.723 140.324 249.047 140.324 c
177
+ 240.449 140.324 l 239.77 140.324 239.312 140.469 239.078 140.754 c
178
+ 238.844 141.039 238.727 141.445 238.727 141.965 c 238.727 162.527 l
179
+ 238.727 164.922 238.363 166.512 237.633 167.293 c 236.902 168.078
180
+ 235.809 168.465 234.352 168.465 c 233.414 168.465 232.266 168.219
181
+ 230.91 167.723 c 229.555 167.23 228.383 166.719 227.391 166.199 c
182
+ 227.391 141.965 l 227.391 141.551 227.301 141.172 227.117 140.832 c
183
+ 226.938 140.492 226.48 140.324 225.75 140.324 c 217.152 140.324 l
184
+ 216.523 140.324 216.098 140.469 215.863 140.754 c 215.629 141.039
185
+ 215.512 141.445 215.512 141.965 c 215.512 162.762 l 215.512 164.949
186
+ 215.16 166.445 214.449 167.254 c 213.738 168.062 212.676 168.469
187
+ 211.262 168.469 c 210.312 168.469 209.172 168.234 207.836 167.765 c
188
+ 206.496 167.293 205.277 166.773 204.176 166.199 c 204.176 141.969 l
189
+ 204.176 141.551 204.07 141.176 203.863 140.832 c 203.656 140.496
190
+ 203.191 140.328 202.465 140.328 c 193.926 140.328 l 193.301 140.328
191
+ 192.875 140.469 192.641 140.758 c 192.406 141.039 192.297 141.449
192
+ 192.297 141.969 c 192.297 177.144 l 192.297 177.664 192.406 178.082
193
+ 192.641 178.394 c 192.875 178.707 193.301 178.867 193.926 178.867 c
194
+ 202.465 178.867 l 203.191 178.867 203.656 178.68 203.863 178.316 c
195
+ 204.07 177.953 204.176 177.562 204.176 177.144 c 204.176 175.348 l
196
+ 204.332 175.269 l 206 176.621 207.824 177.68 209.801 178.433 c 211.781
197
+ 179.187 213.789 179.566 215.824 179.566 c 218.168 179.566 220.223
198
+ 179.14 221.996 178.277 c 223.766 177.418 225.074 176.074 225.906 174.25
199
+ c 227.73 175.762 229.801 177.027 232.117 178.043 c 234.438 179.058
200
+ 236.77 179.566 239.113 179.566 c 241.879 179.566 244.027 179.109
201
+ 245.562 178.199 c 247.102 177.285 248.25 176.101 249.004 174.644 c
202
+ 249.758 173.183 250.215 171.543 250.371 169.719 c 250.527 167.894
203
+ 250.605 166.07 250.605 164.246 c 250.605 141.965 l 250.609 141.547
204
+ 250.52 141.172 250.336 140.832 c h
205
+ 250.336 140.832 m f
206
+ Q Q
207
+ showpage
208
+ %%Trailer
209
+ count op_count sub {pop} repeat
210
+ countdictstack dict_count sub {end} repeat
211
+ cairo_eps_state restore
212
+ %%EOF
@@ -0,0 +1,53 @@
1
+ #!/usr/bin/perl
2
+ #
3
+ # Font metrics for the PS code generator
4
+ #
5
+
6
+ # Font substitution lists, in order of preference
7
+ my @TText = ('SourceSansPro-Bold', 'ClearSans-Bold', 'LiberationSans-Bold',
8
+ 'Arial-Bold', 'Helvetica-Bold');
9
+ my @TItal = ('SourceSansPro-BoldIt', 'ClearSans-BoldItalic', 'LiberationSans-BoldItalic',
10
+ 'Arial-BoldItalic', 'Helvetica-BoldItalic');
11
+ my @TCode = ('SourceCodePro-Bold', 'LiberationMono-Bold', 'Courier-Bold');
12
+ my @HText = ('SourceSansPro-Semibold', 'ClearSans-Bold', 'Arial-Bold', 'Helvetica-Bold');
13
+ my @HItal = ('SourceSansPro-SemiboldIt', 'ClearSans-BoldItalic',
14
+ 'Arial-BoldItalic', 'Helvetica-BoldItalic');
15
+ my @HCode = ('SourceCodePro-Semibold', 'LiberationMono-Bold', 'Courier-Bold');
16
+ my @BText = ('SourceSansPro-Regular', 'ClearSans', 'LiberationSans', 'Arial', 'Helvetica');
17
+ my @BItal = ('SourceSansPro-It', 'ClearSans-Italic', 'LiberationSans-Italic',
18
+ 'Arial-Italic', 'Helvetica-Italic');
19
+ my @BCode = ('SourceCodePro-Regular', 'LiberationMono', 'Courier');
20
+ my @QText = ('SourceSansPro-It', 'ClearSans-Italic', 'LiberationSans-Italic',
21
+ 'Arial-Italic', 'Helvetica-Italic');
22
+ my @QBold = ('SourceSansPro-BoldIt', 'ClearSans-BoldItalic', 'LiberationSans-BoldItalic', 'Arial-Bold', 'Helvetica-BoldItalic');
23
+ my @QCode = ('SourceCodePro-Regular', 'LiberationMono', 'Courier');
24
+
25
+ # The fonts we want to use for various things
26
+ # The order is: <normal> <emphatic> <code>
27
+
28
+ %TitlFont = (name => 'tfont',
29
+ leading => 24,
30
+ fonts => [[20, \@TText], [20, \@TItal], [20, \@TCode]]);
31
+ %ChapFont = (name => 'cfont',
32
+ leading => 21.6,
33
+ fonts => [[18, \@HText], [18, \@HItal], [18, \@HCode]]);
34
+ %HeadFont = (name => 'hfont',
35
+ leading => 16.8,
36
+ fonts => [[14, \@HText], [14, \@HItal], [14, \@HCode]]);
37
+ %SubhFont = (name => 'sfont',
38
+ leading => 14.4,
39
+ fonts => [[12, \@HText], [12, \@HItal], [12, \@HCode]]);
40
+ %BodyFont = (name => 'bfont',
41
+ leading => 12,
42
+ fonts => [[10, \@BText], [10, \@BItal], [10, \@BCode]]);
43
+ %BquoFont = (name => 'qfont',
44
+ leading => 10.8,
45
+ fonts => [[9, \@QText], [9, \@QBold], [9, \@QCode]]);
46
+ #
47
+ # List of all fontsets; used to compute the list of fonts needed
48
+ #
49
+ @AllFonts = ( \%TitlFont, \%ChapFont, \%HeadFont, \%SubhFont, \%BodyFont,
50
+ \%BquoFont);
51
+
52
+ # OK
53
+ 1;
@@ -0,0 +1,98 @@
1
+ #!/usr/bin/perl
2
+ #
3
+ # Wrapper around a variety of programs that can do PS -> PDF conversion
4
+ #
5
+
6
+ use strict;
7
+ use File::Spec;
8
+
9
+ my $compress = 1;
10
+
11
+ my $win32_ok = eval {
12
+ require Win32::TieRegistry;
13
+ Win32::TieRegistry->import();
14
+ 1;
15
+ };
16
+
17
+ while ($ARGV[0] =~ /^-(.*)$/) {
18
+ my $opt = $1;
19
+ shift @ARGV;
20
+
21
+ if ($opt eq '-nocompress') {
22
+ $compress = 0;
23
+ }
24
+ }
25
+
26
+ my ($in, $out) = @ARGV;
27
+
28
+ if (!defined($out)) {
29
+ die "Usage: $0 [-nocompress] infile ou{ tfile\n";
30
+ }
31
+
32
+ # If Win32, help GhostScript out with some defaults
33
+ sub win32_gs_help() {
34
+ return if (!$win32_ok);
35
+
36
+ use Sort::Versions;
37
+ use sort 'stable';
38
+
39
+ my $Reg = $::Registry->Open('', {Access => 'KEY_READ', Delimiter => '/'});
40
+ my $dir;
41
+ my @gs;
42
+
43
+ foreach my $k1 ('HKEY_CURRENT_USER/Software/',
44
+ 'HKEY_LOCAL_MACHINE/SOFTWARE/') {
45
+ foreach my $k2 ('Artifex/', '') {
46
+ foreach my $k3 ('GPL Ghostscript/', 'AFPL Ghostscript/',
47
+ 'Ghostscript/') {
48
+ my $r = $Reg->{$k1.$k2.$k3};
49
+ if (ref($r) eq 'Win32::TieRegistry') {
50
+ foreach my $k (keys(%$r)) {
51
+ my $rk = $r->{$k};
52
+ if (ref($rk) eq 'Win32::TieRegistry' &&
53
+ defined($rk->{'/GS_LIB'})) {
54
+ push @gs, $rk;
55
+ }
56
+ }
57
+ }
58
+ }
59
+ }
60
+ }
61
+
62
+ @gs = sort {
63
+ my($av) = $a->Path =~ m:^.*/([^/]+)/$:;
64
+ my($bv) = $b->Path =~ m:^.*/([^/]+)/$:;
65
+ versioncmp($av, $bv);
66
+ } @gs;
67
+
68
+ return unless (scalar(@gs));
69
+
70
+ $ENV{'PATH'} .= ';' . $gs[0]->{'/GS_LIB'};
71
+ $ENV{'GS_FONTPATH'} .= (defined($ENV{'GS_FONTPATH'}) ? ';' : '')
72
+ . $ENV{'windir'}.'\\fonts';
73
+ }
74
+
75
+ # Remove output file
76
+ unlink($out);
77
+
78
+ # 1. Acrobat distiller
79
+ my $r = system('acrodist', '-n', '-q', '--nosecurity', '-o', $out, $in);
80
+ exit 0 if ( !$r && -f $out );
81
+
82
+ # 2. ps2pdf (from Ghostscript)
83
+ # The -I clause helps Ghostscript pick up the Fontdir file written by findfont.ph
84
+ # GhostScript uses # rather than - to separate options and values on Windows, it seems...
85
+ win32_gs_help();
86
+ my $o = $win32_ok ? '#' : '-';
87
+ my $r = system('ps2pdf', "-dOptimize${o}true", "-dEmbedAllFonts${o}true",
88
+ "-dCompressPages${o}" . ($compress ? 'true' : 'false'),
89
+ "-dUseFlateCompression${o}true", $in, $out);
90
+ exit 0 if ( !$r && -f $out );
91
+
92
+ # 3. pstopdf (BSD/MacOS X utility)
93
+ my $r = system('pstopdf', $in, '-o', $out);
94
+ exit 0 if ( !$r && -f $out );
95
+
96
+ # Otherwise, fail
97
+ unlink($out);
98
+ exit 1;
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/perl
2
+ #
3
+ # Get the width of a PostScript string in PostScript points (1/72")
4
+ # given a set of font metrics and an encoding vector.
5
+ #
6
+ sub ps_width($$$) {
7
+ my($str, $met, $encoding) = @_;
8
+ my($w) = 0;
9
+ my($i,$c,$p);
10
+
11
+ $l = length($str);
12
+ undef $p;
13
+ for ( $i = 0 ; $i < $l ; $i++ ) {
14
+ $c = substr($str,$i,1);
15
+ $w += $$met{widths}{$encoding->[ord($c)]};
16
+ # The standard PostScript "show" operator doesn't do kerning.
17
+ # $w += $$met{kern}{$p.$c};
18
+ $p = $c;
19
+ }
20
+
21
+ return $w / $met->{scale};
22
+ }
23
+
24
+ # OK
25
+ 1;
@@ -0,0 +1,1111 @@
1
+ #!/usr/bin/perl
2
+ ## --------------------------------------------------------------------------
3
+ ##
4
+ ## Copyright 1996-2017 The NASM Authors - All Rights Reserved
5
+ ## See the file AUTHORS included with the NASM distribution for
6
+ ## the specific copyright holders.
7
+ ##
8
+ ## Redistribution and use in source and binary forms, with or without
9
+ ## modification, are permitted provided that the following
10
+ ## conditions are met:
11
+ ##
12
+ ## * Redistributions of source code must retain the above copyright
13
+ ## notice, this list of conditions and the following disclaimer.
14
+ ## * Redistributions in binary form must reproduce the above
15
+ ## copyright notice, this list of conditions and the following
16
+ ## disclaimer in the documentation and/or other materials provided
17
+ ## with the distribution.
18
+ ##
19
+ ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
20
+ ## CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
21
+ ## INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22
+ ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ ## DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24
+ ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25
+ ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26
+ ## NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27
+ ## LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28
+ ## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29
+ ## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
30
+ ## OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31
+ ## EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
+ ##
33
+ ## --------------------------------------------------------------------------
34
+
35
+
36
+ # Read the source-form of the NASM manual and generate the various
37
+ # output forms.
38
+
39
+ # TODO:
40
+ #
41
+ # Ellipsis support would be nice.
42
+
43
+ # Source-form features:
44
+ # ---------------------
45
+ #
46
+ # Bullet \b
47
+ # Bullets the paragraph. Rest of paragraph is indented to cope. In
48
+ # HTML, consecutive groups of bulleted paragraphs become unordered
49
+ # lists.
50
+ #
51
+ # Indent \>
52
+ # Indents the paragraph equvalently to a bulleted paragraph. In HTML,
53
+ # an indented paragraph following a bulleted paragraph is included in the
54
+ # same list item.
55
+ #
56
+ # Blockquote \q
57
+ # Marks the paragraph as a block quote.
58
+ #
59
+ # Emphasis \e{foobar}
60
+ # produces `_foobar_' in text and italics in HTML, PS, RTF
61
+ #
62
+ # Inline code \c{foobar}
63
+ # produces ``foobar'' in text, and fixed-pitch font in HTML, PS, RTF
64
+ #
65
+ # Display code
66
+ # \c line one
67
+ # \c line two
68
+ # produces fixed-pitch font where appropriate, and doesn't break
69
+ # pages except sufficiently far into the middle of a display.
70
+ #
71
+ # Chapter, header and subheader
72
+ # \C{intro} Introduction
73
+ # \H{whatsnasm} What is NASM?
74
+ # \S{free} NASM Is Free
75
+ # dealt with as appropriate. Chapters begin on new sides, possibly
76
+ # even new _pages_. (Sub)?headers are good places to begin new
77
+ # pages. Just _after_ a (sub)?header isn't.
78
+ # The keywords can be substituted with \K and \k.
79
+ #
80
+ # Keyword \K{cintro} \k{cintro}
81
+ # Expands to `Chapter 1', `Section 1.1', `Section 1.1.1'. \K has an
82
+ # initial capital whereas \k doesn't. In HTML, will produce
83
+ # hyperlinks.
84
+ #
85
+ # Web link \W{http://foobar/}{text} or \W{mailto:me@here}\c{me@here}
86
+ # the \W prefix is ignored except in HTML; in HTML the last part
87
+ # becomes a hyperlink to the first part.
88
+ #
89
+ # Literals \{ \} \\
90
+ # In case it's necessary, they expand to the real versions.
91
+ #
92
+ # Nonbreaking hyphen \-
93
+ # Need more be said?
94
+ #
95
+ # Source comment \#
96
+ # Causes everything after it on the line to be ignored by the
97
+ # source-form processor.
98
+ #
99
+ # Indexable word \i{foobar} (or \i\e{foobar} or \i\c{foobar}, equally)
100
+ # makes word appear in index, referenced to that point
101
+ # \i\c comes up in code style even in the index; \i\e doesn't come
102
+ # up in emphasised style.
103
+ #
104
+ # Indexable non-displayed word \I{foobar} or \I\c{foobar}
105
+ # just as \i{foobar} except that nothing is displayed for it
106
+ #
107
+ # Index rewrite
108
+ # \IR{foobar} \c{foobar} operator, uses of
109
+ # tidies up the appearance in the index of something the \i or \I
110
+ # operator was applied to
111
+ #
112
+ # Index alias
113
+ # \IA{foobar}{bazquux}
114
+ # aliases one index tag (as might be supplied to \i or \I) to
115
+ # another, so that \I{foobar} has the effect of \I{bazquux}, and
116
+ # \i{foobar} has the effect of \I{bazquux}foobar
117
+ #
118
+ # Metadata
119
+ # \M{key}{something}
120
+ # defines document metadata, such as authorship, title and copyright;
121
+ # different output formats use this differently.
122
+ #
123
+ # Include subfile
124
+ # \&{filename}
125
+ # Includes filename. Recursion is allowed.
126
+ #
127
+
128
+ use File::Spec;
129
+
130
+ @include_path = ();
131
+ $out_path = File::Spec->curdir();
132
+
133
+ while ($ARGV[0] =~ /^-/) {
134
+ my $opt = shift @ARGV;
135
+ if ($opt eq '-d') {
136
+ $diag = 1;
137
+ } elsif ($opt =~ /^\-[Ii](.*)$/) {
138
+ push(@include_path, $1);
139
+ } elsif ($opt =~ /^\-[Oo](.*)$/) {
140
+ $out_path = $1;
141
+ }
142
+ }
143
+
144
+ $out_format = shift(@ARGV);
145
+ @files = @ARGV;
146
+ @files = ('-') unless(scalar(@files));
147
+
148
+ $| = 1;
149
+
150
+ $tstruct_previtem = $node = "Top";
151
+ $nodes = ($node);
152
+ $tstruct_level{$tstruct_previtem} = 0;
153
+ $tstruct_last[$tstruct_level{$tstruct_previtem}] = $tstruct_previtem;
154
+ $MAXLEVEL = 10; # really 3, but play safe ;-)
155
+
156
+ # Read the file; pass a paragraph at a time to the paragraph processor.
157
+ print "Reading input...";
158
+ $pname = "para000000";
159
+ @pnames = @pflags = ();
160
+ $para = undef;
161
+ foreach $file (@files) {
162
+ &include($file);
163
+ }
164
+ &got_para($para);
165
+ print "done.\n";
166
+
167
+ # Now we've read in the entire document and we know what all the
168
+ # heading keywords refer to. Go through and fix up the \k references.
169
+ print "Fixing up cross-references...";
170
+ &fixup_xrefs;
171
+ print "done.\n";
172
+
173
+ # Sort the index tags, according to the slightly odd order I've decided on.
174
+ print "Sorting index tags...";
175
+ &indexsort;
176
+ print "done.\n";
177
+
178
+ # Make output directory if necessary
179
+ mkdir($out_path);
180
+
181
+ if ($diag) {
182
+ print "Writing index-diagnostic file...";
183
+ &indexdiag;
184
+ print "done.\n";
185
+ }
186
+
187
+ # OK. Write out the various output files.
188
+ if ($out_format eq 'txt') {
189
+ print "Producing text output: ";
190
+ &write_txt;
191
+ print "done.\n";
192
+ } elsif ($out_format eq 'html') {
193
+ print "Producing HTML output: ";
194
+ &write_html;
195
+ print "done.\n";
196
+ } elsif ($out_format eq 'dip') {
197
+ print "Producing Documentation Intermediate Paragraphs: ";
198
+ &write_dip;
199
+ print "done.\n";
200
+ } else {
201
+ die "$0: unknown output format: $out_format\n";
202
+ }
203
+
204
+ sub untabify($) {
205
+ my($s) = @_;
206
+ my $o = '';
207
+ my($c, $i, $p);
208
+
209
+ $p = 0;
210
+ for ($i = 0; $i < length($s); $i++) {
211
+ $c = substr($s, $i, 1);
212
+ if ($c eq "\t") {
213
+ do {
214
+ $o .= ' ';
215
+ $p++;
216
+ } while ($p & 7);
217
+ } else {
218
+ $o .= $c;
219
+ $p++;
220
+ }
221
+ }
222
+ return $o;
223
+ }
224
+ sub read_line {
225
+ local $_ = shift;
226
+ $_ = &untabify($_);
227
+ if (/\\& (\S+)/) {
228
+ &include($1);
229
+ } else {
230
+ &get_para($_);
231
+ }
232
+ }
233
+ sub get_para($_) {
234
+ chomp;
235
+ if (!/\S/ || /^\\(IA|IR|M)/) { # special case: \IA \IR \M imply new-paragraph
236
+ &got_para($para);
237
+ $para = undef;
238
+ }
239
+ if (/\S/) {
240
+ s/(^|[^\\])\\#.*$/\1/; # strip comments
241
+ $para .= " " . $_;
242
+ }
243
+ }
244
+ sub include {
245
+ my $name = shift;
246
+ my $F;
247
+
248
+ if ($name eq '-') {
249
+ open($F, '<-'); # stdin
250
+ } else {
251
+ my $found = 0;
252
+ foreach my $idir ( File::Spec->curdir, @include_path ) {
253
+ my $fpath = File::Spec->catfile($idir, $name);
254
+ if (open($F, '<', $fpath)) {
255
+ $found = 1;
256
+ last;
257
+ }
258
+ }
259
+ die "Cannot open $name: $!\n" unless ($found);
260
+ }
261
+ while (defined($_ = <$F>)) {
262
+ &read_line($_);
263
+ }
264
+ close($F);
265
+ }
266
+ sub got_para {
267
+ local ($_) = @_;
268
+ my $pflags = "", $i, $w, $l, $t;
269
+ return if !/\S/;
270
+
271
+ @$pname = ();
272
+
273
+ # Strip off _leading_ spaces, then determine type of paragraph.
274
+ s/^\s*//;
275
+ $irewrite = undef;
276
+ if (/^\\c[^{]/) {
277
+ # A code paragraph. The paragraph-array will contain the simple
278
+ # strings which form each line of the paragraph.
279
+ $pflags = "code";
280
+ while (/^\\c (([^\\]|\\[^c])*)(.*)$/) {
281
+ $l = $1;
282
+ $_ = $3;
283
+ $l =~ s/\\\{/\{/g;
284
+ $l =~ s/\\\}/}/g;
285
+ $l =~ s/\\\\/\\/g;
286
+ push @$pname, $l;
287
+ }
288
+ $_ = ''; # suppress word-by-word code
289
+ } elsif (/^\\C/) {
290
+ # A chapter heading. Define the keyword and allocate a chapter
291
+ # number.
292
+ $cnum++;
293
+ $hnum = 0;
294
+ $snum = 0;
295
+ $xref = "chapter-$cnum";
296
+ $pflags = "chap $cnum :$xref";
297
+ die "badly formatted chapter heading: $_\n" if !/^\\C\{([^\}]*)\}\s*(.*)$/;
298
+ $refs{$1} = "chapter $cnum";
299
+ $node = "Chapter $cnum";
300
+ &add_item($node, 1);
301
+ $xrefnodes{$node} = $xref; $nodexrefs{$xref} = $node;
302
+ $xrefs{$1} = $xref;
303
+ $_ = $2;
304
+ # the standard word-by-word code will happen next
305
+ } elsif (/^\\A/) {
306
+ # An appendix heading. Define the keyword and allocate an appendix
307
+ # letter.
308
+ $cnum++;
309
+ $cnum = 'A' if $cnum =~ /[0-9]+/;
310
+ $hnum = 0;
311
+ $snum = 0;
312
+ $xref = "appendix-$cnum";
313
+ $pflags = "appn $cnum :$xref";
314
+ die "badly formatted appendix heading: $_\n" if !/^\\A\{([^\}]*)}\s*(.*)$/;
315
+ $refs{$1} = "appendix $cnum";
316
+ $node = "Appendix $cnum";
317
+ &add_item($node, 1);
318
+ $xrefnodes{$node} = $xref; $nodexrefs{$xref} = $node;
319
+ $xrefs{$1} = $xref;
320
+ $_ = $2;
321
+ # the standard word-by-word code will happen next
322
+ } elsif (/^\\H/) {
323
+ # A major heading. Define the keyword and allocate a section number.
324
+ $hnum++;
325
+ $snum = 0;
326
+ $xref = "section-$cnum.$hnum";
327
+ $pflags = "head $cnum.$hnum :$xref";
328
+ die "badly formatted heading: $_\n" if !/^\\[HP]{([^\}]*)}\s*(.*)$/;
329
+ $refs{$1} = "section $cnum.$hnum";
330
+ $node = "Section $cnum.$hnum";
331
+ &add_item($node, 2);
332
+ $xrefnodes{$node} = $xref; $nodexrefs{$xref} = $node;
333
+ $xrefs{$1} = $xref;
334
+ $_ = $2;
335
+ # the standard word-by-word code will happen next
336
+ } elsif (/^\\S/) {
337
+ # A sub-heading. Define the keyword and allocate a section number.
338
+ $snum++;
339
+ $xref = "section-$cnum.$hnum.$snum";
340
+ $pflags = "subh $cnum.$hnum.$snum :$xref";
341
+ die "badly formatted subheading: $_\n" if !/^\\S\{([^\}]*)\}\s*(.*)$/;
342
+ $refs{$1} = "section $cnum.$hnum.$snum";
343
+ $node = "Section $cnum.$hnum.$snum";
344
+ &add_item($node, 3);
345
+ $xrefnodes{$node} = $xref; $nodexrefs{$xref} = $node;
346
+ $xrefs{$1} = $xref;
347
+ $_ = $2;
348
+ # the standard word-by-word code will happen next
349
+ } elsif (/^\\IR/) {
350
+ # An index-rewrite.
351
+ die "badly formatted index rewrite: $_\n" if !/^\\IR\{([^\}]*)\}\s*(.*)$/;
352
+ $irewrite = $1;
353
+ $_ = $2;
354
+ # the standard word-by-word code will happen next
355
+ } elsif (/^\\IA/) {
356
+ # An index-alias.
357
+ die "badly formatted index alias: $_\n" if !/^\\IA\{([^\}]*)}\{([^\}]*)\}\s*$/;
358
+ $idxalias{$1} = $2;
359
+ return; # avoid word-by-word code
360
+ } elsif (/^\\M/) {
361
+ # Metadata
362
+ die "badly formed metadata: $_\n" if !/^\\M\{([^\}]*)}\{([^\}]*)\}\s*$/;
363
+ $metadata{$1} = $2;
364
+ return; # avoid word-by-word code
365
+ } elsif (/^\\([b\>q])/) {
366
+ # An indented paragraph of some sort. Strip off the initial \b and let the
367
+ # word-by-word code take care of the rest.
368
+ my %ipar = (
369
+ 'b' => 'bull',
370
+ '>' => 'indt',
371
+ 'q' => 'bquo',
372
+ );
373
+ $pflags = $ipar{$1};
374
+ s/^\\[b\>q]\s*//;
375
+ } else {
376
+ # A normal paragraph. Just set $pflags: the word-by-word code does
377
+ # the rest.
378
+ $pflags = "norm";
379
+ }
380
+
381
+ # The word-by-word code: unless @$pname is already defined (which it
382
+ # will be in the case of a code paragraph), split the paragraph up
383
+ # into words and push each on @$pname.
384
+ #
385
+ # Each thing pushed on @$pname should have a two-character type
386
+ # code followed by the text.
387
+ #
388
+ # Type codes are:
389
+ # "n " for normal
390
+ # "da" for an en dash
391
+ # "dm" for an em desh
392
+ # "es" for first emphasised word in emphasised bit
393
+ # "e " for emphasised in mid-emphasised-bit
394
+ # "ee" for last emphasised word in emphasised bit
395
+ # "eo" for single (only) emphasised word
396
+ # "c " for code
397
+ # "k " for cross-ref
398
+ # "kK" for capitalised cross-ref
399
+ # "w " for Web link
400
+ # "wc" for code-type Web link
401
+ # "x " for beginning of resolved cross-ref; generates no visible output,
402
+ # and the text is the cross-reference code
403
+ # "xe" for end of resolved cross-ref; text is same as for "x ".
404
+ # "i " for point to be indexed: the text is the internal index into the
405
+ # index-items arrays
406
+ # "sp" for space
407
+ while (/\S/) {
408
+ s/^\s*//, push @$pname, "sp" if /^\s/;
409
+ $indexing = $qindex = 0;
410
+ if (/^(\\[iI])?\\c/) {
411
+ $qindex = 1 if $1 eq "\\I";
412
+ $indexing = 1, s/^\\[iI]// if $1;
413
+ s/^\\c//;
414
+ die "badly formatted \\c: \\c$_\n" if !/\{(([^\\}]|\\.)*)\}(.*)$/;
415
+ $w = $1;
416
+ $_ = $3;
417
+ $w =~ s/\\\{/\{/g;
418
+ $w =~ s/\\\}/\}/g;
419
+ $w =~ s/\\-/-/g;
420
+ $w =~ s/\\\\/\\/g;
421
+ (push @$pname,"i"),$lastp = $#$pname if $indexing;
422
+ push @$pname,"c $w" if !$qindex;
423
+ $$pname[$lastp] = &addidx($node, $w, "c $w") if $indexing;
424
+ } elsif (/^\\[iIe]/) {
425
+ /^(\\[iI])?(\\e)?/;
426
+ $emph = 0;
427
+ $qindex = 1 if $1 eq "\\I";
428
+ $indexing = 1, $type = "\\i" if $1;
429
+ $emph = 1, $type = "\\e" if $2;
430
+ s/^(\\[iI])?(\\e?)//;
431
+ die "badly formatted $type: $type$_\n" if !/\{(([^\\}]|\\.)*)\}(.*)$/;
432
+ $w = $1;
433
+ $_ = $3;
434
+ $w =~ s/\\\{/\{/g;
435
+ $w =~ s/\\\}/\}/g;
436
+ $w =~ s/\\-/-/g;
437
+ $w =~ s/\\\\/\\/g;
438
+ $t = $emph ? "es" : "n ";
439
+ @ientry = ();
440
+ (push @$pname,"i"),$lastp = $#$pname if $indexing;
441
+ foreach $i (split /\s+/,$w) { # \e and \i can be multiple words
442
+ push @$pname,"$t$i","sp" if !$qindex;
443
+ ($ii=$i) =~ tr/A-Z/a-z/, push @ientry,"n $ii","sp" if $indexing;
444
+ $t = $emph ? "e " : "n ";
445
+ }
446
+ $w =~ tr/A-Z/a-z/, pop @ientry if $indexing;
447
+ $$pname[$lastp] = &addidx($node, $w, @ientry) if $indexing;
448
+ pop @$pname if !$qindex; # remove final space
449
+ if (substr($$pname[$#$pname],0,2) eq "es" && !$qindex) {
450
+ substr($$pname[$#$pname],0,2) = "eo";
451
+ } elsif ($emph && !$qindex) {
452
+ substr($$pname[$#$pname],0,2) = "ee";
453
+ }
454
+ } elsif (/^\\[kK]/) {
455
+ $t = "k ";
456
+ $t = "kK" if /^\\K/;
457
+ s/^\\[kK]//;
458
+ die "badly formatted \\k: \\k$_\n" if !/\{([^\}]*)\}(.*)$/;
459
+ $_ = $2;
460
+ push @$pname,"$t$1";
461
+ } elsif (/^\\W/) {
462
+ s/^\\W//;
463
+ die "badly formatted \\W: \\W$_\n"
464
+ if !/\{([^\}]*)\}(\\i)?(\\c)?\{(([^\\}]|\\.)*)\}(.*)$/;
465
+ $l = $1;
466
+ $w = $4;
467
+ $_ = $6;
468
+ $t = "w ";
469
+ $t = "wc" if $3 eq "\\c";
470
+ $indexing = 1 if $2;
471
+ $w =~ s/\\\{/\{/g;
472
+ $w =~ s/\\\}/\}/g;
473
+ $w =~ s/\\-/-/g;
474
+ $w =~ s/\\\\/\\/g;
475
+ (push @$pname,"i"),$lastp = $#$pname if $indexing;
476
+ push @$pname,"$t<$l>$w";
477
+ $$pname[$lastp] = &addidx($node, $w, "c $w") if $indexing;
478
+ } else {
479
+ die "what the hell? $_\n" if !/^(([^\s\\\-]|\\[\\{}\-])*-?)(.*)$/;
480
+ die "painful death! $_\n" if !length $1;
481
+ $w = $1;
482
+ $_ = $3;
483
+ $w =~ s/\\\{/\{/g;
484
+ $w =~ s/\\\}/\}/g;
485
+ $w =~ s/\\-/-/g;
486
+ $w =~ s/\\\\/\\/g;
487
+ if ($w eq '--') {
488
+ push @$pname, 'dm';
489
+ } elsif ($w eq '-') {
490
+ push @$pname, 'da';
491
+ } else {
492
+ push @$pname,"n $w";
493
+ }
494
+ }
495
+ }
496
+ if ($irewrite ne undef) {
497
+ &addidx(undef, $irewrite, @$pname);
498
+ @$pname = ();
499
+ } else {
500
+ push @pnames, $pname;
501
+ push @pflags, $pflags;
502
+ $pname++;
503
+ }
504
+ }
505
+
506
+ sub addidx {
507
+ my ($node, $text, @ientry) = @_;
508
+ $text = $idxalias{$text} || $text;
509
+ if ($node eq undef || !$idxmap{$text}) {
510
+ @$ientry = @ientry;
511
+ $idxmap{$text} = $ientry;
512
+ $ientry++;
513
+ }
514
+ if ($node) {
515
+ $idxnodes{$node,$text} = 1;
516
+ return "i $text";
517
+ }
518
+ }
519
+
520
+ sub indexsort {
521
+ my $iitem, $ientry, $i, $piitem, $pcval, $cval, $clrcval;
522
+
523
+ @itags = map { # get back the original data as the 1st elt of each list
524
+ $_->[0]
525
+ } sort { # compare auxiliary (non-first) elements of lists
526
+ $a->[1] cmp $b->[1] ||
527
+ $a->[2] cmp $b->[2] ||
528
+ $a->[0] cmp $b->[0]
529
+ } map { # transform array into list of 3-element lists
530
+ my $ientry = $idxmap{$_};
531
+ my $a = substr($$ientry[0],2);
532
+ $a =~ tr/A-Za-z0-9//cd;
533
+ [$_, uc($a), substr($$ientry[0],0,2)]
534
+ } keys %idxmap;
535
+
536
+ # Having done that, check for comma-hood.
537
+ $cval = 0;
538
+ foreach $iitem (@itags) {
539
+ $ientry = $idxmap{$iitem};
540
+ $clrcval = 1;
541
+ $pcval = $cval;
542
+ FL:for ($i=0; $i <= $#$ientry; $i++) {
543
+ if ($$ientry[$i] =~ /^(n .*,)(.*)/) {
544
+ $$ientry[$i] = $1;
545
+ splice @$ientry,$i+1,0,"n $2" if length $2;
546
+ $commapos{$iitem} = $i+1;
547
+ $cval = join("\002", @$ientry[0..$i]);
548
+ $clrcval = 0;
549
+ last FL;
550
+ }
551
+ }
552
+ $cval = undef if $clrcval;
553
+ $commanext{$iitem} = $commaafter{$piitem} = 1
554
+ if $cval and ($cval eq $pcval);
555
+ $piitem = $iitem;
556
+ }
557
+ }
558
+
559
+ sub indexdiag {
560
+ my $iitem,$ientry,$w,$ww,$foo,$node;
561
+ open INDEXDIAG, '>', File::Spec->catfile($out_path, 'index.diag');
562
+ foreach $iitem (@itags) {
563
+ $ientry = $idxmap{$iitem};
564
+ print INDEXDIAG "<$iitem> ";
565
+ foreach $w (@$ientry) {
566
+ $ww = &word_txt($w);
567
+ print INDEXDIAG $ww unless $ww eq "\001";
568
+ }
569
+ print INDEXDIAG ":";
570
+ $foo = " ";
571
+ foreach $node (@nodes) {
572
+ (print INDEXDIAG $foo,$node), $foo = ", " if $idxnodes{$node,$iitem};
573
+ }
574
+ print INDEXDIAG "\n";
575
+ }
576
+ close INDEXDIAG;
577
+ }
578
+
579
+ sub fixup_xrefs {
580
+ my $pname, $p, $i, $j, $k, $caps, @repl;
581
+
582
+ for ($p=0; $p<=$#pnames; $p++) {
583
+ next if $pflags[$p] eq "code";
584
+ $pname = $pnames[$p];
585
+ for ($i=$#$pname; $i >= 0; $i--) {
586
+ if ($$pname[$i] =~ /^k/) {
587
+ $k = $$pname[$i];
588
+ $caps = ($k =~ /^kK/);
589
+ $k = substr($k,2);
590
+ $repl = $refs{$k};
591
+ die "undefined keyword `$k'\n" unless $repl;
592
+ substr($repl,0,1) =~ tr/a-z/A-Z/ if $caps;
593
+ @repl = ();
594
+ push @repl,"x $xrefs{$k}";
595
+ foreach $j (split /\s+/,$repl) {
596
+ push @repl,"n $j";
597
+ push @repl,"sp";
598
+ }
599
+ pop @repl; # remove final space
600
+ push @repl,"xe$xrefs{$k}";
601
+ splice @$pname,$i,1,@repl;
602
+ }
603
+ }
604
+ }
605
+ }
606
+
607
+ sub write_txt {
608
+ # This is called from the top level, so I won't bother using
609
+ # my or local.
610
+
611
+ # Open file.
612
+ print "writing file...";
613
+ open TEXT, '>', File::Spec->catfile($out_path, 'nasmdoc.txt');
614
+ select TEXT;
615
+
616
+ # Preamble.
617
+ $title = $metadata{'title'};
618
+ $spaces = ' ' x ((75-(length $title))/2);
619
+ ($underscore = $title) =~ s/./=/g;
620
+ print "$spaces$title\n$spaces$underscore\n";
621
+
622
+ for ($para = 0; $para <= $#pnames; $para++) {
623
+ $pname = $pnames[$para];
624
+ $pflags = $pflags[$para];
625
+ $ptype = substr($pflags,0,4);
626
+
627
+ print "\n"; # always one of these before a new paragraph
628
+
629
+ if ($ptype eq "chap") {
630
+ # Chapter heading. "Chapter N: Title" followed by a line of
631
+ # minus signs.
632
+ $pflags =~ /chap (.*) :(.*)/;
633
+ $title = "Chapter $1: ";
634
+ foreach $i (@$pname) {
635
+ $ww = &word_txt($i);
636
+ $title .= $ww unless $ww eq "\001";
637
+ }
638
+ print "$title\n";
639
+ $title =~ s/./-/g;
640
+ print "$title\n";
641
+ } elsif ($ptype eq "appn") {
642
+ # Appendix heading. "Appendix N: Title" followed by a line of
643
+ # minus signs.
644
+ $pflags =~ /appn (.*) :(.*)/;
645
+ $title = "Appendix $1: ";
646
+ foreach $i (@$pname) {
647
+ $ww = &word_txt($i);
648
+ $title .= $ww unless $ww eq "\001";
649
+ }
650
+ print "$title\n";
651
+ $title =~ s/./-/g;
652
+ print "$title\n";
653
+ } elsif ($ptype eq "head" || $ptype eq "subh") {
654
+ # Heading or subheading. Just a number and some text.
655
+ $pflags =~ /.... (.*) :(.*)/;
656
+ $title = sprintf "%6s ", $1;
657
+ foreach $i (@$pname) {
658
+ $ww = &word_txt($i);
659
+ $title .= $ww unless $ww eq "\001";
660
+ }
661
+ print "$title\n";
662
+ } elsif ($ptype eq "code") {
663
+ # Code paragraph. Emit each line with a seven character indent.
664
+ foreach $i (@$pname) {
665
+ warn "code line longer than 68 chars: $i\n" if length $i > 68;
666
+ print ' 'x7, $i, "\n";
667
+ }
668
+ } elsif ($ptype =~ /^(norm|bull|indt|bquo)$/) {
669
+ # Ordinary paragraph, optionally indented. We wrap, with ragged
670
+ # 75-char right margin and either 7 or 11 char left margin
671
+ # depending on bullets.
672
+ if ($ptype ne 'norm') {
673
+ $line = ' 'x7 . (($ptype eq 'bull') ? '(*) ' : ' ');
674
+ $next = ' 'x11;
675
+ } else {
676
+ $line = $next = ' 'x7;
677
+ }
678
+ @a = @$pname;
679
+ $wd = $wprev = '';
680
+ do {
681
+ do { $w = &word_txt(shift @a) } while $w eq "\001"; # nasty hack
682
+ $wd .= $wprev;
683
+ if ($wprev =~ /-$/ || $w eq ' ' || $w eq '' || $w eq undef) {
684
+ if (length ($line . $wd) > 75) {
685
+ $line =~ s/\s*$//; # trim trailing spaces
686
+ print "$line\n";
687
+ $line = $next;
688
+ $wd =~ s/^\s*//; # trim leading spaces
689
+ }
690
+ $line .= $wd;
691
+ $wd = '';
692
+ }
693
+ $wprev = $w;
694
+ } while ($w ne '' && $w ne undef);
695
+ if ($line =~ /\S/) {
696
+ $line =~ s/\s*$//; # trim trailing spaces
697
+ print "$line\n";
698
+ }
699
+ }
700
+ }
701
+
702
+ # Close file.
703
+ select STDOUT;
704
+ close TEXT;
705
+ }
706
+
707
+ sub word_txt {
708
+ my ($w) = @_;
709
+ my $wtype, $wmajt;
710
+
711
+ return undef if $w eq '' || $w eq undef;
712
+ $wtype = substr($w,0,2);
713
+ $wmajt = substr($wtype,0,1);
714
+ $w = substr($w,2);
715
+ $w =~ s/<.*>// if $wmajt eq "w"; # remove web links
716
+ if ($wmajt eq "n" || $wtype eq "e " || $wtype eq "w ") {
717
+ return $w;
718
+ } elsif ($wtype eq "sp") {
719
+ return ' ';
720
+ } elsif ($wtype eq 'da' || $wtype eq 'dm') {
721
+ return '-';
722
+ } elsif ($wmajt eq "c" || $wtype eq "wc") {
723
+ return "`${w}'";
724
+ } elsif ($wtype eq "es") {
725
+ return "_${w}";
726
+ } elsif ($wtype eq "ee") {
727
+ return "${w}_";
728
+ } elsif ($wtype eq "eo") {
729
+ return "_${w}_";
730
+ } elsif ($wmajt eq "x" || $wmajt eq "i") {
731
+ return "\001";
732
+ } else {
733
+ die "panic in word_txt: $wtype$w\n";
734
+ }
735
+ }
736
+
737
+ sub write_html {
738
+ # This is called from the top level, so I won't bother using
739
+ # my or local.
740
+
741
+ # Write contents file. Just the preamble, then a menu of links to the
742
+ # separate chapter files and the nodes therein.
743
+ print "writing contents file...";
744
+ open TEXT, '>', File::Spec->catfile($out_path, 'nasmdoc0.html');
745
+ select TEXT;
746
+ &html_preamble(0);
747
+ print "<p>This manual documents NASM, the Netwide Assembler: an assembler\n";
748
+ print "targetting the Intel x86 series of processors, with portable source.\n</p>";
749
+ print "<div class=\"toc\">\n";
750
+ $level = 0;
751
+ for ($node = $tstruct_next{'Top'}; $node; $node = $tstruct_next{$node}) {
752
+ my $lastlevel = $level;
753
+ while ($tstruct_level{$node} < $level) {
754
+ print "</li>\n</ol>\n";
755
+ $level--;
756
+ }
757
+ while ($tstruct_level{$node} > $level) {
758
+ print "<ol class=\"toc", ++$level, "\">\n";
759
+ }
760
+ if ($lastlevel >= $level) {
761
+ print "</li>\n";
762
+ }
763
+ $level = $tstruct_level{$node};
764
+ if ($level == 1) {
765
+ # Invent a file name.
766
+ ($number = lc($xrefnodes{$node})) =~ s/.*-//;
767
+ $fname="nasmdocx.html";
768
+ substr($fname,8 - length $number, length $number) = $number;
769
+ $html_fnames{$node} = $fname;
770
+ $link = $fname;
771
+ } else {
772
+ # Use the preceding filename plus a marker point.
773
+ $link = $fname . "#$xrefnodes{$node}";
774
+ }
775
+ $title = '';
776
+ $pname = $tstruct_pname{$node};
777
+ foreach $i (@$pname) {
778
+ $ww = &word_html($i);
779
+ $title .= $ww unless $ww eq "\001";
780
+ }
781
+ print "<li class=\"toc${level}\">\n";
782
+ print "<span class=\"node\">$node: </span><a href=\"$link\">$title</a>\n";
783
+ }
784
+ while ($level--) {
785
+ print "</li>\n</ol>\n";
786
+ }
787
+ print "</div>\n";
788
+ print "</body>\n";
789
+ print "</html>\n";
790
+ select STDOUT;
791
+ close TEXT;
792
+
793
+ # Open a null file, to ensure output (eg random &html_jumppoints calls)
794
+ # goes _somewhere_.
795
+ print "writing chapter files...";
796
+ open TEXT, '>', File::Spec->devnull();
797
+ select TEXT;
798
+ undef $html_nav_last;
799
+ undef $html_nav_next;
800
+
801
+ $in_list = 0;
802
+ $in_bquo = 0;
803
+ $in_code = 0;
804
+
805
+ for ($para = 0; $para <= $#pnames; $para++) {
806
+ $pname = $pnames[$para];
807
+ $pflags = $pflags[$para];
808
+ $ptype = substr($pflags,0,4);
809
+
810
+ $in_code = 0, print "</pre>\n" if ($in_code && $ptype ne 'code');
811
+ $in_list = 0, print "</li>\n</ul>\n" if ($in_list && $ptype !~ /^(bull|indt|code)$/);
812
+ $in_bquo = 0, print "</blockquote>\n" if ($in_bquo && $ptype ne 'bquo');
813
+
814
+ $endtag = '';
815
+
816
+ if ($ptype eq "chap") {
817
+ # Chapter heading. Begin a new file.
818
+ $pflags =~ /chap (.*) :(.*)/;
819
+ $title = "Chapter $1: ";
820
+ $xref = $2;
821
+ &html_postamble; select STDOUT; close TEXT;
822
+ $html_nav_last = $chapternode;
823
+ $chapternode = $nodexrefs{$xref};
824
+ $html_nav_next = $tstruct_mnext{$chapternode};
825
+ open(TEXT, '>', File::Spec->catfile($out_path, $html_fnames{$chapternode}));
826
+ select TEXT;
827
+ &html_preamble(1);
828
+ foreach $i (@$pname) {
829
+ $ww = &word_html($i);
830
+ $title .= $ww unless $ww eq "\001";
831
+ }
832
+ $h = "<h2 id=\"$xref\">$title</h2>\n";
833
+ print $h; print FULL $h;
834
+ } elsif ($ptype eq "appn") {
835
+ # Appendix heading. Begin a new file.
836
+ $pflags =~ /appn (.*) :(.*)/;
837
+ $title = "Appendix $1: ";
838
+ $xref = $2;
839
+ &html_postamble; select STDOUT; close TEXT;
840
+ $html_nav_last = $chapternode;
841
+ $chapternode = $nodexrefs{$xref};
842
+ $html_nav_next = $tstruct_mnext{$chapternode};
843
+ open(TEXT, '>', File::Spec->catfile($out_path, $html_fnames{$chapternode}));
844
+ select TEXT;
845
+ &html_preamble(1);
846
+ foreach $i (@$pname) {
847
+ $ww = &word_html($i);
848
+ $title .= $ww unless $ww eq "\001";
849
+ }
850
+ print "<h2 id=\"$xref\">$title</h2>\n";
851
+ } elsif ($ptype eq "head" || $ptype eq "subh") {
852
+ # Heading or subheading.
853
+ $pflags =~ /.... (.*) :(.*)/;
854
+ $hdr = ($ptype eq "subh" ? "h4" : "h3");
855
+ $title = $1 . " ";
856
+ $xref = $2;
857
+ foreach $i (@$pname) {
858
+ $ww = &word_html($i);
859
+ $title .= $ww unless $ww eq "\001";
860
+ }
861
+ print "<$hdr id=\"$xref\">$title</$hdr>\n";
862
+ } elsif ($ptype eq "code") {
863
+ # Code paragraph.
864
+ $in_code = 1, print "<pre>" unless $in_code;
865
+ print "\n";
866
+ foreach $i (@$pname) {
867
+ $w = $i;
868
+ $w =~ s/&/&amp;/g;
869
+ $w =~ s/</&lt;/g;
870
+ $w =~ s/>/&gt;/g;
871
+ print $w, "\n";
872
+ }
873
+ } elsif ($ptype =~ /^(norm|bull|indt|bquo)$/) {
874
+ # Ordinary paragraph, optionally indented.
875
+ if ($ptype eq 'bull') {
876
+ if (!$in_list) {
877
+ $in_list = 1;
878
+ print "<ul>\n";
879
+ } else {
880
+ print "</li>\n";
881
+ }
882
+ print "<li>\n";
883
+ $line = '<p>';
884
+ $endtag = '</p>';
885
+ } elsif ($ptype eq 'indt') {
886
+ if (!$in_list) {
887
+ $in_list = 1;
888
+ print "<ul>\n";
889
+ print "<li class=\"indt\">\n"; # This is such a hack
890
+ }
891
+ $line = '<p>';
892
+ $endtag = '</p>';
893
+ } elsif ($ptype eq 'bquo') {
894
+ $in_bquo = 1, print "<blockquote>\n" unless $in_bquo;
895
+ $line = '<p>';
896
+ $endtag = '</p>';
897
+ } else {
898
+ $line = '<p>';
899
+ $endtag = '</p>';
900
+ }
901
+ @a = @$pname;
902
+ $wd = $wprev = '';
903
+ do {
904
+ do { $w = &word_html(shift @a) } while $w eq "\001"; # nasty hack
905
+ $wd .= $wprev;
906
+ if ($w eq ' ' || $w eq '' || $w eq undef) {
907
+ if (length ($line . $wd) > 75) {
908
+ $line =~ s/\s*$//; # trim trailing spaces
909
+ print "$line\n";
910
+ $line = '';
911
+ $wd =~ s/^\s*//; # trim leading spaces
912
+ }
913
+ $line .= $wd;
914
+ $wd = '';
915
+ }
916
+ $wprev = $w;
917
+ } while ($w ne '' && $w ne undef);
918
+ if ($line =~ /\S/) {
919
+ $line =~ s/\s*$//; # trim trailing spaces
920
+ print $line;
921
+ }
922
+ print $endtag, "\n";
923
+ }
924
+ }
925
+
926
+ # Close whichever file was open.
927
+ print "</pre>\n" if ($in_code);
928
+ print "</li>\n</ul>\n" if ($in_list);
929
+ print "</blockquote>\n" if ($in_bquo);
930
+ &html_postamble; select STDOUT; close TEXT;
931
+
932
+ print "\n writing index file...";
933
+ open TEXT, '>', File::Spec->catfile($out_path, 'nasmdoci.html');
934
+ select TEXT;
935
+ &html_preamble(0);
936
+ print "<h2 class=\"index\">Index</h2>\n";
937
+ print "<ul class=\"index\">\n";
938
+ &html_index;
939
+ print "</ul>\n</body>\n</html>\n";
940
+ select STDOUT;
941
+ close TEXT;
942
+ }
943
+
944
+ sub html_preamble {
945
+ print "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>\n";
946
+ print "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" ";
947
+ print "\"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n";
948
+ print "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
949
+ print "<head>\n";
950
+ print "<title>", $metadata{'title'}, "</title>\n";
951
+ print "<link href=\"nasmdoc.css\" rel=\"stylesheet\" type=\"text/css\" />\n";
952
+ print "<link href=\"local.css\" rel=\"stylesheet\" type=\"text/css\" />\n";
953
+ print "</head>\n";
954
+ print "<body>\n";
955
+
956
+ # Navigation bar
957
+ print "<ul class=\"navbar\">\n";
958
+ if (defined($html_nav_last)) {
959
+ my $lastf = $html_fnames{$html_nav_last};
960
+ print "<li class=\"first\"><a class=\"prev\" href=\"$lastf\">$html_nav_last</a></li>\n";
961
+ }
962
+ if (defined($html_nav_next)) {
963
+ my $nextf = $html_fnames{$html_nav_next};
964
+ print "<li><a class=\"next\" href=\"$nextf\">$html_nav_next</a></li>\n";
965
+ }
966
+ print "<li><a class=\"toc\" href=\"nasmdoc0.html\">Contents</a></li>\n";
967
+ print "<li class=\"last\"><a class=\"index\" href=\"nasmdoci.html\">Index</a></li>\n";
968
+ print "</ul>\n";
969
+
970
+ print "<div class=\"title\">\n";
971
+ print "<h1>", $metadata{'title'}, "</h1>\n";
972
+ print '<span class="subtitle">', $metadata{'subtitle'}, "</span>\n";
973
+ print "</div>\n";
974
+ print "<div class=\"contents\"\n>\n";
975
+ }
976
+
977
+ sub html_postamble {
978
+ # Common closing tags
979
+ print "</div>\n</body>\n</html>\n";
980
+ }
981
+
982
+ sub html_index {
983
+ my $itag, $a, @ientry, $sep, $w, $wd, $wprev, $line;
984
+
985
+ $chapternode = '';
986
+ foreach $itag (@itags) {
987
+ $ientry = $idxmap{$itag};
988
+ @a = @$ientry;
989
+ push @a, "n :";
990
+ $sep = 0;
991
+ foreach $node (@nodes) {
992
+ next if !$idxnodes{$node,$itag};
993
+ push @a, "n ," if $sep;
994
+ push @a, "sp", "x $xrefnodes{$node}", "n $node", "xe$xrefnodes{$node}";
995
+ $sep = 1;
996
+ }
997
+ print "<li class=\"index\">\n";
998
+ $line = '';
999
+ do {
1000
+ do { $w = &word_html(shift @a) } while $w eq "\001"; # nasty hack
1001
+ $wd .= $wprev;
1002
+ if ($w eq ' ' || $w eq '' || $w eq undef) {
1003
+ if (length ($line . $wd) > 75) {
1004
+ $line =~ s/\s*$//; # trim trailing spaces
1005
+ print "$line\n";
1006
+ $line = '';
1007
+ $wd =~ s/^\s*//; # trim leading spaces
1008
+ }
1009
+ $line .= $wd;
1010
+ $wd = '';
1011
+ }
1012
+ $wprev = $w;
1013
+ } while ($w ne '' && $w ne undef);
1014
+ if ($line =~ /\S/) {
1015
+ $line =~ s/\s*$//; # trim trailing spaces
1016
+ print $line, "\n";
1017
+ }
1018
+ print "</li>\n";
1019
+ }
1020
+ }
1021
+
1022
+ sub word_html {
1023
+ my ($w) = @_;
1024
+ my $wtype, $wmajt, $pfx, $sfx;
1025
+
1026
+ return undef if $w eq '' || $w eq undef;
1027
+
1028
+ $wtype = substr($w,0,2);
1029
+ $wmajt = substr($wtype,0,1);
1030
+ $w = substr($w,2);
1031
+ $pfx = $sfx = '';
1032
+ $pfx = "<a href=\"$1\">", $sfx = "</a>", $w = $2
1033
+ if $wmajt eq "w" && $w =~ /^<(.*)>(.*)$/;
1034
+ $w =~ s/&/&amp;/g;
1035
+ $w =~ s/</&lt;/g;
1036
+ $w =~ s/>/&gt;/g;
1037
+ if ($wmajt eq "n" || $wtype eq "e " || $wtype eq "w ") {
1038
+ return $pfx . $w . $sfx;
1039
+ } elsif ($wtype eq "sp") {
1040
+ return ' ';
1041
+ } elsif ($wtype eq "da") {
1042
+ return '&ndash;';
1043
+ } elsif ($wtype eq "dm") {
1044
+ return '&mdash;';
1045
+ } elsif ($wmajt eq "c" || $wtype eq "wc") {
1046
+ return $pfx . "<code>${w}</code>" . $sfx;
1047
+ } elsif ($wtype eq "es") {
1048
+ return "<em>${w}";
1049
+ } elsif ($wtype eq "ee") {
1050
+ return "${w}</em>";
1051
+ } elsif ($wtype eq "eo") {
1052
+ return "<em>${w}</em>";
1053
+ } elsif ($wtype eq "x ") {
1054
+ # Magic: we must resolve the cross reference into file and marker
1055
+ # parts, then dispose of the file part if it's us, and dispose of
1056
+ # the marker part if the cross reference describes the top node of
1057
+ # another file.
1058
+ my $node = $nodexrefs{$w}; # find the node we're aiming at
1059
+ my $level = $tstruct_level{$node}; # and its level
1060
+ my $up = $node, $uplev = $level-1;
1061
+ $up = $tstruct_up{$up} while $uplev--; # get top node of containing file
1062
+ my $file = ($up ne $chapternode) ? $html_fnames{$up} : "";
1063
+ my $marker = ($level == 1 and $file) ? "" : "#$w";
1064
+ return "<a href=\"$file$marker\">";
1065
+ } elsif ($wtype eq "xe") {
1066
+ return "</a>";
1067
+ } elsif ($wmajt eq "i") {
1068
+ return "\001";
1069
+ } else {
1070
+ die "panic in word_html: $wtype$w\n";
1071
+ }
1072
+ }
1073
+
1074
+ # Make tree structures. $tstruct_* is top-level and global.
1075
+ sub add_item {
1076
+ my ($item, $level) = @_;
1077
+ my $i;
1078
+
1079
+ $tstruct_pname{$item} = $pname;
1080
+ $tstruct_next{$tstruct_previtem} = $item;
1081
+ $tstruct_prev{$item} = $tstruct_previtem;
1082
+ $tstruct_level{$item} = $level;
1083
+ $tstruct_up{$item} = $tstruct_last[$level-1];
1084
+ $tstruct_mnext{$tstruct_last[$level]} = $item;
1085
+ $tstruct_last[$level] = $item;
1086
+ for ($i=$level+1; $i<$MAXLEVEL; $i++) { $tstruct_last[$i] = undef; }
1087
+ $tstruct_previtem = $item;
1088
+ push @nodes, $item;
1089
+ }
1090
+
1091
+ #
1092
+ # This produces documentation intermediate paragraph format; this is
1093
+ # basically the digested output of the front end. Intended for use
1094
+ # by future backends, instead of putting it all in the same script.
1095
+ #
1096
+ sub write_dip {
1097
+ open(PARAS, '>', File::Spec->catfile($out_path, 'nasmdoc.dip'));
1098
+ foreach $k (sort(keys(%metadata))) {
1099
+ print PARAS 'meta :', $k, "\n";
1100
+ print PARAS $metadata{$k},"\n";
1101
+ }
1102
+ for ($para = 0; $para <= $#pnames; $para++) {
1103
+ print PARAS $pflags[$para], "\n";
1104
+ print PARAS join("\037", @{$pnames[$para]}, "\n");
1105
+ }
1106
+ foreach $k (@itags) {
1107
+ print PARAS 'indx :', $k, "\n";
1108
+ print PARAS join("\037", @{$idxmap{$k}}), "\n";
1109
+ }
1110
+ close(PARAS);
1111
+ }