READ_ME 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600
  1. You may want to change mach.c in this directory.
  2. Archives MUST have a table of contents. Arch in subdirectory arch
  3. automatically makes one when you change an archive.
  4. Several changes in the assembler were needed to have it generate the
  5. necessary output.
  6. A contextual diff follows. You can apply them as follows:
  7. patch -d /usr/em/philips/mach/68000/as < READ_ME
  8. *** comm0.h.old Thu Dec 6 16:18:39 1984
  9. --- comm0.h Thu Dec 6 17:49:51 1984
  10. ***************
  11. *** 213,218
  12. /*
  13. * extra type bits out of S_ETC, internal use only
  14. * S_COM:
  15. * - symbols declared by .comm
  16. * S_VAR:
  17. --- 213,219 -----
  18. /*
  19. * extra type bits out of S_ETC, internal use only
  20. + #ifndef DUK
  21. * S_COM:
  22. * - symbols declared by .comm
  23. #endif DUK
  24. ***************
  25. *** 215,220
  26. * extra type bits out of S_ETC, internal use only
  27. * S_COM:
  28. * - symbols declared by .comm
  29. * S_VAR:
  30. * - type not known at end of PASS_1 (S_VAR|S_UND)
  31. * - value not known at end of PASS_2 (S_VAR|S_ABS)
  32. --- 216,222 -----
  33. #ifndef DUK
  34. * S_COM:
  35. * - symbols declared by .comm
  36. + #endif DUK
  37. * S_VAR:
  38. * - type not known at end of PASS_1 (S_VAR|S_UND)
  39. * - value not known at end of PASS_2 (S_VAR|S_ABS)
  40. ***************
  41. *** 221,226
  42. * S_DOT:
  43. * - dot expression
  44. */
  45. #define S_COM 0x0100
  46. #define S_VAR 0x0200
  47. #define S_DOT 0x0400
  48. --- 223,229 -----
  49. * S_DOT:
  50. * - dot expression
  51. */
  52. + #ifndef DUK
  53. #define S_COM 0x0100
  54. #endif DUK
  55. #define S_VAR 0x0200
  56. ***************
  57. *** 222,227
  58. * - dot expression
  59. */
  60. #define S_COM 0x0100
  61. #define S_VAR 0x0200
  62. #define S_DOT 0x0400
  63. /* should be tested by preprocessor
  64. --- 225,231 -----
  65. */
  66. #ifndef DUK
  67. #define S_COM 0x0100
  68. + #endif DUK
  69. #define S_VAR 0x0200
  70. #define S_DOT 0x0400
  71. /* should be tested by preprocessor
  72. *** comm2.y.old Thu Dec 6 16:19:07 1984
  73. --- comm2.y Thu Dec 6 16:02:19 1984
  74. ***************
  75. *** 229,234
  76. {
  77. #ifdef RELOCATION
  78. if (rflag != 0 && PASS_RELO)
  79. newrelo($1.typ, (int)$<y_word>0);
  80. #endif
  81. emitx($1.val, (int)$<y_word>0);
  82. --- 229,239 -----
  83. {
  84. #ifdef RELOCATION
  85. if (rflag != 0 && PASS_RELO)
  86. + #ifdef DUK
  87. + newrelo($1.typ,
  88. + (int)$<y_word>0 | RELBR | RELWR
  89. + );
  90. + #else DUK
  91. newrelo($1.typ, (int)$<y_word>0);
  92. #endif DUK
  93. #endif
  94. ***************
  95. *** 230,235
  96. #ifdef RELOCATION
  97. if (rflag != 0 && PASS_RELO)
  98. newrelo($1.typ, (int)$<y_word>0);
  99. #endif
  100. emitx($1.val, (int)$<y_word>0);
  101. }
  102. --- 235,241 -----
  103. );
  104. #else DUK
  105. newrelo($1.typ, (int)$<y_word>0);
  106. + #endif DUK
  107. #endif
  108. emitx($1.val, (int)$<y_word>0);
  109. }
  110. ***************
  111. *** 237,242
  112. {
  113. #ifdef RELOCATION
  114. if (rflag != 0 && PASS_RELO)
  115. newrelo($3.typ, (int)$<y_word>0);
  116. #endif
  117. emitx($3.val, (int)$<y_word>0);
  118. --- 243,253 -----
  119. {
  120. #ifdef RELOCATION
  121. if (rflag != 0 && PASS_RELO)
  122. + #ifdef DUK
  123. + newrelo($3.typ,
  124. + (int)$<y_word>0 | RELBR | RELWR
  125. + );
  126. + #else DUK
  127. newrelo($3.typ, (int)$<y_word>0);
  128. #endif DUK
  129. #endif
  130. ***************
  131. *** 238,243
  132. #ifdef RELOCATION
  133. if (rflag != 0 && PASS_RELO)
  134. newrelo($3.typ, (int)$<y_word>0);
  135. #endif
  136. emitx($3.val, (int)$<y_word>0);
  137. }
  138. --- 249,255 -----
  139. );
  140. #else DUK
  141. newrelo($3.typ, (int)$<y_word>0);
  142. + #endif DUK
  143. #endif
  144. emitx($3.val, (int)$<y_word>0);
  145. }
  146. *** comm3.c.old Wed Jul 11 09:22:24 1984
  147. --- comm3.c Fri Dec 7 13:06:26 1984
  148. ***************
  149. *** 11,16
  150. struct outhead outhead = {
  151. O_MAGIC, O_STAMP, 0
  152. #ifdef BYTES_REVERSED
  153. | HF_BREV
  154. #endif
  155. --- 11,17 -----
  156. struct outhead outhead = {
  157. O_MAGIC, O_STAMP, 0
  158. + #ifndef DUK
  159. #ifdef BYTES_REVERSED
  160. | HF_BREV
  161. #endif
  162. ***************
  163. *** 17,22
  164. #ifdef WORDS_REVERSED
  165. | HF_WREV
  166. #endif
  167. };
  168. #include "y.tab.h"
  169. --- 18,24 -----
  170. #ifdef WORDS_REVERSED
  171. | HF_WREV
  172. #endif
  173. + #endif DUK
  174. };
  175. #include "y.tab.h"
  176. *** comm5.c.old Thu Dec 6 16:19:40 1984
  177. --- comm5.c Thu Oct 11 14:03:27 1984
  178. ***************
  179. *** 162,167
  180. #endif
  181. case STRING:
  182. p = stringbuf;
  183. *p++ = n = getc(tempfile); break;
  184. case OP_EQ:
  185. case OP_NE:
  186. --- 162,172 -----
  187. #endif
  188. case STRING:
  189. p = stringbuf;
  190. + #ifdef DUK
  191. + *p++ = n = getc(tempfile);
  192. + p[n] = '\0';
  193. + break;
  194. + #else DUK
  195. *p++ = n = getc(tempfile); break;
  196. #endif DUK
  197. case OP_EQ:
  198. ***************
  199. *** 163,168
  200. case STRING:
  201. p = stringbuf;
  202. *p++ = n = getc(tempfile); break;
  203. case OP_EQ:
  204. case OP_NE:
  205. case OP_LE:
  206. --- 168,174 -----
  207. break;
  208. #else DUK
  209. *p++ = n = getc(tempfile); break;
  210. + #endif DUK
  211. case OP_EQ:
  212. case OP_NE:
  213. case OP_LE:
  214. ***************
  215. *** 354,359
  216. break;
  217. if (c == '\\')
  218. c = inescape();
  219. if (p >= &stringbuf[STRINGMAX])
  220. fatal("string buffer overflow");
  221. *p++ = c;
  222. --- 360,368 -----
  223. break;
  224. if (c == '\\')
  225. c = inescape();
  226. + #ifdef DUK
  227. + if (p >= &stringbuf[STRINGMAX - 1])
  228. + #else DUK
  229. if (p >= &stringbuf[STRINGMAX])
  230. #endif DUK
  231. fatal("string buffer overflow");
  232. ***************
  233. *** 355,360
  234. if (c == '\\')
  235. c = inescape();
  236. if (p >= &stringbuf[STRINGMAX])
  237. fatal("string buffer overflow");
  238. *p++ = c;
  239. }
  240. --- 364,370 -----
  241. if (p >= &stringbuf[STRINGMAX - 1])
  242. #else DUK
  243. if (p >= &stringbuf[STRINGMAX])
  244. + #endif DUK
  245. fatal("string buffer overflow");
  246. *p++ = c;
  247. }
  248. ***************
  249. *** 359,364
  250. *p++ = c;
  251. }
  252. stringbuf[0] = p - stringbuf - 1;
  253. return(STRING);
  254. }
  255. --- 369,377 -----
  256. *p++ = c;
  257. }
  258. stringbuf[0] = p - stringbuf - 1;
  259. + #ifdef DUK
  260. + *p = '\0';
  261. + #endif DUK
  262. return(STRING);
  263. }
  264. *** comm6.c.old Thu Dec 6 16:20:22 1984
  265. --- comm6.c Wed Oct 3 15:59:31 1984
  266. ***************
  267. *** 106,111
  268. sp = &sect[typ - S_MIN];
  269. sp->s_item = ip;
  270. sp->s_lign = ALIGNSECT;
  271. ip->i_type = typ | S_EXT;
  272. ip->i_valu = 0;
  273. } else if (typ >= S_MIN) {
  274. --- 106,114 -----
  275. sp = &sect[typ - S_MIN];
  276. sp->s_item = ip;
  277. sp->s_lign = ALIGNSECT;
  278. + #ifdef DUK
  279. + ip->i_type = typ;
  280. + #else DUK
  281. ip->i_type = typ | S_EXT;
  282. #endif DUK
  283. ip->i_valu = 0;
  284. ***************
  285. *** 107,112
  286. sp->s_item = ip;
  287. sp->s_lign = ALIGNSECT;
  288. ip->i_type = typ | S_EXT;
  289. ip->i_valu = 0;
  290. } else if (typ >= S_MIN) {
  291. sp = &sect[typ - S_MIN];
  292. --- 110,116 -----
  293. ip->i_type = typ;
  294. #else DUK
  295. ip->i_type = typ | S_EXT;
  296. + #endif DUK
  297. ip->i_valu = 0;
  298. } else if (typ >= S_MIN) {
  299. sp = &sect[typ - S_MIN];
  300. ***************
  301. *** 180,185
  302. * for possible relocation
  303. */
  304. ip->i_valu = outhead.oh_nname;
  305. newsymb(ip->i_name, S_EXT|DOTTYP, (short)0, val);
  306. #endif
  307. }
  308. --- 184,192 -----
  309. * for possible relocation
  310. */
  311. ip->i_valu = outhead.oh_nname;
  312. + #ifdef DUK
  313. + newsymb(ip->i_name, S_COM|S_EXT|DOTTYP, (short)0, val);
  314. + #else DUK
  315. newsymb(ip->i_name, S_EXT|DOTTYP, (short)0, val);
  316. #endif DUK
  317. #endif
  318. ***************
  319. *** 181,186
  320. */
  321. ip->i_valu = outhead.oh_nname;
  322. newsymb(ip->i_name, S_EXT|DOTTYP, (short)0, val);
  323. #endif
  324. }
  325. --- 188,194 -----
  326. newsymb(ip->i_name, S_COM|S_EXT|DOTTYP, (short)0, val);
  327. #else DUK
  328. newsymb(ip->i_name, S_EXT|DOTTYP, (short)0, val);
  329. + #endif DUK
  330. #endif
  331. }
  332. ***************
  333. *** 255,260
  334. short s;
  335. {
  336. struct outrelo outrelo;
  337. if (rflag == 0)
  338. return;
  339. --- 263,271 -----
  340. short s;
  341. {
  342. struct outrelo outrelo;
  343. + #ifdef DUK
  344. + int iscomm;
  345. + #endif DUK
  346. if (rflag == 0)
  347. return;
  348. ***************
  349. *** 272,277
  350. * b=a
  351. * a: .data2 0
  352. */
  353. s &= ~S_COM;
  354. if ((n & RELPC) == 0 && s == S_ABS)
  355. return;
  356. --- 283,291 -----
  357. * b=a
  358. * a: .data2 0
  359. */
  360. + #ifdef DUK
  361. + iscomm = s & S_COM;
  362. + #endif DUK
  363. s &= ~S_COM;
  364. if ((n & RELPC) == 0 && s == S_ABS)
  365. return;
  366. ***************
  367. *** 285,290
  368. outrelo.or_type = (char)n;
  369. outrelo.or_sect = (char)DOTTYP;
  370. #ifndef ASLD
  371. if (s == S_UND) {
  372. assert(relonami != 0);
  373. outrelo.or_nami = relonami-1;
  374. --- 299,307 -----
  375. outrelo.or_type = (char)n;
  376. outrelo.or_sect = (char)DOTTYP;
  377. #ifndef ASLD
  378. + #ifdef DUK
  379. + if (s == S_UND || iscomm) {
  380. + #else DUK
  381. if (s == S_UND) {
  382. #endif DUK
  383. assert(relonami != 0);
  384. ***************
  385. *** 286,291
  386. outrelo.or_sect = (char)DOTTYP;
  387. #ifndef ASLD
  388. if (s == S_UND) {
  389. assert(relonami != 0);
  390. outrelo.or_nami = relonami-1;
  391. relonami = 0;
  392. --- 303,309 -----
  393. if (s == S_UND || iscomm) {
  394. #else DUK
  395. if (s == S_UND) {
  396. + #endif DUK
  397. assert(relonami != 0);
  398. outrelo.or_nami = relonami-1;
  399. relonami = 0;
  400. *** comm7.c.old Thu Dec 6 16:20:50 1984
  401. --- comm7.c Wed Oct 3 16:35:31 1984
  402. ***************
  403. *** 19,24
  404. return(ip->i_valu);
  405. return(ip->i_valu + sect[typ].s_base);
  406. #else
  407. if ((ip->i_type & S_TYP) == S_UND) {
  408. if (pass == PASS_3) {
  409. if (relonami != 0)
  410. --- 19,27 -----
  411. return(ip->i_valu);
  412. return(ip->i_valu + sect[typ].s_base);
  413. #else
  414. + #ifdef DUK
  415. + if ((ip->i_type & S_TYP) == S_UND || (ip->i_type & S_COM)) {
  416. + #else DUK
  417. if ((ip->i_type & S_TYP) == S_UND) {
  418. #endif DUK
  419. if (pass == PASS_3) {
  420. ***************
  421. *** 20,25
  422. return(ip->i_valu + sect[typ].s_base);
  423. #else
  424. if ((ip->i_type & S_TYP) == S_UND) {
  425. if (pass == PASS_3) {
  426. if (relonami != 0)
  427. serror("relocation error");
  428. --- 23,29 -----
  429. if ((ip->i_type & S_TYP) == S_UND || (ip->i_type & S_COM)) {
  430. #else DUK
  431. if ((ip->i_type & S_TYP) == S_UND) {
  432. + #endif DUK
  433. if (pass == PASS_3) {
  434. if (relonami != 0)
  435. serror("relocation error");
  436. *** mach0.c.old Thu Dec 6 16:21:11 1984
  437. --- mach0.c Fri Sep 14 14:15:54 1984
  438. ***************
  439. *** 1,3
  440. /* @(#)mach0.c 1.5 */
  441. /*
  442. * Motorola 68000/68010 options
  443. --- 1,4 -----
  444. + #define DUK
  445. /* @(#)mach0.c 1.5 */
  446. /*
  447. * Motorola 68000/68010 options
  448. *** mach4.c.old Thu Dec 6 16:21:30 1984
  449. --- mach4.c Thu Dec 6 16:05:00 1984
  450. ***************
  451. *** 21,26
  452. fit(fitw($4.val));
  453. emit2($1 | $2);
  454. #ifdef RELOCATION
  455. newrelo($4.typ, RELPC|RELO2);
  456. #endif
  457. emit2(loww($4.val));
  458. --- 21,29 -----
  459. fit(fitw($4.val));
  460. emit2($1 | $2);
  461. #ifdef RELOCATION
  462. + #ifdef DUK
  463. + newrelo($4.typ, RELPC|RELO2|RELBR|RELWR);
  464. + #else DUK
  465. newrelo($4.typ, RELPC|RELO2);
  466. #endif DUK
  467. #endif
  468. ***************
  469. *** 22,27
  470. emit2($1 | $2);
  471. #ifdef RELOCATION
  472. newrelo($4.typ, RELPC|RELO2);
  473. #endif
  474. emit2(loww($4.val));
  475. }
  476. --- 25,31 -----
  477. newrelo($4.typ, RELPC|RELO2|RELBR|RELWR);
  478. #else DUK
  479. newrelo($4.typ, RELPC|RELO2);
  480. + #endif DUK
  481. #endif
  482. emit2(loww($4.val));
  483. }
  484. *** mach5.c.old Thu Dec 6 16:21:54 1984
  485. --- mach5.c Thu Dec 6 16:07:05 1984
  486. ***************
  487. *** 37,42
  488. #ifdef RELOCATION
  489. RELOMOVE(relonami, rel_1);
  490. if (flag & ~0xFF)
  491. newrelo(exp_1.typ, flag>>8);
  492. #endif
  493. if (flag & PUTL)
  494. --- 37,45 -----
  495. #ifdef RELOCATION
  496. RELOMOVE(relonami, rel_1);
  497. if (flag & ~0xFF)
  498. + #ifdef DUK
  499. + newrelo(exp_1.typ, (flag>>8) | RELBR | RELWR);
  500. + #else DUK
  501. newrelo(exp_1.typ, flag>>8);
  502. #endif DUK
  503. #endif
  504. ***************
  505. *** 38,43
  506. RELOMOVE(relonami, rel_1);
  507. if (flag & ~0xFF)
  508. newrelo(exp_1.typ, flag>>8);
  509. #endif
  510. if (flag & PUTL)
  511. emit4(exp_1.val);
  512. --- 41,47 -----
  513. newrelo(exp_1.typ, (flag>>8) | RELBR | RELWR);
  514. #else DUK
  515. newrelo(exp_1.typ, flag>>8);
  516. + #endif DUK
  517. #endif
  518. if (flag & PUTL)
  519. emit4(exp_1.val);
  520. ***************
  521. *** 357,362
  522. fit(fitw(exp.val));
  523. emit2(opc);
  524. #ifdef RELOCATION
  525. newrelo(exp.typ, RELPC|RELO2);
  526. #endif
  527. emit2(loww(exp.val));
  528. --- 361,369 -----
  529. fit(fitw(exp.val));
  530. emit2(opc);
  531. #ifdef RELOCATION
  532. + #ifdef DUK
  533. + newrelo(exp.typ, RELPC|RELO2|RELBR|RELWR);
  534. + #else DUK
  535. newrelo(exp.typ, RELPC|RELO2);
  536. #endif DUK
  537. #endif
  538. ***************
  539. *** 358,363
  540. emit2(opc);
  541. #ifdef RELOCATION
  542. newrelo(exp.typ, RELPC|RELO2);
  543. #endif
  544. emit2(loww(exp.val));
  545. }
  546. --- 365,371 -----
  547. newrelo(exp.typ, RELPC|RELO2|RELBR|RELWR);
  548. #else DUK
  549. newrelo(exp.typ, RELPC|RELO2);
  550. + #endif DUK
  551. #endif
  552. emit2(loww(exp.val));
  553. }