pass2.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787
  1. /*****************************************************************************/
  2. /* */
  3. /* ASM (B322 Assembler) */
  4. /* */
  5. /* Assembler for B322 */
  6. /* Contains all pass 2 functions */
  7. /* */
  8. /*****************************************************************************/
  9. word getNumberForLabel(char* labelName)
  10. {
  11. word bdosOffset = USERBDOS_OFFSET;
  12. word i;
  13. for (i = 0; i < labelListIndex; i++)
  14. {
  15. if (strcmp(labelName, labelListName[i]) == 0)
  16. {
  17. return (labelListLineNumber[i] + bdosOffset);
  18. }
  19. }
  20. bdos_print("Could not find label: ");
  21. bdos_print(labelName);
  22. bdos_print("\n");
  23. exit(1);
  24. return 0;
  25. }
  26. void pass2Halt(char* outputAddr, char* outputCursor)
  27. {
  28. char instr = 0xFFFFFFFF;
  29. outputAddr[*outputCursor] = instr;
  30. (*outputCursor) += 1;
  31. }
  32. void pass2Read(char* outputAddr, char* outputCursor)
  33. {
  34. word instr = 0xE0000000;
  35. word arg1num = getNumberAtArg(1);
  36. // arg1 should fit in 16 bits (signed numbers have 1 bit less)
  37. word bitsCheck = 16;
  38. if (arg1num < 0)
  39. {
  40. bitsCheck = 15;
  41. }
  42. if ((MATH_abs(arg1num) >> bitsCheck) > 0)
  43. {
  44. bdos_print("READ: arg1 is >16 bits\n");
  45. exit(1);
  46. }
  47. word mask = 0xffff;
  48. instr += ((arg1num & mask) << 12);
  49. // arg2
  50. char arg2buf[16];
  51. getArgPos(2, arg2buf);
  52. // arg2 should be a reg
  53. if (arg2buf[0] != 'r')
  54. {
  55. bdos_print("READ: arg2 not a reg\n");
  56. exit(1);
  57. }
  58. word arg2num = strToInt(&arg2buf[1]);
  59. instr += (arg2num << 8);
  60. // arg3
  61. char arg3buf[16];
  62. getArgPos(3, arg3buf);
  63. // arg3 should be a reg
  64. if (arg3buf[0] != 'r')
  65. {
  66. bdos_print("READ: arg3 not a reg\n");
  67. exit(1);
  68. }
  69. word arg3num = strToInt(&arg3buf[1]);
  70. instr += arg3num;
  71. // write to mem
  72. outputAddr[*outputCursor] = instr;
  73. (*outputCursor) += 1;
  74. }
  75. void pass2Write(char* outputAddr, char* outputCursor)
  76. {
  77. word instr = 0xD0000000;
  78. word arg1num = getNumberAtArg(1);
  79. // arg1 should fit in 16 bits (signed numbers have 1 bit less)
  80. word bitsCheck = 16;
  81. if (arg1num < 0)
  82. {
  83. bitsCheck = 15;
  84. }
  85. if ((MATH_abs(arg1num) >> bitsCheck) > 0)
  86. {
  87. bdos_print("READ: arg1 is >16 bits\n");
  88. exit(1);
  89. }
  90. word mask = 0xffff;
  91. instr += ((arg1num & mask) << 12);
  92. // arg2
  93. char arg2buf[16];
  94. getArgPos(2, arg2buf);
  95. // arg2 should be a reg
  96. if (arg2buf[0] != 'r')
  97. {
  98. bdos_print("WRITE: arg2 not a reg\n");
  99. exit(1);
  100. }
  101. word arg2num = strToInt(&arg2buf[1]);
  102. instr += (arg2num << 8);
  103. // arg3
  104. char arg3buf[16];
  105. getArgPos(3, arg3buf);
  106. // arg3 should be a reg
  107. if (arg3buf[0] != 'r')
  108. {
  109. bdos_print("WRITE: arg3 not a reg\n");
  110. exit(1);
  111. }
  112. word arg3num = strToInt(&arg3buf[1]);
  113. instr += (arg3num << 4);
  114. // write to mem
  115. outputAddr[*outputCursor] = instr;
  116. (*outputCursor) += 1;
  117. }
  118. void pass2Readintid(char* outputAddr, char* outputCursor)
  119. {
  120. word instr = 0xC0000000;
  121. // arg1
  122. char arg1buf[16];
  123. getArgPos(1, arg1buf);
  124. // arg1 should be a reg
  125. if (arg1buf[0] != 'r')
  126. {
  127. bdos_print("READINTID: arg1 not a reg\n");
  128. exit(1);
  129. }
  130. word arg1num = strToInt(&arg1buf[1]);
  131. instr += arg1num;
  132. // write to mem
  133. outputAddr[*outputCursor] = instr;
  134. (*outputCursor) += 1;
  135. }
  136. void pass2Push(char* outputAddr, char* outputCursor)
  137. {
  138. word instr = 0xB0000000;
  139. // arg1
  140. char arg1buf[16];
  141. getArgPos(1, arg1buf);
  142. // arg1 should be a reg
  143. if (arg1buf[0] != 'r')
  144. {
  145. bdos_print("PUSH: arg1 not a reg\n");
  146. exit(1);
  147. }
  148. word arg1num = strToInt(&arg1buf[1]);
  149. instr += (arg1num << 4);
  150. // write to mem
  151. outputAddr[*outputCursor] = instr;
  152. (*outputCursor) += 1;
  153. }
  154. void pass2Pop(char* outputAddr, char* outputCursor)
  155. {
  156. word instr = 0xA0000000;
  157. // arg1
  158. char arg1buf[16];
  159. getArgPos(1, arg1buf);
  160. // arg1 should be a reg
  161. if (arg1buf[0] != 'r')
  162. {
  163. bdos_print("POP: arg1 not a reg\n");
  164. exit(1);
  165. }
  166. word arg1num = strToInt(&arg1buf[1]);
  167. instr += arg1num;
  168. // write to mem
  169. outputAddr[*outputCursor] = instr;
  170. (*outputCursor) += 1;
  171. }
  172. void pass2Jump(char* outputAddr, char* outputCursor)
  173. {
  174. word instr = 0x90000000;
  175. // check if jump to label
  176. // if yes, replace label with line number
  177. char arg1buf[LABEL_NAME_SIZE+1];
  178. getArgPos(1, arg1buf);
  179. word arg1bufLen = strlen(arg1buf);
  180. word argIsLabel = 0;
  181. word i;
  182. for (i = 0; i < arg1bufLen; i++)
  183. {
  184. if (arg1buf[i] < '0' || arg1buf[i] > '9')
  185. {
  186. argIsLabel = 1;
  187. break;
  188. }
  189. }
  190. word arg1num = 0;
  191. if (argIsLabel)
  192. {
  193. arg1num = getNumberForLabel(arg1buf);
  194. }
  195. else
  196. {
  197. arg1num = getNumberAtArg(1);
  198. }
  199. // arg1 should fit in 27 bits
  200. if (((unsigned)arg1num >> 27) > 0)
  201. {
  202. bdos_print("JUMPO: arg1 is >27 bits\n");
  203. exit(1);
  204. }
  205. instr += (arg1num << 1);
  206. // write to mem
  207. outputAddr[*outputCursor] = instr;
  208. (*outputCursor) += 1;
  209. }
  210. void pass2Jumpo(char* outputAddr, char* outputCursor)
  211. {
  212. word instr = 0x90000000;
  213. word arg1num = getNumberAtArg(1);
  214. // arg1 should fit in 27 bits
  215. if (((unsigned)arg1num >> 27) > 0)
  216. {
  217. bdos_print("JUMPO: arg1 is >27 bits\n");
  218. exit(1);
  219. }
  220. instr += (arg1num << 1);
  221. instr ^= 1;
  222. // write to mem
  223. outputAddr[*outputCursor] = instr;
  224. (*outputCursor) += 1;
  225. }
  226. void pass2Jumpr(char* outputAddr, char* outputCursor)
  227. {
  228. word instr = 0x80000000;
  229. word arg1num = getNumberAtArg(1);
  230. // arg1 should fit in 16 bits
  231. if (((unsigned)arg1num >> 16) > 0)
  232. {
  233. bdos_print("JUMPR: arg1 is >16 bits\n");
  234. exit(1);
  235. }
  236. instr += (arg1num << 12);
  237. // arg2
  238. char arg2buf[16];
  239. getArgPos(2, arg2buf);
  240. // arg2 should be a reg
  241. if (arg2buf[0] != 'r')
  242. {
  243. bdos_print("JUMPR: arg2 not a reg\n");
  244. exit(1);
  245. }
  246. word arg2num = strToInt(&arg2buf[1]);
  247. instr += (arg2num << 4);
  248. // write to mem
  249. outputAddr[*outputCursor] = instr;
  250. (*outputCursor) += 1;
  251. }
  252. void pass2Jumpro(char* outputAddr, char* outputCursor)
  253. {
  254. bdos_print("JUMPRO: unimplemented\n");
  255. exit(1);
  256. return;
  257. }
  258. void pass2BranchBase(char* outputAddr, char* outputCursor, word branchOpCode, word branchSigned)
  259. {
  260. word instr = 0x60000000;
  261. // arg1
  262. char arg1buf[16];
  263. getArgPos(1, arg1buf);
  264. // arg1 should be a reg
  265. if (arg1buf[0] != 'r')
  266. {
  267. bdos_print("BEQ: arg1 not a reg\n");
  268. exit(1);
  269. }
  270. word arg1num = strToInt(&arg1buf[1]);
  271. instr += (arg1num << 8);
  272. // arg2
  273. char arg2buf[16];
  274. getArgPos(2, arg2buf);
  275. // arg2 should be a reg
  276. if (arg2buf[0] != 'r')
  277. {
  278. bdos_print("BEQ: arg2 not a reg\n");
  279. exit(1);
  280. }
  281. word arg2num = strToInt(&arg2buf[1]);
  282. instr += (arg2num << 4);
  283. // arg3
  284. word arg3num = getNumberAtArg(3);
  285. // arg3 should fit in 16 bits (signed numbers have 1 bit less)
  286. word bitsCheck = 16;
  287. if (branchSigned)
  288. {
  289. bitsCheck = 15;
  290. }
  291. if ((MATH_abs(arg3num) >> bitsCheck) > 0)
  292. {
  293. bdos_print("READ: arg3 is >16 bits\n");
  294. exit(1);
  295. }
  296. word mask = 0xffff;
  297. instr += ((arg3num & mask) << 12);
  298. // opcode
  299. instr += (branchOpCode << 1);
  300. // signed bit
  301. if (branchSigned)
  302. {
  303. instr ^= 1;
  304. }
  305. // write to mem
  306. outputAddr[*outputCursor] = instr;
  307. (*outputCursor) += 1;
  308. }
  309. void pass2Beq(char* outputAddr, char* outputCursor)
  310. {
  311. pass2BranchBase(outputAddr, outputCursor, 0x0, 0);
  312. }
  313. void pass2Bgt(char* outputAddr, char* outputCursor)
  314. {
  315. pass2BranchBase(outputAddr, outputCursor, 0x1, 0);
  316. }
  317. void pass2Bgts(char* outputAddr, char* outputCursor)
  318. {
  319. pass2BranchBase(outputAddr, outputCursor, 0x1, 1);
  320. }
  321. void pass2Bge(char* outputAddr, char* outputCursor)
  322. {
  323. pass2BranchBase(outputAddr, outputCursor, 0x2, 0);
  324. }
  325. void pass2Bges(char* outputAddr, char* outputCursor)
  326. {
  327. pass2BranchBase(outputAddr, outputCursor, 0x2, 1);
  328. }
  329. void pass2Bne(char* outputAddr, char* outputCursor)
  330. {
  331. pass2BranchBase(outputAddr, outputCursor, 0x4, 0);
  332. }
  333. void pass2Blt(char* outputAddr, char* outputCursor)
  334. {
  335. pass2BranchBase(outputAddr, outputCursor, 0x5, 0);
  336. }
  337. void pass2Blts(char* outputAddr, char* outputCursor)
  338. {
  339. pass2BranchBase(outputAddr, outputCursor, 0x5, 1);
  340. }
  341. void pass2Ble(char* outputAddr, char* outputCursor)
  342. {
  343. pass2BranchBase(outputAddr, outputCursor, 0x6, 0);
  344. }
  345. void pass2Bles(char* outputAddr, char* outputCursor)
  346. {
  347. pass2BranchBase(outputAddr, outputCursor, 0x6, 1);
  348. }
  349. void pass2Savpc(char* outputAddr, char* outputCursor)
  350. {
  351. word instr = 0x50000000;
  352. // arg1
  353. char arg1buf[16];
  354. getArgPos(1, arg1buf);
  355. // arg1 should be a reg
  356. if (arg1buf[0] != 'r')
  357. {
  358. bdos_print("SAVPC: arg1 not a reg\n");
  359. exit(1);
  360. }
  361. word arg1num = strToInt(&arg1buf[1]);
  362. instr += arg1num;
  363. // write to mem
  364. outputAddr[*outputCursor] = instr;
  365. (*outputCursor) += 1;
  366. }
  367. void pass2Reti(char* outputAddr, char* outputCursor)
  368. {
  369. word instr = 0x40000000;
  370. outputAddr[*outputCursor] = instr;
  371. (*outputCursor) += 1;
  372. }
  373. void pass2Ccache(char* outputAddr, char* outputCursor)
  374. {
  375. word instr = 0x70000000;
  376. outputAddr[*outputCursor] = instr;
  377. (*outputCursor) += 1;
  378. }
  379. void pass2ArithBase(char* outputAddr, char* outputCursor, word arithOpCode)
  380. {
  381. word instr = 0;
  382. // opcode
  383. instr += (arithOpCode << 24);
  384. // arg1
  385. char arg1buf[16];
  386. getArgPos(1, arg1buf);
  387. // arg1 should be a reg
  388. if (arg1buf[0] != 'r')
  389. {
  390. bdos_print("ARITH: arg1 not a reg\n");
  391. exit(1);
  392. }
  393. word arg1num = strToInt(&arg1buf[1]);
  394. // Add arg1num when arg2 is known to be a const or not
  395. // arg2
  396. char arg2buf[16];
  397. getArgPos(2, arg2buf);
  398. word arg2num = 0;
  399. // if arg2 is a const
  400. if (arg2buf[0] != 'r')
  401. {
  402. arg2num= getNumberAtArg(2);
  403. // arg2 should fit in 16 bits (signed numbers have 1 bit less)
  404. word bitsCheck = 16;
  405. if (arg2num < 0)
  406. {
  407. bitsCheck = 15;
  408. }
  409. if ((MATH_abs(arg2num) >> bitsCheck) > 0)
  410. {
  411. bdos_print("ARITH: arg2 is >16 bits\n");
  412. exit(1);
  413. }
  414. word mask = 0xffff;
  415. instr += ((arg2num & mask) << 8);
  416. instr ^= (1 << 28); // set constant bit
  417. instr += (arg1num << 4);
  418. }
  419. else // arg2 is a reg
  420. {
  421. arg2num = strToInt(&arg2buf[1]);
  422. instr += (arg2num << 4);
  423. instr += (arg1num << 8);
  424. }
  425. // arg3
  426. char arg3buf[16];
  427. getArgPos(3, arg3buf);
  428. // arg3 should be a reg
  429. if (arg3buf[0] != 'r')
  430. {
  431. bdos_print("ARITH: arg3 not a reg\n");
  432. exit(1);
  433. }
  434. word arg3num = strToInt(&arg3buf[1]);
  435. instr += arg3num;
  436. // write to mem
  437. outputAddr[*outputCursor] = instr;
  438. (*outputCursor) += 1;
  439. }
  440. void pass2Or(char* outputAddr, char* outputCursor)
  441. {
  442. pass2ArithBase(outputAddr, outputCursor, 0x0);
  443. }
  444. void pass2And(char* outputAddr, char* outputCursor)
  445. {
  446. pass2ArithBase(outputAddr, outputCursor, 0x1);
  447. }
  448. void pass2Xor(char* outputAddr, char* outputCursor)
  449. {
  450. pass2ArithBase(outputAddr, outputCursor, 0x2);
  451. }
  452. void pass2Add(char* outputAddr, char* outputCursor)
  453. {
  454. pass2ArithBase(outputAddr, outputCursor, 0x3);
  455. }
  456. void pass2Sub(char* outputAddr, char* outputCursor)
  457. {
  458. pass2ArithBase(outputAddr, outputCursor, 0x4);
  459. }
  460. void pass2Shiftl(char* outputAddr, char* outputCursor)
  461. {
  462. pass2ArithBase(outputAddr, outputCursor, 0x5);
  463. }
  464. void pass2Shiftr(char* outputAddr, char* outputCursor)
  465. {
  466. pass2ArithBase(outputAddr, outputCursor, 0x6);
  467. }
  468. void pass2Shiftrs(char* outputAddr, char* outputCursor)
  469. {
  470. pass2ArithBase(outputAddr, outputCursor, 0xe);
  471. }
  472. void pass2Mults(char* outputAddr, char* outputCursor)
  473. {
  474. pass2ArithBase(outputAddr, outputCursor, 0x8);
  475. }
  476. void pass2Multu(char* outputAddr, char* outputCursor)
  477. {
  478. pass2ArithBase(outputAddr, outputCursor, 0x9);
  479. }
  480. void pass2Multfp(char* outputAddr, char* outputCursor)
  481. {
  482. pass2ArithBase(outputAddr, outputCursor, 0xf);
  483. }
  484. void pass2Slt(char* outputAddr, char* outputCursor)
  485. {
  486. pass2ArithBase(outputAddr, outputCursor, 0xa);
  487. }
  488. void pass2Sltu(char* outputAddr, char* outputCursor)
  489. {
  490. pass2ArithBase(outputAddr, outputCursor, 0xb);
  491. }
  492. void pass2Not(char* outputAddr, char* outputCursor)
  493. {
  494. word instr = 0x7000000;
  495. // arg1
  496. char arg1buf[16];
  497. getArgPos(1, arg1buf);
  498. // arg1 should be a reg
  499. if (arg1buf[0] != 'r')
  500. {
  501. bdos_print("ARITH: arg1 not a reg\n");
  502. exit(1);
  503. }
  504. word arg1num = strToInt(&arg1buf[1]);
  505. instr += (arg1num << 8);
  506. // arg2
  507. char arg2buf[16];
  508. getArgPos(2, arg2buf);
  509. // arg2 should be a reg
  510. if (arg2buf[0] != 'r')
  511. {
  512. bdos_print("ARITH: arg2 not a reg\n");
  513. exit(1);
  514. }
  515. word arg2num = strToInt(&arg2buf[1]);
  516. instr += arg2num;
  517. // write to mem
  518. outputAddr[*outputCursor] = instr;
  519. (*outputCursor) += 1;
  520. }
  521. void pass2Load(char* outputAddr, char* outputCursor)
  522. {
  523. word instr = 0x1C000000;
  524. word arg1num = getNumberAtArg(1);
  525. // arg1 should fit in 16 bits unsigned
  526. if (((unsigned)arg1num >> 16) > 0)
  527. {
  528. bdos_print("LOAD: arg1 is >16 bits\n");
  529. exit(1);
  530. }
  531. instr += (arg1num << 8);
  532. // arg2
  533. char arg2buf[16];
  534. getArgPos(2, arg2buf);
  535. // arg2 should be a reg
  536. if (arg2buf[0] != 'r')
  537. {
  538. bdos_print("LOAD: arg2 not a reg\n");
  539. exit(1);
  540. }
  541. word arg2num = strToInt(&arg2buf[1]);
  542. instr += (arg2num << 4);
  543. instr += arg2num;
  544. // write to mem
  545. outputAddr[*outputCursor] = instr;
  546. (*outputCursor) += 1;
  547. }
  548. void pass2Loadhi(char* outputAddr, char* outputCursor)
  549. {
  550. word instr = 0x1D000000;
  551. word arg1num = getNumberAtArg(1);
  552. // arg1 should fit in 16 bits unsigned
  553. if (((unsigned)arg1num >> 16) > 0)
  554. {
  555. bdos_print("LOADHI: arg1 is >16 bits\n");
  556. exit(1);
  557. }
  558. instr += (arg1num << 8);
  559. // arg2
  560. char arg2buf[16];
  561. getArgPos(2, arg2buf);
  562. // arg2 should be a reg
  563. if (arg2buf[0] != 'r')
  564. {
  565. bdos_print("LOADHI: arg2 not a reg\n");
  566. exit(1);
  567. }
  568. word arg2num = strToInt(&arg2buf[1]);
  569. instr += (arg2num << 4);
  570. instr += arg2num;
  571. // write to mem
  572. outputAddr[*outputCursor] = instr;
  573. (*outputCursor) += 1;
  574. }
  575. void pass2LoadLabelLow(char* outputAddr, char* outputCursor)
  576. {
  577. word instr = 0x1C000000;
  578. char arg1buf[LABEL_NAME_SIZE+1];
  579. getArgPos(1, arg1buf);
  580. word arg1num = getNumberForLabel(arg1buf);
  581. // only use the lowest 16 bits
  582. arg1num = arg1num << 16;
  583. arg1num = (unsigned)arg1num >> 16;
  584. instr += (arg1num << 8);
  585. // arg2
  586. char arg2buf[16];
  587. getArgPos(2, arg2buf);
  588. // arg2 should be a reg
  589. if (arg2buf[0] != 'r')
  590. {
  591. bdos_print("LOADLABELLOW: arg2 not a reg\n");
  592. exit(1);
  593. }
  594. word arg2num = strToInt(&arg2buf[1]);
  595. instr += (arg2num << 4);
  596. instr += arg2num;
  597. // write to mem
  598. outputAddr[*outputCursor] = instr;
  599. (*outputCursor) += 1;
  600. }
  601. void pass2LoadLabelHigh(char* outputAddr, char* outputCursor)
  602. {
  603. word instr = 0x1D000000;
  604. char arg1buf[LABEL_NAME_SIZE+1];
  605. getArgPos(1, arg1buf);
  606. word arg1num = getNumberForLabel(arg1buf);
  607. // only use the highest 16 bits
  608. arg1num = (unsigned)arg1num >> 16;
  609. instr += (arg1num << 8);
  610. // arg2
  611. char arg2buf[16];
  612. getArgPos(2, arg2buf);
  613. // arg2 should be a reg
  614. if (arg2buf[0] != 'r')
  615. {
  616. bdos_print("LOADLABELHIGH: arg2 not a reg\n");
  617. exit(1);
  618. }
  619. word arg2num = strToInt(&arg2buf[1]);
  620. instr += (arg2num << 4);
  621. instr += arg2num;
  622. // write to mem
  623. outputAddr[*outputCursor] = instr;
  624. (*outputCursor) += 1;
  625. }
  626. void pass2Nop(char* outputAddr, char* outputCursor)
  627. {
  628. word instr = 0;
  629. outputAddr[*outputCursor] = instr;
  630. (*outputCursor) += 1;
  631. }
  632. void pass2Dw(char* outputAddr, char* outputCursor)
  633. {
  634. word dwValue = getNumberAtArg(1);
  635. // write to mem
  636. outputAddr[*outputCursor] = dwValue;
  637. (*outputCursor) += 1;
  638. }
  639. void pass2Dl(char* outputAddr, char* outputCursor)
  640. {
  641. char arg1buf[LABEL_NAME_SIZE+1];
  642. getArgPos(1, arg1buf);
  643. word dlValue = getNumberForLabel(arg1buf);
  644. // write to mem
  645. outputAddr[*outputCursor] = dlValue;
  646. (*outputCursor) += 1;
  647. }