home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume4 / hp41c-asm < prev    next >
Internet Message Format  |  1989-02-03  |  65KB

  1. Path: xanth!mcnc!rutgers!mailrus!husc6!linus!necntc!ncoast!allbery
  2. From: markb@sm.unisys.com (Mark Biggar)
  3. Newsgroups: comp.sources.misc
  4. Subject: v04i080: HP 41c assembler and barcode generator (in perl)
  5. Message-ID: <8809081839.AA11949@rdcf.sm.unisys.com>
  6. Date: 19 Sep 88 01:46:36 GMT
  7. Sender: allbery@ncoast.UUCP
  8. Reply-To: markb@sm.unisys.com (Mark Biggar)
  9. Organization: Unisys - System Development Group, Santa Monica
  10. Lines: 2252
  11. Approved: allbery@ncoast.UUCP
  12.  
  13. Posting-number: Volume 4, Issue 80
  14. Submitted-by: "Mark Biggar" <markb@sm.unisys.com>
  15. Archive-name: hp41c-asm
  16.  
  17. There is a nice example of fancy perl programming
  18.  
  19. ------------------ cut here --------------------
  20. #!/bin/sh
  21. sed -e 's/^X//' >README <<'EEE_OOO_FFF'
  22. X
  23. X                  HP 41c Assembler and Barcode Generator
  24. X
  25. X                      Copyright 1988 Mark A. Biggar
  26. X          This code may be freely redistributed and used as long
  27. X        as you don't claim you wrote it or make any money off it.
  28. X
  29. X
  30. XThis system consists of two perl scripts with supporting files and
  31. Xdocumentation.  The perl scripts require Perl 2.0 patchlevel 11 or later.
  32. X
  33. XINSTALLATION INSTRUCTIONS
  34. X
  35. X1) unshar the distribution file
  36. X
  37. X2) chose a directory for the rom library (suggested default
  38. X    is /usr/local/lib/hp41c).  If you chose a different directory
  39. X    you will need to change the assignment to $romlib at the top of
  40. X    the script asm41c.
  41. X
  42. X3) make the files asm41c, bar41c and rom/trans executable
  43. X
  44. X4) install stuff by copying it to the proper directories:
  45. X    asm41c & bar41c         /usr/local/bin (or equiv)
  46. X    rom/*                   the selected rom library directory
  47. X    doc/*.l                 the manl directory
  48. X    tmac/tmac.*bar          /usr/lib/tmac
  49. X
  50. X5)  run the files in test to see if everything works
  51. X
  52. XI am loosing my network connect for a while so I can't handle bug reports
  53. Xsorry.
  54. EEE_OOO_FFF
  55. echo x - README
  56. sed -e 's/^X//' >MANIFEST <<'EEE_OOO_FFF'
  57. XMANIFEST                list of files in distribution
  58. XREADME                  READ THIS FIRST
  59. Xasm41c                  assembler perl script
  60. Xbar41c                  barcode generator perl script
  61. Xdoc/asm41c.l            man page for asm41c
  62. Xdoc/bar41c.l            man page for bar41c
  63. Xrom/README              How to build rom files
  64. Xrom/builtins            Assembler builtin operator tables
  65. Xrom/trans               perl script to translate rom files
  66. Xrom/CXextfcn.rom        HP 41CX entended functions
  67. Xrom/CXtime.rom          HP 41CX time functions
  68. Xrom/ILcntl.rom          HP IL loop control functions
  69. Xrom/ILmass.rom          HP IL loop mass storage functions
  70. Xrom/ILprinter.rom       HP IL loop printer functions
  71. Xrom/advantage.rom       advantage module
  72. Xrom/cardr.rom           card reader internal module
  73. Xrom/extfcn.rom          extended functions module
  74. Xrom/games.rom           games I module
  75. Xrom/math.rom            math module
  76. Xrom/ppc.rom             PPC club rom module
  77. Xrom/printer.rom         normal printer functions
  78. Xrom/time.rom            time module
  79. Xrom/wand.rom            wand internal module
  80. Xtest/README             test case files for assembler
  81. Xtest/numbers.test
  82. Xtest/rom.test
  83. Xtest/single.test
  84. Xtest/string.test
  85. Xtest/symbol.test
  86. Xtest/test.41c
  87. Xtest/three.test
  88. Xtest/twobyte.test
  89. Xtmac/README             discriptions of the macros (for brave people)
  90. Xtmac/tmac.lwbar
  91. Xtmac/tmac.vbar
  92. EEE_OOO_FFF
  93. echo x - MANIFEST
  94. sed -e 's/^X//' >asm41c <<'EEE_OOO_FFF'
  95. X#! /bin/perl
  96. X
  97. X$romlib = "/usr/local/lib/hp41c";       # default rom library
  98. X$outfile = 'bar.out';                   # default output file
  99. X$title = "HP 41-C Assembler";           # default title
  100. Xunshift(INC,$romlib);
  101. X$DATE = `date`;
  102. X
  103. Xwhile ($_ = $ARGV[0], /^-/) {
  104. X    shift;
  105. X    last if /^--$/;
  106. X    /^-n/ && do {              # want null bytes
  107. X        ++$nulls;
  108. X        next; };
  109. X    /^-l/ && do {              # want listing
  110. X        ++$listing;
  111. X        next; };
  112. X    /^-o/ && do {              # specify output file
  113. X        die "asm41c: no file arg for -o"
  114. X            unless ($ARGV[0]);
  115. X        $outfile = shift;
  116. X        next; };
  117. X    /^-u/ && do {              # specfiy dir for user rom lib
  118. X        die "asm41c: no arg for -u"
  119. X            unless ($ARGV[0]);
  120. X        unshift(INC,shift);
  121. X        next; };
  122. X    /^-t/ && do {              # specify title
  123. X        die "asm41c: no title arg for -t"
  124. X            unless ($ARGV[0]);
  125. X        $title = shift;
  126. X        next; };
  127. X    /^-r/ && do {              # load rom
  128. X        die "asm41c: no rom name for -r"
  129. X            unless ($ARGV[0]);
  130. X        die "asm41c: can't find rom ".$ARGV[0]
  131. X            unless (do readrom($ARGV[0]));
  132. X        shift;
  133. X        next; };
  134. X    /^-X/ && do {              # load roms of 41-CX
  135. X        die "asm41c: can't load HP-41CX roms"
  136. X            unless (do readrom("CXextfcn") &&
  137. X                do readrom("CXtime"));
  138. X        next; };
  139. X    /^-I/ && do {              # load roms for IL support
  140. X        die "asm41c: can't load IL roms"
  141. X            unless (do readrom("ILcntl") &&
  142. X                do readrom("ILmass") &&
  143. X                do readrom("ILprinter"));
  144. X        next; };
  145. X    #default
  146. X    die "asm41c: unknown flag $_";
  147. X}
  148. X
  149. Xdie "asm41c: can't find builtin ops file"
  150. X    unless (do "builtins");
  151. X
  152. X$~ = 'line';
  153. X$^ = 'top';
  154. Xopen(OUTFILE,">$outfile");
  155. Xif ($title) {print OUTFILE "title $title\n";}
  156. Xdo defsym();
  157. X               # special \ intreps for strings
  158. X$specord{'-'} = 127;            # append char
  159. X$specord{'='} =  29;            # not equal char
  160. X$specord{'S'} = 126;            # sigma (can use '~' instead)
  161. X$specord{'M'} =  12;            # mu
  162. X$specord{'L'} =  13;            # angle char
  163. X$specord{'P'} = 123;            # pi    (can use '{' instead)
  164. X$specord{'A'} = 125;            # arrow char (can use '}' instead)
  165. X
  166. Xwhile (<>) {
  167. X    chop;
  168. X    $line = $_;
  169. X    $error = '';
  170. X    unless (/^[ \t]*$\|^\.\|^[ \t]*#/) {
  171. X        do display('',$_,"Non-directive",'');
  172. X        next;
  173. X    }
  174. X    /^\.rom\s+([^\s#]+)\s*(#.*)?$/ && do {
  175. X        $error = "Can't find rom '$rom'."
  176. X            unless (do readrom($1));
  177. X        do display('',$line,$error,'');
  178. X        next; };
  179. X    /^\.xrom\s+([^\s#]+)\s+(\d\d)\s+(\d\d)\s*(#.*)?$/ && do {
  180. X        $xrom{$1} = sprintf("%03d %03d",160+($2/4),64*($2%4)+$3);
  181. X        do display('',$line,'','');
  182. X        next; };
  183. X    /^\.title\s+([^#]*)(#.*)?$/ && do {
  184. X        $title = $1;
  185. X        do display('',$line,'','');
  186. X        print outfile "title $1\n";
  187. X        next; };
  188. X    /^\.page\s*(#.*)?$/ && do {
  189. X        $- = 0;         #force new page
  190. X        do display('',$line,'','');
  191. X        next; };
  192. X    /^\.prog(\s+private)?(\s+([^#]+))?(#.*)?$/ && do {
  193. X        $program = ($3) || "unnamed";
  194. X        $errcnt = 0;
  195. X        print OUTFILE "program$1 $program\n";
  196. X        do display('',$line,'','');
  197. X        $lineno = 0;
  198. X        $lastnum = $nulls;
  199. X        while (<>) {
  200. X            last if (/^\./);
  201. X            chop;
  202. X            /^\s*(#.*)?$/ && do { #blank or comment
  203. X                do display('',$_,'','');
  204. X                next; };
  205. X            do asm($_);
  206. X            $bytes = join(' ',@byt);
  207. X            do display(++$lineno,$_,$error,$bytes);
  208. X            print OUTFILE "$bytes\n";
  209. X        }
  210. X        $error = $errcnt ?
  211. X            "program: $program, errors: $errcnt.":'';
  212. X        do display('','',$error,'');
  213. X        print OUTFILE "end $program\n";
  214. X        $program = '';
  215. X        last unless (/^\./);
  216. X        redo; };
  217. X    /^\.define\s+([A-Za-z]\w+)\s+(\d+|[A-Za-z]\w+)\s*(#.*)?$/ && do {
  218. X        $name = $1;
  219. X        $val = do validarg($2);
  220. X        do display('',$_,$error,'');
  221. X        $defsymbol{$name} = do pad($val);
  222. X        next; };
  223. X    /^\.exec(\s+([^#]*))?(#.*)?$/ && do {
  224. X        print OUTFILE "exec $2\n";
  225. X        do display('',$line,'','');
  226. X        chop($line = <>);
  227. X        do asm($line);
  228. X        $bytes = join(' ',@byt);
  229. X        do display('',$line,$error,$bytes);
  230. X        print OUTFILE "$bytes\n";
  231. X        next; };
  232. X      /^\.string(\s+append)?\s+"(([^"]*\\")*.*)"(\s+([^#]*))?(#.*)?$/ && do {
  233. X        $str = $2;
  234. X        print OUTFILE "string$1 \"$str\" $5\n";
  235. X        do strbytes($str);
  236. X        if ($#byt > 14) {
  237. X            $error = "String too long -- truncated.";
  238. X            $#byt = 13;
  239. X        }
  240. X        $bytes = join(' ',@byt);
  241. X        print OUTFILE "$bytes\n";
  242. X        do display('',$line,$error,$bytes);
  243. X        next; };
  244. X    /^\.data\s+'([-+]?\d*\.?\d*([eE][-+]?\d*)?)'(\s+([^#]*))?(#.*)?$/ && do {
  245. X        $num = $1;
  246. X        $text = $4;
  247. X        print OUTFILE "data '$num' $text\n";
  248. X        do display('',$line,'','');
  249. X        next; };
  250. X    /^.bytes(\s+checksum)?\s+(\d+(\s+\d+)*)(\s+([^#]*))?(#.*)?/ && do {
  251. X        @byt = split(//,$2);
  252. X        print OUTFILE "bytes$1 $5\n";
  253. X        $checksum = $1;
  254. X        for $num (@byt) {
  255. X            $num = do pad($num % 256);
  256. X        }
  257. X        if ($#byt > ($checksum?14:15)) {
  258. X            $error = "Too many bytes -- Truncated";
  259. X            $#byt = ($checksum?14:15);
  260. X        }
  261. X        $bytes = join(' ',@byt);
  262. X        do display('',$line,$error,$bytes);
  263. X        print OUTFILE "$bytes\n";
  264. X        next; };
  265. X    /^\.clear\s+roms\s*(#.*)?$/ && do {
  266. X        reset 'x';
  267. X        do display('',$line,'','');
  268. X        next; };
  269. X    /^\.clear\s+names\s*(#.*)?$/ && do {
  270. X        reset 'd';
  271. X        do defsym();
  272. X        do display('',$line,'','');
  273. X        next; };
  274. X    /^\./ && do {
  275. X        # if we get to here we don't recognize it
  276. X        do display('',$_,"Unknown directive",'');
  277. X        next; };
  278. X    # default for blank line and/or comments
  279. X    do display('',$_,'','');
  280. X}
  281. Xprint "\f" if ($listing);
  282. Xexit 0;
  283. X
  284. X#
  285. X# end of main routine
  286. X#
  287. X
  288. Xformat line =
  289. X# optional error message
  290. X~         @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  291. X      $error;
  292. X#first six bytes, line number & start of line image
  293. X ^<<<<<<<<<<<<<<<<<<<<<<<  @>>> ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  294. X $bytes                  $lno $limage
  295. X#optional second six bytes & rest of line image
  296. X~^<<<<<<<<<<<<<<<<<<<<<<<           ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  297. X $bytes                                 $limage
  298. X#optional last six bytes
  299. X~^<<<<<<<<<<<<<<<<<<<<<<<
  300. X $bytes
  301. X.
  302. X
  303. Xformat top =
  304. X
  305. X
  306. X @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @>>>>>>>>>>>>>>>>>>>>>>>>>>>
  307. X $title                                       $DATE
  308. X @<<<<<<<<<<<<<<<<<<<<<<<<<<                                      Page @>>
  309. X $program                                                              $%
  310. X
  311. X
  312. X.
  313. X
  314. Xsub readrom {
  315. X    local($romname) = @_;
  316. X    $romname .= ".rom" unless ($romname =~ /\.rom$/);
  317. X    do $romname;
  318. X}
  319. X
  320. Xsub pad {
  321. X    sprintf("%03d",pop(@_));
  322. X}
  323. X
  324. Xsub display {
  325. X    local($lno,$limage,$error,$bytes) = @_;
  326. X    ++$errcnt if $error;
  327. X    if ($listing) {
  328. X        $lno = sprintf("%04d",$lno) if $lno;
  329. X        $error = "ERROR:     $error" if $error;
  330. X        write;
  331. X    } else {
  332. X        if ($error) {
  333. X            print stderr "ERROR: $error\n";
  334. X            print stderr "\t$limage\n";
  335. X        }
  336. X    }
  337. X}
  338. X
  339. Xsub strbytes {
  340. X    local($_) = @_;
  341. X    @byt = ();
  342. X    while (length($_)) {
  343. X        s/^\\(\d\d\d)(.*)$/$2/ && do {
  344. X            push(byt,do pad($1 % 256));
  345. X            next; };
  346. X        s/^\\x([\da-fA-F][\da-fA-F])(.*)$/$2/ && do {
  347. X            push(byt,do pad(hex($1)));
  348. X            next; };
  349. X        s/^\\(.)(.*)$/$2/ && do {
  350. X            push(byt, do pad($specord{$1} || ord($1)));
  351. X            next; };
  352. X        s/^(.)(.*)$/$2/ && do {
  353. X            push(byt,do pad(ord($1)));
  354. X            next; };
  355. X    }
  356. X}
  357. X
  358. Xsub numbytes {
  359. X    local($_) = @_;
  360. X    @byt = ();
  361. X    foreach (split(//)) {
  362. X        /[0-9]/ && (push(byt,do pad(16+$_)),next);
  363. X        /[Ee]/  && (push(byt,do pad(27))   ,next);
  364. X        /-/     && (push(byt,do pad(28))   ,next);
  365. X        /\./    && (push(byt,do pad(26))   ,next);
  366. X        # note '+' are ignored
  367. X    }
  368. X}
  369. X
  370. Xsub defsym {
  371. X# Predefined user defined symbols
  372. X$defsymbol{'A'} = 102; $defsymbol{'B'} = 103;
  373. X$defsymbol{'C'} = 104; $defsymbol{'D'} = 105;
  374. X$defsymbol{'E'} = 106; $defsymbol{'F'} = 107;
  375. X$defsymbol{'G'} = 108; $defsymbol{'H'} = 109;
  376. X$defsymbol{'I'} = 110; $defsymbol{'J'} = 111;
  377. X$defsymbol{'T'} = 112; $defsymbol{'Z'} = 113;
  378. X$defsymbol{'Y'} = 114; $defsymbol{'X'} = 115;
  379. X$defsymbol{'L'} = 116; $defsymbol{'M'} = 117;
  380. X$defsymbol{'N'} = 118; $defsymbol{'O'} = 119;
  381. X$defsymbol{'P'} = 120; $defsymbol{'Q'} = 121;
  382. X$defsymbol{'R'} = 122; $defsymbol{'a'} = 123;
  383. X$defsymbol{'b'} = 124; $defsymbol{'c'} = 125;
  384. X$defsymbol{'d'} = 126; $defsymbol{'e'} = 127;
  385. X}
  386. X
  387. Xsub validarg {
  388. X    local($val) = @_;
  389. X    $val = $defsymbol{$val} if ($val =~ /^[A-Za-z]/);
  390. X    if ($val eq '') {
  391. X        $error = "Undefined symbol -- 000 assumed.";
  392. X        $val = "000";
  393. X    } elsif ($val < 0 || $val > 127) {
  394. X        $error = "Arg out of range -- taken mod 128.";
  395. X        $val %= 128;
  396. X    };
  397. X    $val;
  398. X}
  399. X
  400. Xsub asm {
  401. X    local($_) = @_;
  402. X    @byt = ();
  403. X    $error = '';
  404. X    /^\s*'([-+]?\d*\.?\d*([eE][-+]?\d*)?)'\s*(#.*)?$/ && do {
  405. X        do numbytes($1);
  406. X        unshift(byt,"000") if ++$lastnum;
  407. X        return; };
  408. X    $lastnum = $nulls;
  409. X    /^\s*"(([^"]*\\")*.*)"\s*(#.*)?$/ && do {
  410. X        do strbytes($1);
  411. X        if ($#byt > 14) {
  412. X            $error = "String too long -- truncated.";
  413. X            $#byt = 14;
  414. X        }
  415. X        unshift(byt,do pad(241+$#byt));
  416. X        return; };
  417. X    /^\s*END\s*(#.*)?$/ && do {
  418. X        @byt = ("192","000","009");
  419. X        return; };
  420. X    /^\s*XROM\s+(\d\d)\s+(\d\d)\s*(#.*)?$/ && do {
  421. X        @byt = (do pad(160+($1/4)), do pad(64*($1%4)+$2));
  422. X        return; };
  423. X    /^\s*(STO|RCL|LBL)\s+([A-Za-z]\w*|\d+)\s*(#.*)?$/ && do {
  424. X        ($op,$val) = ($1,do validarg($2));
  425. X        if (($op eq "LBL" && $val > 14) || $val > 15) {
  426. X            @byt = ($twobyte{$op},do pad($val));
  427. X        } elsif ($op eq "STO") {
  428. X            @byt = (do pad(48+$val));
  429. X        } elsif ($op eq "RCL") {
  430. X            @byt = (do pad(32+$val));
  431. X        } else { # $op = "LBL"
  432. X            @byt = (do pad(1+$val));
  433. X        };
  434. X        return; };
  435. X    /^\s*LBL\s+"(([^"]*\\")*.*)"\s*(#.*)?$/ && do {
  436. X        do strbytes($1);
  437. X        unshift(byt,"192","000",do pad(242+$#byt),"000");
  438. X        return; };
  439. X    /^\s*GTO\s+([A-Za-z]\w*|\d+)\s*(#.*)?$/ && do {
  440. X        $val = do validarg($1);
  441. X        if ($val > 14) {
  442. X            @byt = ("208","000",do pad($val));
  443. X        } else {
  444. X            @byt = (do pad(177+$val),"000");
  445. X        };
  446. X        return; };
  447. X    /^\s*GTO3\s+([A-Za-z]\w*|\d+)\s*(#.*)?$/ && do {
  448. X        $val = do validarg($1);
  449. X        @byt = ("208","000",do pad($val));
  450. X        return; };
  451. X    /^\s*XEQ\s+([A-Za-z]\w*|\d+)\s*(#.*)?$/ && do {
  452. X        $val = do validarg($1);
  453. X        @byt = ("224","000",do pad($val));
  454. X        return; };
  455. X    /^\s*(GTO|XEQ|W)\s+"(([^"]*\\")*.*)"\s*(#.*)?$/ && do {
  456. X        $op = (($1 eq "GTO") ? "029" : ($1 eq "W") ? "031" : "030");
  457. X        do strbytes($2);
  458. X        unshift(byt,$op,do pad(241+$#byt));
  459. X        return; };
  460. X    /^\s*(GTO|XEQ)\s+IND\s+([A-Za-z]\w*|\d+)\s*(#.*)?$/ && do {
  461. X        ($op,$val) = ($1,do validarg($2));
  462. X        @byt = ("174",do pad((($op eq "GTO")?0:128)+$val));
  463. X        return; };
  464. X    /^\s*BYTE\s+(\d+)\s*(#.*)?$/ && do {
  465. X        @byt = (do pad($1 % 256));
  466. X        return; };
  467. X    /^\s*([^'"#\s]+)\s+([A-Za-z]\w*|\d+)\s*(#.*)?$/ && do {
  468. X        $op = $twobyte{$1};
  469. X        $val = do validarg($2);
  470. X        unless ($op) {
  471. X            $error .= "Undefined OP code -- RCL assumed.";
  472. X            $op = "144";
  473. X        };
  474. X        @byt = ($twobyte{$1},do pad($val));
  475. X        return; };
  476. X    /^\s*([^'"#\s]+)\s+IND\s+([A-Za-z]\w*|\d+)\s*(#.*)?$/ && do {
  477. X        $op = $twobyte{$1};
  478. X        $val = do validarg($2);
  479. X        unless ($op) {
  480. X            $error .= "Undefined OP code -- RCL assumed.";
  481. X            $op = "144";
  482. X        };
  483. X        @byt = ($op,do pad(128+$val));
  484. X        return; };
  485. X    /^\s*([^'"#\s]+)\s*(#.*)?$/ && do {
  486. X        $op = $single{$1};
  487. X        unless ($op) {
  488. X            $op = $xrom{$1};
  489. X            unless ($op) {
  490. X            $error = "Undefined OP code -- NULL assumed.";
  491. X            $op = "000";
  492. X            };
  493. X        };
  494. X        @byt = ($op);
  495. X        return; };
  496. X    $error = "Syntax error.";
  497. X    $bytes = ''; # work around for join bug
  498. X    @byt = ();
  499. X}
  500. EEE_OOO_FFF
  501. echo x - asm41c
  502. sed -e 's/^X//' >bar41c <<'EEE_OOO_FFF'
  503. X#!/usr/local/bin/perl
  504. X
  505. X$width = 312;                   # 6.5i with 18pt bars (versitec)
  506. X$script_name = ARGV[0];         # save script name
  507. X
  508. Xwhile ($_ = $ARGV[0], /^-/) {
  509. X    shift;
  510. X    last if /^--$/;
  511. X    /^-w/ && do {           # specify output file
  512. X        die "$script_name: no arg for -w"
  513. X            unless ($ARGV[0]);
  514. X        die "$script_name: -w arg not numeric"
  515. X            unless ($ARGV[0] =~ /\d+/);
  516. X        $width = shift;
  517. X        next; };
  518. X    /^-t/ && do {           # specify bytes tabs on barcode lines
  519. X        ++$tags;
  520. X        next; };
  521. X    #default
  522. X    die "$script_name: unknown flag $_";
  523. X}
  524. X
  525. X@bpn = (0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4); # bits in a nibble
  526. X
  527. Xwhile (<>) {
  528. X    chop;
  529. X    $line = $_;
  530. X    /^title\s*(.*)$/ && do {        # title line
  531. X        print '.Tl "'.$1.'"\n';
  532. X        next; };
  533. X    /^program(\s+private)?\s+(.*)$/ && do { # process program
  534. X        do program($1,$2);
  535. X        next; };
  536. X    /^data\s+'([^']*)'\s*(.*)$/ && do { # numeric data
  537. X        do data($1,$2);
  538. X        next; };
  539. X    /^string(\s+append)?\s*(.*)$/ && do { # string data
  540. X        ($append,$text) = ($1,$2);
  541. X        $_ = <>;
  542. X        die "$script_name: illformed data line at line $.\n"
  543. X            unless (/^\d+(\s+\d+)*$/);
  544. X        @byt = split;
  545. X        unshift(@byt,($append?128:112)+$#byt+1);
  546. X        do checksum(0);
  547. X        do dumpbar($text,@byt);
  548. X        next; };
  549. X    /^bytes(\schecksum)?\s*(.*)$/ && do { # generic barcode data
  550. X        ($checksum,$text) = ($1,$2);
  551. X        $_ = <>;
  552. X        die "$script_name: illformed data line at line $.\n"
  553. X            unless (/^\d+(\s+\d+)*$/);
  554. X        @byt = split;
  555. X        do checksum(0) if $checksum;
  556. X        do dumpbar($text,@byt);
  557. X        next; };
  558. X    #default
  559. X    die "$script_name: no directive at line $.\n";
  560. X}
  561. Xexit 0;
  562. X
  563. X#
  564. X# end of main routine
  565. X#
  566. X
  567. Xsub pad {
  568. X    sprintf("%03d",pop(@_));        # pad number to 3 digits with zeros
  569. X}
  570. X
  571. Xsub checksum {                          # compute checksum with arg
  572. X    local($run) = @_;               # being running value and @byt
  573. X    local($i);                      # being the array of bytes then
  574. X    for $i (@byt) {                 # stuff check sum on front of byt
  575. X        $run = $run + $i;
  576. X        $run -= 255 if $run > 255;
  577. X    }                               # checksum is sum mod 265 with end
  578. X                    # around carry
  579. X    unshift(@byt,do pad($run));
  580. X}
  581. X
  582. Xsub dumpbar {
  583. X    local($i);
  584. X    print '.Sb "'.shift(@_)."\"\n"; # start bar code line
  585. X    for $i (@_) {
  586. X        print ".By ".do pad($i)."\n"; # dump each byte
  587. X    }
  588. X    print ".Eb",(($tags)?" 1\n":"\n"); # end barcode line
  589. X}
  590. X
  591. Xsub bytw {                              # width of byt array in bars
  592. X    local($width,$i) = (9,0);       # start and stop bar overhead
  593. X    for $i (@byt) {
  594. X        $width += (16 + $bpn[int($byte/16)] + $bpn[$byte%16]);
  595. X    }                               # narrow bar = 2, wide bar = 3
  596. X    return $width;
  597. X}
  598. X
  599. Xsub program {
  600. X    local($private,$text) = @_;
  601. X    print '.Pg "'.$text."\"\n";     # dump prog name
  602. X    @values = ();                   # bytes of code
  603. X    @inst_num = ();                 # 41c instruction numbers
  604. X    @f_orphs = ();                  # leading orphan bytes
  605. X    @b_orphs = ();                  # trailing orphan bytes
  606. X    $inst_cnt = 0;
  607. X    until ($_=<>,/^end/) {          # read in all of the program
  608. X        ++$inst_cnt;            # labeling each byte with
  609. X        @byt = split;           # instruction number,
  610. X        $b_orph = 0;            # leading and trailing
  611. X        $f_orph = $#byt+2;      # orphan counts
  612. X        for $_ (@byt) {
  613. X            push(@value,$_);
  614. X            push(@inst_num,$inst_cnt);
  615. X            push(@b_orphs,((++$b_orph>$#byt)?0:$b_orph));
  616. X            push(@f_orphs,(($f_orph-->$#byt+1)?0:$f_orph));
  617. X        }
  618. X    }
  619. X    $seq_num = 0;                   # sequence numbers
  620. X    $running = 0;                   # initial running checksum
  621. X    $line_num = 1;                  # number of barcode lines
  622. X    while($#value+1) {
  623. X        $trial_length = ($#value < 12 ? $#value : 12);
  624. X                    # assume full line 13 bytes
  625. X        $i = $#value;           # save length
  626. X        $#value = $trial_length; # pretend that value is that long
  627. X        @byt = @value;          # copy the front off
  628. X        $#value = $1;           # set length back
  629. X        loop: {
  630. X            unshift(@byt, $seq_num+16*($private?2:1),
  631. X                    # add seq number and prog type ...
  632. X            $f_orphs[0]*16+$b_orphs[$trial_length]);
  633. X                    # ... and orphan counts
  634. X            do checksum($running);
  635. X                    # compute checksum
  636. X            if (do bytw() > $width) {   # line to wide shorten by 1
  637. X            shift(@byt),shift(@byt),shift(@byt);
  638. X                    # remove front stuff
  639. X            pop(@byt);      # drop last byte
  640. X            --$trial_length;
  641. X            redo loop;      # and go put on new front stuff
  642. X            }
  643. X        }
  644. X        $text = sprintf("Line %d (%d - %d)",$line_num++,
  645. X            $inst_num[0],$inst_num[$trial_length]);
  646. X                    # barcode line label
  647. X        do dumpbar($text,@byt); # generate *roff output
  648. X        $running = shift(@byt); # save running checksum
  649. X        for ($i=0; $i<$trial_length; ++$i) {
  650. X            shift(@value);      # remove this barcode lines
  651. X            shift(@inst_num);   # bytes and labels
  652. X            shift(@f_orphs);    # fron arrays
  653. X            shift(@b_orphs);
  654. X        }
  655. X        $seq_num = ($seq_num==15?0:++$seqnum);
  656. X    }                               # inc seq num mod 16
  657. X}
  658. X
  659. Xsub data {
  660. X    local($_,$text) = @_;
  661. X    @digits = split(/.*/);          # split into single chars
  662. X    @nibbles = ();
  663. X    for $_ (@digits) {              # build nibble array
  664. X        /\d/ && (push(@nibbles,$_),next);
  665. X        /\./ && (push(@nibbles,11),next);
  666. X        /\+/ && (push(@nibbles,12),next);
  667. X        /-/  && (push(@nibbles,13),next);
  668. X        /[eE]/ && (push(@nibbles,14),next);
  669. X        /./  &&
  670. X             die "$script_name: illformed numeric data at line $.\n";
  671. X    }
  672. X    push(@nibbles,10)    if ($#nibbles % 2);  # make number nibbles even
  673. X    push(@nibbles,10,10) if ($#nibbles == 1); # must have at least 2 bytes
  674. X    @byt = (96+shift(@nibbles));              # generate header
  675. X    while ($#nibbles > 0) {
  676. X        $_ = shift(@nibbles);             # combine nibbles into bytes
  677. X        push(@byt,16*$_+shift(@nibbles));
  678. X    }
  679. X    do checksum(0);
  680. X    do dumpbar($text,@byt);         # dump barcode line
  681. X}
  682. EEE_OOO_FFF
  683. echo x - bar41c
  684. test -d doc || mkdir doc
  685. sed -e 's/^X//' >asm41c.l <<'EEE_OOO_FFF'{
  686. X.TH ASM41C 1 "Sep  7,1988"
  687. X.UC 4
  688. X.SH NAME
  689. Xasm41c \- HP 41c assembler
  690. X.SH SYNOPSIS
  691. X.B asm41c
  692. X[
  693. X.I options
  694. X] [ name ]
  695. X.SH DESCRIPTION
  696. X.I Asm41c
  697. Xassembles the named file, or the standard input if no file name is specified.
  698. XA file suitable for processing by
  699. X.B bar41c(1)
  700. Xis produced.
  701. XThe available flags are:
  702. X.TP
  703. X.B \-n
  704. XSpecifies that all numbers in programs are to be proceded by a zero
  705. Xbyte just as if the program had been entered via the 41c keyboard.
  706. XThe default action of the assembler is to not include zero bytes before
  707. Xnumbers unless they are necessary to separate two consecutive numbers.
  708. X.TP
  709. X.B \-r
  710. XSpecifies that the routine names and XROM codes for the named rom are
  711. Xloaded into the operator symbol table.
  712. X.TP
  713. X.B \-X
  714. XSpecifies that the XROM codes for the 41CX should be loaded.
  715. XThis is the same as specifing "\-r\ CXextfcn\ \-r\ CXtime"
  716. X.TP
  717. X.B \-I
  718. XSpecifies that the XROM codes for the IL interface loop rom should be
  719. Xloaded.
  720. XThis is the same as specifing
  721. X"\-r\ ILmass\ \-r\ ILprinter\ \-r\ ILcntl"
  722. X.TP
  723. X.B \-l
  724. XSpecifies that a listing is to be produced on stdout.
  725. XThe default is that error messages be produced on stderr.
  726. X.TP
  727. X.B \-t
  728. XSpecifies the title to be used on listings and barcode output.
  729. XThis may also be specified in the input using the ".title" directive.
  730. X.TP
  731. X.B -o
  732. XSpecifies the output barcode file name.
  733. XThe default is "bar.out".
  734. X.bp
  735. X.SH DIRECTIVES
  736. XAn input file for the assembler consists of a sequence of directives
  737. Xsome of which may be followed by a sequence of HP 41c assembler code.
  738. XBlank lines and comments are ignored.
  739. XComments are as in
  740. X.B sh ,
  741. Xthey start with a `#' character and continue to the end of the line.
  742. X.PP
  743. XThe directives are:
  744. X.TP
  745. X.B .rom \fR\fImodule
  746. X.br
  747. XThe entry points for the specifed rom are loaded into the operator
  748. Xsymbol table.
  749. XIf the file
  750. X.I module.rom
  751. Xis not found in the current directory, then a search is made of
  752. Xthe default rom library directory "/usr/local/lib/hprom".
  753. XThis directive has the same effect as the "-r" flag on the command
  754. Xline.
  755. XExample:
  756. X.sp 1
  757. X\&.rom wand
  758. X.sp 1
  759. XLoads the entry points for the barcode wand.
  760. X.sp 1
  761. XNote: if a rom module entry point has the same name as a builtin operator
  762. Xthen the builtin operator will hide the rom entry point.
  763. X.TP
  764. X.B .xrom \fR\fIname romnum entry
  765. X.br
  766. X.I Name
  767. Xis added to the operator symbol table as the rom module entry point
  768. Xspecified by the two numeric arguments
  769. X.I romnum
  770. Xand
  771. X.I entry .
  772. XThe numeric argument are the same numbers displayed by the 41c
  773. Xxrom operator when the rom module is not present in a 41c rom port.
  774. XThis directive may be used to define single rom module entry points when
  775. Xwhole rom is unneeded.
  776. X.TP
  777. X.B .title \fR\fItext
  778. X.br
  779. XAll of the text following on the line, but not including any comment,
  780. Xis used on subsequent pages of the listing as the listing title.
  781. XThis directive has the same effect as the "-t" flag on the command line.
  782. X.TP
  783. X.B .page
  784. X.br
  785. XCauses the start of a new page in the listing.
  786. X.TP
  787. X.B .define \fR\fIname value
  788. X.br
  789. XDefine a symbolic name for a register.
  790. X.I Value
  791. Xis either a number between 0 and 128 denoting a register or a previously
  792. Xdefined symbol. (Values greater then 99 denote the internal registers
  793. Xof the 41c and should only be used with care).
  794. XThe simple alpha labels A-Ja-eTZYXL and the synthetic register labels
  795. XMNOPQR (R being used instead of '|-') are predefined symbolic labels
  796. Xand their definitions may be redefined using this directive.
  797. X.TP
  798. X.B .prog \fR\fI[private] name
  799. X.br
  800. XStart the assembly of a program named
  801. X.I name .
  802. Xthe optional keyword
  803. X.I private
  804. Xspecifices the barcode produced sould be for a private program
  805. X(one that can not be listed by the 41c).
  806. Xthe following lines in the input are take to be 41c assembly instructions
  807. Xthat make up the program.
  808. XThe program ends at the end of the input or at the first following directive.
  809. XTHis means that and roms or defined symbols should be specified before the
  810. Xstart of the program.
  811. XSee the section below for a discription of the assembler instruction format.
  812. X.TP
  813. X.B .exec \fR\fItext
  814. X.br
  815. XThe following single line of 41c code is assembled and the barcode
  816. Xoutput is set up for an executable barcode line.
  817. XThe line of barcode is labeled with the text from the rest of the line.
  818. X.TP
  819. X.B .string \fR\fI[append] \"string\" text
  820. X.br
  821. XGenerate a string data barcode line labeled with the text.
  822. XThe optional
  823. X.I append
  824. Xkeyword specifies that the string data is to be append on to the alpha
  825. Xbuffer, otherwise the alpha buffer will be cleared when the barcode line
  826. Xis read.
  827. X.TP
  828. X.B .data \fR\fI'number' text
  829. X.br
  830. XGenerate a numeric data barcode line labeled with the text.
  831. X.TP
  832. X.B .bytes \fR\fI[checksum] bytes... text
  833. XGenerate a barcode line consisting of the specified decimal bytes
  834. Xlabeled with the text.
  835. XThe optional
  836. X.I checksum
  837. Xkeyword specifies that a checksum is to be computer and placed
  838. Xat the front of the barcode line.
  839. XThe directive can be used ot create arbitrary line of barcode such as the
  840. Xone and two byte paper keyboard lines.
  841. X.TP
  842. X.B ".clear rom"
  843. X.br
  844. XDelete all the rom entry points from the symbol table.
  845. X.TP
  846. X.B ".clear names"
  847. XDelete all the symbolic register names and restore the predefined
  848. Xsymbolic names.
  849. X.SH "ASSEMBLER CODES"
  850. XAll the 41c assembler code are just as they are displayed on the 41c except
  851. Xthat the greek sigma character has be replaced with the '~' character,
  852. Xthe arrow character has been relaced with the '}' charecter,
  853. Xthe not equal symbol has be replaced with the string '!=' and the
  854. Xangle character has been replaced with the string 'ANG' in the one place
  855. Xit was used so far (the advantage module).
  856. X.PP
  857. XStrings are enclosed in double quotes with the following escapes defined:
  858. X.sp 1
  859. X.nf
  860. X\&      \e-      append character
  861. X\&      \e=      not equals character
  862. X\&      \eS      Sigma (also can use '~')
  863. X\&      \eM      mu
  864. X\&      \eL      angle
  865. X\&      \eP      pi    (also can use '{')
  866. X\&      \eA      arrow (also can use '}')
  867. X\&      \eddd    decimal byte
  868. X\&      \exhh    hex byte
  869. X\&      \e"      double quote
  870. X\&      \e\e      backslash
  871. X.fi
  872. X.ad l
  873. X.PP
  874. XNumber are enclosed in single quotes (this is a hack to make parsing
  875. Xeasier).
  876. XShort form numbers are allowed (e.g. 'E', '-E4' etc.)
  877. X.PP
  878. XThe indirect indicator IND must be in all caps
  879. X.PP
  880. XBecause some of the operators have both short and long forms
  881. X(RCL STO GTO LBL),
  882. Xthe operators RCL2, STO2, GTO3 and LBL2 have been defined to
  883. Xforce the long form (RCL 0 assmebles to 032 while RCL2 0 assembles
  884. Xto 144 000.)
  885. XThe two spare two-byte operators are included as SPARE1 and SPARE2,
  886. Xand the W string operator is defined (not that these actually do anything
  887. Xusefull.)
  888. XThere is the operator "XROM\ dd,dd" and a special operator "BYTE\ ddd" that
  889. Xjust includes the value into the output.
  890. X.SH FILES
  891. X.ta 1.5i
  892. X/usr/local/lib/hprom directory where rom library is kept
  893. X\&.../builtins      file describing the builtin functions
  894. X.br
  895. X\&.../CXextfcn.rom  41CX builtin extended functions module
  896. X.br
  897. X\&.../CXtime.rom    41CX builtin time module
  898. X.br
  899. X\&.../ILcntl.rom    IL device control
  900. X.br
  901. X\&.../ILmass.rom    IL mass storage
  902. X.br
  903. X\&.../ILprinter.rom IL printer
  904. X.br
  905. X\&.../advantage.rom HP advantage module
  906. X.br
  907. X\&.../cardr.rom     card reader internal rom
  908. X.br
  909. X\&.../extfcn.rom    extended functions module
  910. X.br
  911. X\&.../games.rom     games rom
  912. X.br
  913. X\&.../math.rom      math rom
  914. X.br
  915. X\&.../ppc.rom       PPC club rom
  916. X.br
  917. X\&.../printer.rom   non-IL printer internal rom
  918. X.br
  919. X\&.../time.rom      time module
  920. X.br
  921. X\&.../wand.rom      barcode wand internal rom
  922. X.br
  923. Xbar.out           default barcode output file
  924. X.SH SEE ALSO
  925. Xbar41c(l)         barcode file to troff translator
  926. X.br
  927. XAuxiliary documentation:
  928. X.in +.5i
  929. X.br
  930. X.I "HP-41c Owners Manual."
  931. X.br
  932. X.I "Creating Your Own HP-41 Bar Code Manual. 82153-90019"
  933. X.br
  934. X.I "HP-41 Synthetic Programming Made Easy"
  935. Xby Keith Jarett.
  936. X.in -.5i
  937. X.SH AUTHORS
  938. XMark A. Biggar
  939. X.br
  940. Xsdcrdcf!markb
  941. X.br
  942. Xmarkb@rdcf.sm.unisys.com
  943. EEE_OOO_FFF
  944. echo x - doc/asm41c.l
  945. sed -e 's/^X//' >bar41c.l <<'EEE_OOO_FFF'
  946. X.TH BAR41C 1 "Sep  7,1988"
  947. X.UC 4
  948. X.SH NAME
  949. Xbar41c \- HP 41c barcode generator
  950. X.SH SYNOPSIS
  951. X.B bar41c
  952. X[
  953. X.I options
  954. X]
  955. X.SH DESCRIPTION
  956. X.I Bar41c
  957. Xis a filter that takes files like those produced by asm41c(1) and generates
  958. X*roff macros to print the barcodes.
  959. XThe available flags are:
  960. X.TP
  961. X.B \-w
  962. XThe integer argument specifies the maximun width of a program barcode line
  963. Xin narrow bar widths.
  964. XValue is used to fill out the line of program barcode to a given width.
  965. XThe default value of 312 is the equivlent to 6.5 inches using the versitec
  966. Xmacro set.
  967. XNarrow bars are half the width of wide bars and the spaces inbetween are
  968. Xthe same width as the narrow bars.
  969. XAs a line of barcode can not contain more then 16 bytes the maximum usefull
  970. Xvalue for -w is 456 (16 bytes * 8 bits * 3 bars (width of wide bar + space)
  971. X+ 9 (start and stop bars (3 narrow and 1 wide))).
  972. X.TP
  973. X.B \-t
  974. XSpecifies that byte tags are to be generated.
  975. XThe *roff macros will be called so that each byte in a line of barcode
  976. Xis labeled with its value.
  977. X.SH DIRECTIVES
  978. XAn input file for bar41c consists of a sequence of directives
  979. Xsome of which may be followed by a sequence of line of byte values.
  980. X.PP
  981. XThe directives are:
  982. X.TP
  983. X.B title /fR/fItext
  984. XThe
  985. X.I text
  986. Xis used as the argument for the .Tl macro.
  987. XThis directive has no other effect.
  988. X.TP
  989. X.B data \fR\fI'number' text
  990. XA numeric data barcode line type 6 is produced with
  991. X.I text
  992. Xas the barcode line's label.
  993. X.B string \fR\fI[append] text
  994. XA string data barcode line is produced with
  995. X.I text
  996. Xas its label.
  997. XIf the optional keyword
  998. X.I append
  999. Xis present then an append barcode line of type 8 is produced, otherwise
  1000. Xa normal string barcode line type 7 is produced.
  1001. XThe foolowing line in the input should be a single line of byte values
  1002. Xconsisting of the character values for the string data.
  1003. X.TP
  1004. X.B bytes \fR\fI[checksum] text
  1005. XA barcode line is produced using the following line of byte values
  1006. Xand using
  1007. X.I text
  1008. Xas the label.
  1009. XIf the optional keyword
  1010. X.I checksum
  1011. Xis present a checksum is first conputed and append on the front of the
  1012. Xlist of byte values.
  1013. XOnly the first 16 values (15 if a checksum is specified) are used,
  1014. Xothers are ignored.
  1015. X.TP
  1016. X.B program \fR\fI[private] name
  1017. XStart generating barcode line for the program
  1018. X.I name.
  1019. XThe following lines of byte values terminated by a line starting with
  1020. Xthe keyword "end" consist of the instructions for the program, one
  1021. Xinstruction per line (this is used to generate the instruction numbers
  1022. Xin the standard barcode line labels which look like "Line 1 (1 - 3)".)
  1023. XIf the optional keyword
  1024. X.I private
  1025. Xis used then program barcode line of type 2 (private) are produced,
  1026. Xotherwise type 1 is used.
  1027. X.SH FILES
  1028. X.ta 1.5i
  1029. Xtmac.vbar       macro file of Versitec raster printers
  1030. X.br
  1031. Xtmac.lwbar      macro file for Apple LaserWriter
  1032. X.SH SEE ALSO
  1033. Xasm41c(l)       Hp41c assembler
  1034. X.br
  1035. XAuxiliary documentation:
  1036. X.in +.5i
  1037. X.br
  1038. X.I "Creating Your Own HP-41 Bar Code Manual. 82153-90019"
  1039. X.in -.5i
  1040. X.SH BUGS
  1041. XThere is no provision made for the sequenced data barcode types
  1042. X(9, 10 & 11).
  1043. X.SH AUTHORS
  1044. XMark A. Biggar
  1045. X.br
  1046. Xsdcrdcf!markb
  1047. X.br
  1048. Xmarkb@rdcf.sm.unisys.com
  1049. EEE_OOO_FFF
  1050. echo x - doc/bar41c.l
  1051. test -d rom || mkdir rom
  1052. sed -e 's/^X//' >README <<'EEE_OOO_FFF'
  1053. XHow to build rom files:
  1054. X
  1055. Xrom file consist of line of perl script loading the $xrom associative
  1056. Xarray with the two bytes of assembled data coresponding to the
  1057. Xxrom call.  For example the file wand.rom looks like:
  1058. X
  1059. X$xrom{"WNDDTA"}  = "166 193";
  1060. X$xrom{"WNDDTX"}  = "166 194";
  1061. X$xrom{"WNDLNK"}  = "166 195";
  1062. X$xrom{"WNDSUB"}  = "166 196";
  1063. X$xrom{"WNDSCN"}  = "166 197";
  1064. X$xrom{"WNDTST"}  = "166 198";
  1065. X
  1066. XIn order to make generating these file easier a perl script is included
  1067. X(called trans) that will take files that look like:
  1068. X
  1069. XWNDDTA  27 1
  1070. XWNDDTX  27 2
  1071. XWNDLNK  27 3
  1072. XWNDSUB  27 4
  1073. XWNDSCN  27 5
  1074. XWNDTST  27 6
  1075. X
  1076. Xand generate a file like the above.  The numbers are the module number
  1077. Xand the routine number just as displayed by the HP 41c in the XROM op
  1078. Xwhen the module is not installed.
  1079. EEE_OOO_FFF
  1080. echo x - rom/README
  1081. sed -e 's/^X//' >builtins <<'EEE_OOO_FFF'
  1082. X$single{"NULL"}    = "000";
  1083. X$single{"+"}       = "064";
  1084. X$single{"-"}       = "065";
  1085. X$single{"*"}       = "066";
  1086. X$single{"/"}       = "067";
  1087. X$single{"X<Y?"}    = "068";
  1088. X$single{"X>Y?"}    = "069";
  1089. X$single{"X<=Y?"}   = "070";
  1090. X$single{"~+"}      = "071";
  1091. X$single{"~-"}      = "072";
  1092. X$single{"HMS+"}    = "073";
  1093. X$single{"HMS-"}    = "074";
  1094. X$single{"MOD"}     = "075";
  1095. X$single{"%"}       = "076";
  1096. X$single{"%CH"}     = "077";
  1097. X$single{"P}R"}     = "078";
  1098. X$single{"R}P"}     = "079";
  1099. X$single{"LN"}      = "080";
  1100. X$single{"X^2"}     = "081";
  1101. X$single{"SQRT"}    = "082";
  1102. X$single{"Y^X"}     = "083";
  1103. X$single{"CHS"}     = "084";
  1104. X$single{"E^X"}     = "085";
  1105. X$single{"LOG"}     = "086";
  1106. X$single{"10^X"}    = "087";
  1107. X$single{"E^X-1"}   = "088";
  1108. X$single{"SIN"}     = "089";
  1109. X$single{"COS"}     = "090";
  1110. X$single{"TAN"}     = "091";
  1111. X$single{"ASIN"}    = "092";
  1112. X$single{"ACOS"}    = "093";
  1113. X$single{"ATAN"}    = "094";
  1114. X$single{"}DEC"}    = "095";
  1115. X$single{"1/X"}     = "096";
  1116. X$single{"ABS"}     = "097";
  1117. X$single{"FACT"}    = "098";
  1118. X$single{"X!=0?"}   = "099";
  1119. X$single{"X>0?"}    = "100";
  1120. X$single{"LN1+X"}   = "101";
  1121. X$single{"X<0?"}    = "102";
  1122. X$single{"X=0?"}    = "103";
  1123. X$single{"INT"}     = "104";
  1124. X$single{"FRC"}     = "105";
  1125. X$single{"D}R"}     = "106";
  1126. X$single{"R}D"}     = "107";
  1127. X$single{"}HMS"}    = "108";
  1128. X$single{"}HR"}     = "109";
  1129. X$single{"RND"}     = "110";
  1130. X$single{"}OCT"}    = "111";
  1131. X$single{"CL+"}     = "112";
  1132. X$single{"X<>Y"}    = "113";
  1133. X$single{"PI"}      = "114";
  1134. X$single{"CLST"}    = "115";
  1135. X$single{"R^"}      = "116";
  1136. X$single{"RDN"}     = "117";
  1137. X$single{"LASTX"}   = "118";
  1138. X$single{"CLX"}     = "119";
  1139. X$single{"X=Y?"}    = "120";
  1140. X$single{"X!=Y?"}   = "121";
  1141. X$single{"SIGN"}    = "122";
  1142. X$single{"X<=0?"}   = "123";
  1143. X$single{"MEAN"}    = "124";
  1144. X$single{"SDEV"}    = "125";
  1145. X$single{"AVIEW"}   = "126";
  1146. X$single{"CLD"}     = "127";
  1147. X$single{"DEG"}     = "128";
  1148. X$single{"RAD"}     = "129";
  1149. X$single{"GRAD"}    = "130";
  1150. X$single{"ENTER^"}  = "131";
  1151. X$single{"STOP"}    = "132";
  1152. X$single{"RTN"}     = "133";
  1153. X$single{"BEEP"}    = "134";
  1154. X$single{"CLA"}     = "135";
  1155. X$single{"ASHF"}    = "136";
  1156. X$single{"PSE"}     = "137";
  1157. X$single{"CLRG"}    = "138";
  1158. X$single{"AOFF"}    = "139";
  1159. X$single{"AON"}     = "140";
  1160. X$single{"OFF"}     = "141";
  1161. X$single{"PROMPT"}  = "142";
  1162. X$single{"ADV"}     = "143";
  1163. X
  1164. X$twobyte{"RCL"}     = "144";
  1165. X$twobyte{"STO"}     = "145";
  1166. X$twobyte{"RCL2"}    = "144";
  1167. X$twobyte{"STO2"}    = "145";
  1168. X$twobyte{"ST+"}     = "146";
  1169. X$twobyte{"ST-"}     = "147";
  1170. X$twobyte{"ST*"}     = "148";
  1171. X$twobyte{"ST/"}     = "149";
  1172. X$twobyte{"ISG"}     = "150";
  1173. X$twobyte{"DSE"}     = "151";
  1174. X$twobyte{"VIEW"}    = "152";
  1175. X$twobyte{"~REG"}    = "153";
  1176. X$twobyte{"ASTO"}    = "154";
  1177. X$twobyte{"ARCL"}    = "155";
  1178. X$twobyte{"FIX"}     = "156";
  1179. X$twobyte{"SCI"}     = "157";
  1180. X$twobyte{"ENG"}     = "158";
  1181. X$twobyte{"TONE"}    = "159";
  1182. X$twobyte{"SF"}      = "168";
  1183. X$twobyte{"CF"}      = "169";
  1184. X$twobyte{"FS?C"}    = "170";
  1185. X$twobyte{"FC?C"}    = "171";
  1186. X$twobyte{"FS?"}     = "172";
  1187. X$twobyte{"FC?"}     = "173";
  1188. X$twobyte{"SPARE1"}  = "175";
  1189. X$twobyte{"SPARE2"}  = "176";
  1190. X$twobyte{"X<>"}     = "206";
  1191. X$twobyte{"LBL2"}    = "207";
  1192. EEE_OOO_FFF
  1193. echo x - rom/builtins
  1194. sed -e 's/^X//' >trans <<'EEE_OOO_FFF'
  1195. X#! /usr/local/bin/perl -i
  1196. X
  1197. Xwhile (<>) {
  1198. X    next if /^\s*#/;                # ignore comments
  1199. X    /([^ ]+) *([0-9]+) *([0-9]+)/;
  1200. X    print sprintf("%-16s = \"%03d %03d\";\n",
  1201. X               "\$xrom{\"$1\"}", 160+($2/4), 64*($2%4)+$3);
  1202. X}
  1203. EEE_OOO_FFF
  1204. echo x - rom/trans
  1205. sed -e 's/^X//' >CXextfcn.rom <<'EEE_OOO_FFF'
  1206. X$xrom{"ALENG"}   = "166 065";
  1207. X$xrom{"ANUM"}    = "166 066";
  1208. X$xrom{"APPCHR"}  = "166 067";
  1209. X$xrom{"APPREC"}  = "166 068";
  1210. X$xrom{"ARCLREC"} = "166 069";
  1211. X$xrom{"AROT"}    = "166 070";
  1212. X$xrom{"ATOX"}    = "166 071";
  1213. X$xrom{"CLFL"}    = "166 072";
  1214. X$xrom{"CLKEYS"}  = "166 073";
  1215. X$xrom{"CRFLAS"}  = "166 074";
  1216. X$xrom{"CRFLD"}   = "166 075";
  1217. X$xrom{"DELCHR"}  = "166 076";
  1218. X$xrom{"DELREC"}  = "166 077";
  1219. X$xrom{"EMDIR"}   = "166 078";
  1220. X$xrom{"FLSIZE"}  = "166 079";
  1221. X$xrom{"GETAS"}   = "166 080";
  1222. X$xrom{"GETKEY"}  = "166 081";
  1223. X$xrom{"GETP"}    = "166 082";
  1224. X$xrom{"GETR"}    = "166 083";
  1225. X$xrom{"GETREC"}  = "166 084";
  1226. X$xrom{"GETRX"}   = "166 085";
  1227. X$xrom{"GETSUB"}  = "166 086";
  1228. X$xrom{"GETX"}    = "166 087";
  1229. X$xrom{"INSCHR"}  = "166 088";
  1230. X$xrom{"INSREC"}  = "166 089";
  1231. X$xrom{"PASN"}    = "166 090";
  1232. X$xrom{"PCLPS"}   = "166 091";
  1233. X$xrom{"POSA"}    = "166 092";
  1234. X$xrom{"POSFL"}   = "166 093";
  1235. X$xrom{"PSIZE"}   = "166 094";
  1236. X$xrom{"PURFL"}   = "166 095";
  1237. X$xrom{"RCLFLAG"} = "166 096";
  1238. X$xrom{"RCLPT"}   = "166 097";
  1239. X$xrom{"RCLPTA"}  = "166 098";
  1240. X$xrom{"REGMOVE"} = "166 099";
  1241. X$xrom{"REGSWAP"} = "166 100";
  1242. X$xrom{"SAVEAS"}  = "166 101";
  1243. X$xrom{"SAVEP"}   = "166 102";
  1244. X$xrom{"SAVER"}   = "166 103";
  1245. X$xrom{"SAVERX"}  = "166 104";
  1246. X$xrom{"SAVEX"}   = "166 105";
  1247. X$xrom{"SEEKPT"}  = "166 106";
  1248. X$xrom{"SEEKPTA"} = "166 107";
  1249. X$xrom{"SIZE?"}   = "166 108";
  1250. X$xrom{"STOFLAG"} = "166 109";
  1251. X$xrom{"X<>F"}    = "166 110";
  1252. X$xrom{"XTOA"}    = "166 111";
  1253. X$xrom{"ASROOM"}  = "166 113";
  1254. X$xrom{"CLRGX"}   = "166 114";
  1255. X$xrom{"ED"}      = "166 115";
  1256. X$xrom{"EMDIRX"}  = "166 116";
  1257. X$xrom{"EMROOM"}  = "166 117";
  1258. X$xrom{"GETKEYX"} = "166 118";
  1259. X$xrom{"RESZFL"}  = "166 119";
  1260. X$xrom{"~REG?"} = "166 120";
  1261. X$xrom{"X=NN?"}   = "166 121";
  1262. X$xrom{"X!=NN?"}  = "166 122";
  1263. X$xrom{"X<NN?"}   = "166 123";
  1264. X$xrom{"X<=NN?"}  = "166 124";
  1265. X$xrom{"X>NN?"}   = "166 125";
  1266. X$xrom{"X>=NN?"}  = "166 126";
  1267. EEE_OOO_FFF
  1268. echo x - rom/CXextfcn.rom
  1269. sed -e 's/^X//' >CXtime.rom <<'EEE_OOO_FFF'
  1270. X$xrom{"ADATE"}   = "166 129";
  1271. X$xrom{"ALMCAT"}  = "166 130";
  1272. X$xrom{"ALMNOW"}  = "166 131";
  1273. X$xrom{"ATIME"}   = "166 132";
  1274. X$xrom{"ATIME24"} = "166 133";
  1275. X$xrom{"CLK12"}   = "166 134";
  1276. X$xrom{"CLK24"}   = "166 135";
  1277. X$xrom{"CLKT"}    = "166 136";
  1278. X$xrom{"CLKTD"}   = "166 137";
  1279. X$xrom{"CLOCK"}   = "166 138";
  1280. X$xrom{"CORRECT"} = "166 139";
  1281. X$xrom{"DATE"}    = "166 140";
  1282. X$xrom{"DATE+"}   = "166 141";
  1283. X$xrom{"DDAYS"}   = "166 142";
  1284. X$xrom{"DMY"}     = "166 143";
  1285. X$xrom{"DOW"}     = "166 144";
  1286. X$xrom{"MDY"}     = "166 145";
  1287. X$xrom{"RCLAF"}   = "166 146";
  1288. X$xrom{"RCLSW"}   = "166 147";
  1289. X$xrom{"RUNSW"}   = "166 148";
  1290. X$xrom{"SETAF"}   = "166 149";
  1291. X$xrom{"SETDATE"} = "166 150";
  1292. X$xrom{"SETSW"}   = "166 151";
  1293. X$xrom{"STOPSW"}  = "166 152";
  1294. X$xrom{"SW"}      = "166 153";
  1295. X$xrom{"T+X"}     = "166 154";
  1296. X$xrom{"TIME"}    = "166 155";
  1297. X$xrom{"XYZALM"}  = "166 156";
  1298. X$xrom{"CLALMA"}  = "166 159";
  1299. X$xrom{"CLALMX"}  = "166 160";
  1300. X$xrom{"CLRALMS"} = "166 161";
  1301. X$xrom{"RCLALM"}  = "166 162";
  1302. X$xrom{"SWPT"}    = "166 163";
  1303. EEE_OOO_FFF
  1304. echo x - rom/CXtime.rom
  1305. sed -e 's/^X//' >ILcntl.rom <<'EEE_OOO_FFF'
  1306. X$xrom{"AUTOIO"}  = "167 027";
  1307. X$xrom{"FINDID"}  = "167 028";
  1308. X$xrom{"INA"}     = "167 029";
  1309. X$xrom{"IND"}     = "167 030";
  1310. X$xrom{"INSTAT"}  = "167 031";
  1311. X$xrom{"LISTEN"}  = "167 032";
  1312. X$xrom{"LOCAL"}   = "167 033";
  1313. X$xrom{"MANIO"}   = "167 034";
  1314. X$xrom{"OUTA"}    = "167 035";
  1315. X$xrom{"PWRDN"}   = "167 036";
  1316. X$xrom{"PWRUP"}   = "167 037";
  1317. X$xrom{"REMOTE"}  = "167 038";
  1318. X$xrom{"SELECT"}  = "167 039";
  1319. X$xrom{"STOPIO"}  = "167 040";
  1320. X$xrom{"TRIGGER"} = "167 041";
  1321. EEE_OOO_FFF
  1322. echo x - rom/ILcntl.rom
  1323. sed -e 's/^X//' >ILmass.rom <<'EEE_OOO_FFF'
  1324. X$xrom{"CREATE"}  = "167 001";
  1325. X$xrom{"DIR"}     = "167 002";
  1326. X$xrom{"NEWM"}    = "167 003";
  1327. X$xrom{"PURGE"}   = "167 004";
  1328. X$xrom{"READA"}   = "167 005";
  1329. X$xrom{"READK"}   = "167 006";
  1330. X$xrom{"READP"}   = "167 007";
  1331. X$xrom{"READR"}   = "167 008";
  1332. X$xrom{"READRX"}  = "167 009";
  1333. X$xrom{"READS"}   = "167 010";
  1334. X$xrom{"READSUB"} = "167 011";
  1335. X$xrom{"RENAME"}  = "167 012";
  1336. X$xrom{"SEC"}     = "167 013";
  1337. X$xrom{"SEEKR"}   = "167 014";
  1338. X$xrom{"UNSEC"}   = "167 015";
  1339. X$xrom{"VERIFY"}  = "167 016";
  1340. X$xrom{"WRTA"}    = "167 017";
  1341. X$xrom{"WRTK"}    = "167 018";
  1342. X$xrom{"WRTP"}    = "167 019";
  1343. X$xrom{"WRTPV"}   = "167 020";
  1344. X$xrom{"WRTR"}    = "167 021";
  1345. X$xrom{"WRTRX"}   = "167 022";
  1346. X$xrom{"WRTS"}    = "167 023";
  1347. X$xrom{"ZERO"}    = "167 024";
  1348. EEE_OOO_FFF
  1349. echo x - rom/ILmass.rom
  1350. sed -e 's/^X//' >ILprinter.rom <<'EEE_OOO_FFF'
  1351. X$xrom{"ACA"}     = "167 065";
  1352. X$xrom{"ACCHR"}   = "167 066";
  1353. X$xrom{"ACCOL"}   = "167 067";
  1354. X$xrom{"ACSPEC"}  = "167 068";
  1355. X$xrom{"ACX"}     = "167 069";
  1356. X$xrom{"BLDSPEC"} = "167 070";
  1357. X$xrom{"LIST"}    = "167 071";
  1358. X$xrom{"PRA"}     = "167 072";
  1359. X$xrom{"PRAXIS"}  = "167 073";
  1360. X$xrom{"PRBUF"}   = "167 074";
  1361. X$xrom{"PRFLAGS"} = "167 075";
  1362. X$xrom{"PRKEYS"}  = "167 076";
  1363. X$xrom{"PRP"}     = "167 077";
  1364. X$xrom{"PRPLOT"}  = "167 078";
  1365. X$xrom{"PRPLOTP"} = "167 079";
  1366. X$xrom{"PRREG"}   = "167 080";
  1367. X$xrom{"PRREGX"}  = "167 081";
  1368. X$xrom{"PR~"}     = "167 082";
  1369. X$xrom{"PRSTK"}   = "167 083";
  1370. X$xrom{"PRX"}     = "167 084";
  1371. X$xrom{"REGPLOT"} = "167 085";
  1372. X$xrom{"SKPCHR"}  = "167 086";
  1373. X$xrom{"SKPCOL"}  = "167 087";
  1374. X$xrom{"STKPLOT"} = "167 088";
  1375. X$xrom{"FMT"}     = "167 089";
  1376. EEE_OOO_FFF
  1377. echo x - rom/ILprinter.rom
  1378. sed -e 's/^X//' >advantage.rom <<'EEE_OOO_FFF'
  1379. X$xrom{"BININ"}   = "165 129";
  1380. X$xrom{"BINVIEW"} = "165 130";
  1381. X$xrom{"OCTIN"}   = "165 131";
  1382. X$xrom{"CVTVIEW"} = "165 132";
  1383. X$xrom{"HEXIN"}   = "165 133";
  1384. X$xrom{"HEXVIEW"} = "165 134";
  1385. X$xrom{"NOT"}     = "165 135";
  1386. X$xrom{"AND"}     = "165 136";
  1387. X$xrom{"OR"}      = "165 137";
  1388. X$xrom{"XOR"}     = "165 138";
  1389. X$xrom{"ROTXY"}   = "165 139";
  1390. X$xrom{"BIT?"}    = "165 140";
  1391. X$xrom{"C<>C"}    = "165 142";
  1392. X$xrom{"CMAXAB"}  = "165 143";
  1393. X$xrom{"CNRM"}    = "165 144";
  1394. X$xrom{"CSUM"}    = "165 145";
  1395. X$xrom{"DIM?"}    = "165 146";
  1396. X$xrom{"FNRM"}    = "165 147";
  1397. X$xrom{"I+"}      = "165 148";
  1398. X$xrom{"I-"}      = "165 149";
  1399. X$xrom{"J+"}      = "165 150";
  1400. X$xrom{"J-"}      = "165 151";
  1401. X$xrom{"M*M"}     = "165 152";
  1402. X$xrom{"MAT*"}    = "165 153";
  1403. X$xrom{"MAT+"}    = "165 154";
  1404. X$xrom{"MAT-"}    = "165 155";
  1405. X$xrom{"MAT/"}    = "165 156";
  1406. X$xrom{"MATDIM"}  = "165 157";
  1407. X$xrom{"MAX"}     = "165 158";
  1408. X$xrom{"MAXAB"}   = "165 159";
  1409. X$xrom{"MDET"}    = "165 160";
  1410. X$xrom{"MIN"}     = "165 161";
  1411. X$xrom{"MINV"}    = "165 162";
  1412. X$xrom{"MMOVE"}   = "165 163";
  1413. X$xrom{"MNAME?"}  = "165 164";
  1414. X$xrom{"MR"}      = "165 165";
  1415. X$xrom{"MRC+"}    = "165 166";
  1416. X$xrom{"MRC-"}    = "165 167";
  1417. X$xrom{"MRIJ"}    = "165 168";
  1418. X$xrom{"MRIJR"}   = "165 169";
  1419. X$xrom{"MRR+"}    = "165 170";
  1420. X$xrom{"MRR-"}    = "165 171";
  1421. X$xrom{"MS"}      = "165 172";
  1422. X$xrom{"MSC+"}    = "165 173";
  1423. X$xrom{"MSIJ"}    = "165 174";
  1424. X$xrom{"MSIJR"}   = "165 175";
  1425. X$xrom{"MSR+"}    = "165 176";
  1426. X$xrom{"MSWAP"}   = "165 177";
  1427. X$xrom{"MSVS"}    = "165 178";
  1428. X$xrom{"PIV"}     = "165 179";
  1429. X$xrom{"R<>R"}    = "165 180";
  1430. X$xrom{"R>R?"}    = "165 181";
  1431. X$xrom{"RMAXAB"}  = "165 182";
  1432. X$xrom{"RNRM"}    = "165 183";
  1433. X$xrom{"RSUM"}    = "165 184";
  1434. X$xrom{"SUM"}     = "165 185";
  1435. X$xrom{"SUMAB"}   = "165 186";
  1436. X$xrom{"TRNPS"}   = "165 187";
  1437. X$xrom{"YC+C"}    = "165 188";
  1438. X$xrom{"MEDIT"}   = "165 189";
  1439. X$xrom{"CMEDIT"}  = "165 190";
  1440. X$xrom{"MP"}      = "165 191";
  1441. X$xrom{"MATRX"}   = "165 192";
  1442. X$xrom{"MTR"}     = "166 001";
  1443. X$xrom{"SOLVE"}   = "166 003";
  1444. X$xrom{"INTEG"}   = "166 004";
  1445. X$xrom{"SILOOP"}  = "166 005";
  1446. X$xrom{"SIRIN"}   = "166 006";
  1447. X$xrom{"Z^N"}     = "166 007";
  1448. X$xrom{"MAGZ"}    = "166 008";
  1449. X$xrom{"e^Z"}     = "166 009";
  1450. X$xrom{"LNZ"}     = "166 010";
  1451. X$xrom{"Z^1/N"}   = "166 011";
  1452. X$xrom{"SINZ"}    = "166 012";
  1453. X$xrom{"COSZ"}    = "166 013";
  1454. X$xrom{"TANZ"}    = "166 014";
  1455. X$xrom{"a^Z"}     = "166 015";
  1456. X$xrom{"LOGZ"}    = "166 016";
  1457. X$xrom{"Z^1/W"}   = "166 017";
  1458. X$xrom{"Z^W"}     = "166 018";
  1459. X$xrom{"C+"}      = "166 019";
  1460. X$xrom{"C-"}      = "166 020";
  1461. X$xrom{"CINV"}    = "166 021";
  1462. X$xrom{"C*"}      = "166 022";
  1463. X$xrom{"C/"}      = "166 023";
  1464. X$xrom{"PLV"}     = "166 024";
  1465. X$xrom{"RIS"}     = "166 025";
  1466. X$xrom{"DIFEQ"}   = "166 026";
  1467. X$xrom{"CFIT"}    = "166 027";
  1468. X$xrom{"ASIG"}    = "166 028";
  1469. X$xrom{"DSIG"}    = "166 029";
  1470. X$xrom{"CFIT"}    = "166 030";
  1471. X$xrom{"FIT"}     = "166 031";
  1472. X$xrom{"Y?X"}     = "166 032";
  1473. X$xrom{"SZ?"}     = "166 033";
  1474. X$xrom{"VC"}      = "166 034";
  1475. X$xrom{"CROSS"}   = "166 035";
  1476. X$xrom{"VS"}      = "166 036";
  1477. X$xrom{"VR"}      = "166 037";
  1478. X$xrom{"DOT"}     = "166 038";
  1479. X$xrom{"VE"}      = "166 039";
  1480. X$xrom{"V-"}      = "166 040";
  1481. X$xrom{"V+"}      = "166 041";
  1482. X$xrom{"VXY"}     = "166 042";
  1483. X$xrom{"UV"}      = "166 043";
  1484. X$xrom{"VANG"}    = "166 044";
  1485. X$xrom{"VD"}      = "166 045";
  1486. X$xrom{"V*"}      = "166 046";
  1487. X$xrom{"TR"}      = "166 047";
  1488. X$xrom{"CT"}      = "166 048";
  1489. X$xrom{"AIP"}     = "166 049";
  1490. X$xrom{"TVM"}     = "166 051";
  1491. X$xrom{"N"}       = "166 052";
  1492. X$xrom{"PV"}      = "166 053";
  1493. X$xrom{"PMT"}     = "166 054";
  1494. X$xrom{"FV"}      = "166 055";
  1495. X$xrom{"*I"}      = "166 056";
  1496. EEE_OOO_FFF
  1497. echo x - rom/advantage.rom
  1498. sed -e 's/^X//' >cardr.rom <<'EEE_OOO_FFF'
  1499. X$xrom{"MRG"}     = "167 129";
  1500. X$xrom{"RDTA"}    = "167 130";
  1501. X$xrom{"RDTAX"}   = "167 131";
  1502. X$xrom{"RSUB"}    = "167 132";
  1503. X$xrom{"VER"}     = "167 133";
  1504. X$xrom{"WALL"}    = "167 134";
  1505. X$xrom{"WDTA"}    = "167 135";
  1506. X$xrom{"WDTAX"}   = "167 136";
  1507. X$xrom{"WPRV"}    = "167 137";
  1508. X$xrom{"WSTS"}    = "167 138";
  1509. EEE_OOO_FFF
  1510. echo x - rom/cardr.rom
  1511. sed -e 's/^X//' >extfcn.rom <<'EEE_OOO_FFF'
  1512. X$xrom{"ALENG"}   = "166 065";
  1513. X$xrom{"ANUM"}    = "166 066";
  1514. X$xrom{"APPCHR"}  = "166 067";
  1515. X$xrom{"APPREC"}  = "166 068";
  1516. X$xrom{"ARCLREC"} = "166 069";
  1517. X$xrom{"AROT"}    = "166 070";
  1518. X$xrom{"ATOX"}    = "166 071";
  1519. X$xrom{"CLFL"}    = "166 072";
  1520. X$xrom{"CLKEYS"}  = "166 073";
  1521. X$xrom{"CRFLAS"}  = "166 074";
  1522. X$xrom{"CRFLD"}   = "166 075";
  1523. X$xrom{"DELCHR"}  = "166 076";
  1524. X$xrom{"DELREC"}  = "166 077";
  1525. X$xrom{"EMDIR"}   = "166 078";
  1526. X$xrom{"FLSIZE"}  = "166 079";
  1527. X$xrom{"GETAS"}   = "166 080";
  1528. X$xrom{"GETKEY"}  = "166 081";
  1529. X$xrom{"GETP"}    = "166 082";
  1530. X$xrom{"GETR"}    = "166 083";
  1531. X$xrom{"GETREC"}  = "166 084";
  1532. X$xrom{"GETRX"}   = "166 085";
  1533. X$xrom{"GETSUB"}  = "166 086";
  1534. X$xrom{"GETX"}    = "166 087";
  1535. X$xrom{"INSCHR"}  = "166 088";
  1536. X$xrom{"INSREC"}  = "166 089";
  1537. X$xrom{"PASN"}    = "166 090";
  1538. X$xrom{"PCLPS"}   = "166 091";
  1539. X$xrom{"POSA"}    = "166 092";
  1540. X$xrom{"POSFL"}   = "166 093";
  1541. X$xrom{"PSIZE"}   = "166 094";
  1542. X$xrom{"PURFL"}   = "166 095";
  1543. X$xrom{"RCLFLAG"} = "166 096";
  1544. X$xrom{"RCLPT"}   = "166 097";
  1545. X$xrom{"RCLPTA"}  = "166 098";
  1546. X$xrom{"REGMOVE"} = "166 099";
  1547. X$xrom{"REGSWAP"} = "166 100";
  1548. X$xrom{"SAVEAS"}  = "166 101";
  1549. X$xrom{"SAVEP"}   = "166 102";
  1550. X$xrom{"SAVER"}   = "166 103";
  1551. X$xrom{"SAVERX"}  = "166 104";
  1552. X$xrom{"SAVEX"}   = "166 105";
  1553. X$xrom{"SEEKPT"}  = "166 106";
  1554. X$xrom{"SEEKPTA"} = "166 107";
  1555. X$xrom{"SIZE?"}   = "166 108";
  1556. X$xrom{"STOFLAG"} = "166 109";
  1557. X$xrom{"X<>F"}    = "166 110";
  1558. X$xrom{"XTOA"}    = "166 111";
  1559. EEE_OOO_FFF
  1560. echo x - rom/extfcn.rom
  1561. sed -e 's/^X//' >games.rom <<'EEE_OOO_FFF'
  1562. X$xrom{"BAGELS"}  = "162 129";
  1563. X$xrom{"BIOR"}    = "162 130";
  1564. X$xrom{"BIOF"}    = "162 131";
  1565. X$xrom{"CRAPS"}   = "162 132";
  1566. X$xrom{"HANG"}    = "162 133";
  1567. X$xrom{"PINBALL"} = "162 134";
  1568. X$xrom{"SWAR"}    = "162 135";
  1569. X$xrom{"SUBHUNT"} = "162 136";
  1570. X$xrom{"BOOM"}    = "162 137";
  1571. X$xrom{"INI"}     = "162 138";
  1572. X$xrom{"P"}       = "162 139";
  1573. X$xrom{"SIZE?"}   = "162 140";
  1574. X$xrom{"RNDM"}    = "162 141";
  1575. X$xrom{"RNDMW"}   = "162 142";
  1576. EEE_OOO_FFF
  1577. echo x - rom/games.rom
  1578. sed -e 's/^X//' >math.rom <<'EEE_OOO_FFF'
  1579. X$xrom{"MATRIX"}  = "160 065";
  1580. X$xrom{"SIMEQ"}   = "160 066";
  1581. X$xrom{"VCOL"}    = "160 067";
  1582. X$xrom{"VMAT"}    = "160 068";
  1583. X$xrom{"PVT"}     = "160 069";
  1584. X$xrom{"DET"}     = "160 070";
  1585. X$xrom{"INV"}     = "160 071";
  1586. X$xrom{"EDIT"}    = "160 072";
  1587. X$xrom{"SOLVE"}   = "160 073";
  1588. X$xrom{"SOL"}     = "160 074";
  1589. X$xrom{"POLY"}    = "160 075";
  1590. X$xrom{"ROOTS"}   = "160 076";
  1591. X$xrom{"INTG"}    = "160 077";
  1592. X$xrom{"DIFEQ"}   = "160 078";
  1593. X$xrom{"FOUR"}    = "160 079";
  1594. X$xrom{"C+"}      = "160 080";
  1595. X$xrom{"C-"}      = "160 081";
  1596. X$xrom{"C*"}      = "160 082";
  1597. X$xrom{"C/"}      = "160 083";
  1598. X$xrom{"MAGZ"}    = "160 084";
  1599. X$xrom{"CINV"}    = "160 085";
  1600. X$xrom{"Z^N"}     = "160 086";
  1601. X$xrom{"Z^1/N"}   = "160 087";
  1602. X$xrom{"E^Z"}     = "160 088";
  1603. X$xrom{"LNZ"}     = "160 089";
  1604. X$xrom{"A^Z"}     = "160 090";
  1605. X$xrom{"LOGZ"}    = "160 091";
  1606. X$xrom{"Z^W"}     = "160 092";
  1607. X$xrom{"Z^1/W"}   = "160 093";
  1608. X$xrom{"SINZ"}    = "160 094";
  1609. X$xrom{"COSZ"}    = "160 095";
  1610. X$xrom{"TANZ"}    = "160 096";
  1611. X$xrom{"SINH"}    = "160 097";
  1612. X$xrom{"COSH"}    = "160 098";
  1613. X$xrom{"TANH"}    = "160 099";
  1614. X$xrom{"ASINH"}   = "160 100";
  1615. X$xrom{"ACOSH"}   = "160 101";
  1616. X$xrom{"ATANH"}   = "160 102";
  1617. X$xrom{"SSS"}     = "160 103";
  1618. X$xrom{"ASA"}     = "160 104";
  1619. X$xrom{"SAA"}     = "160 105";
  1620. X$xrom{"SAS"}     = "160 106";
  1621. X$xrom{"SSA"}     = "160 107";
  1622. X$xrom{"TRANS"}   = "160 108";
  1623. X$xrom{"*FN"}     = "160 109";
  1624. EEE_OOO_FFF
  1625. echo x - rom/math.rom
  1626. sed -e 's/^X//' >ppc.rom <<'EEE_OOO_FFF'
  1627. X$xrom{"+K"}      = "162 131";
  1628. X$xrom{"-B"}      = "162 152";
  1629. X$xrom{"1K"}      = "162 130";
  1630. X$xrom{"2D"}      = "162 183";
  1631. X$xrom{"A?"}      = "162 138";
  1632. X$xrom{"AB"}      = "162 189";
  1633. X$xrom{"AD"}      = "162 146";
  1634. X$xrom{"AL"}      = "162 165";
  1635. X$xrom{"AM"}      = "165 053";
  1636. X$xrom{"BA"}      = "165 030";
  1637. X$xrom{"BC"}      = "165 043";
  1638. X$xrom{"BD"}      = "165 017";
  1639. X$xrom{"BE"}      = "165 034";
  1640. X$xrom{"BI"}      = "162 172";
  1641. X$xrom{"BL"}      = "162 170";
  1642. X$xrom{"BM"}      = "165 039";
  1643. X$xrom{"BR"}      = "165 040";
  1644. X$xrom{"B+"}      = "165 042";
  1645. X$xrom{"BV"}      = "165 007";
  1646. X$xrom{"BX"}      = "165 041";
  1647. X$xrom{"C?"}      = "162 144";
  1648. X$xrom{"CA"}      = "165 023";
  1649. X$xrom{"CB"}      = "162 178";
  1650. X$xrom{"CD"}      = "162 163";
  1651. X$xrom{"CJ"}      = "165 021";
  1652. X$xrom{"CK"}      = "162 134";
  1653. X$xrom{"CM"}      = "165 020";
  1654. X$xrom{"CP"}      = "165 027";
  1655. X$xrom{"CU"}      = "162 162";
  1656. X$xrom{"CV"}      = "165 008";
  1657. X$xrom{"CX"}      = "162 161";
  1658. X$xrom{"DC"}      = "162 139";
  1659. X$xrom{"DF"}      = "165 013";
  1660. X$xrom{"DP"}      = "162 181";
  1661. X$xrom{"DR"}      = "165 038";
  1662. X$xrom{"DS"}      = "162 157";
  1663. X$xrom{"DT"}      = "162 145";
  1664. X$xrom{"E?"}      = "162 190";
  1665. X$xrom{"EP"}      = "162 159";
  1666. X$xrom{"EX"}      = "162 155";
  1667. X$xrom{"F?"}      = "162 132";
  1668. X$xrom{"FD"}      = "165 011";
  1669. X$xrom{"FI"}      = "162 191";
  1670. X$xrom{"FL"}      = "162 171";
  1671. X$xrom{"FR"}      = "165 012";
  1672. X$xrom{"GE"}      = "162 188";
  1673. X$xrom{"GN"}      = "165 015";
  1674. X$xrom{"HA"}      = "165 025";
  1675. X$xrom{"HD"}      = "162 148";
  1676. X$xrom{"HN"}      = "162 169";
  1677. X$xrom{"HP"}      = "165 029";
  1678. X$xrom{"HS"}      = "165 026";
  1679. X$xrom{"IF"}      = "162 177";
  1680. X$xrom{"IG"}      = "165 009";
  1681. X$xrom{"IP"}      = "162 173";
  1682. X$xrom{"IR"}      = "165 037";
  1683. X$xrom{"JC"}      = "165 022";
  1684. X$xrom{"L-"}      = "162 151";
  1685. X$xrom{"LB"}      = "162 150";
  1686. X$xrom{"LF"}      = "162 133";
  1687. X$xrom{"LG"}      = "165 024";
  1688. X$xrom{"LR"}      = "165 002";
  1689. X$xrom{"M1"}      = "165 033";
  1690. X$xrom{"M2"}      = "165 031";
  1691. X$xrom{"M3"}      = "165 032";
  1692. X$xrom{"M4"}      = "165 035";
  1693. X$xrom{"M5"}      = "165 036";
  1694. X$xrom{"MA"}      = "165 054";
  1695. X$xrom{"MK"}      = "162 129";
  1696. X$xrom{"ML"}      = "162 140";
  1697. X$xrom{"MP"}      = "165 028";
  1698. X$xrom{"MS"}      = "162 176";
  1699. X$xrom{"MT"}      = "162 156";
  1700. X$xrom{"NC"}      = "162 166";
  1701. X$xrom{"NH"}      = "162 168";
  1702. X$xrom{"NP"}      = "165 014";
  1703. X$xrom{"NR"}      = "165 050";
  1704. X$xrom{"NS"}      = "165 049";
  1705. X$xrom{"OM"}      = "162 186";
  1706. X$xrom{"PA"}      = "162 187";
  1707. X$xrom{"PD"}      = "162 180";
  1708. X$xrom{"PK"}      = "162 137";
  1709. X$xrom{"PM"}      = "165 019";
  1710. X$xrom{"PO"}      = "165 051";
  1711. X$xrom{"PR"}      = "165 045";
  1712. X$xrom{"PS"}      = "162 174";
  1713. X$xrom{"QR"}      = "162 182";
  1714. X$xrom{"RB"}      = "165 052";
  1715. X$xrom{"RD"}      = "165 005";
  1716. X$xrom{"RF"}      = "162 141";
  1717. X$xrom{"RK"}      = "165 006";
  1718. X$xrom{"RN"}      = "165 016";
  1719. X$xrom{"RT"}      = "162 179";
  1720. X$xrom{"RX"}      = "162 185";
  1721. X$xrom{"S1"}      = "165 046";
  1722. X$xrom{"S2"}      = "165 048";
  1723. X$xrom{"S3"}      = "165 047";
  1724. X$xrom{"S?"}      = "162 143";
  1725. X$xrom{"SB"}      = "165 001";
  1726. X$xrom{"SD"}      = "165 003";
  1727. X$xrom{"SE"}      = "165 056";
  1728. X$xrom{"~?"}      = "162 142";
  1729. X$xrom{"~C"}      = "162 149";
  1730. X$xrom{"SK"}      = "165 004";
  1731. X$xrom{"SM"}      = "165 055";
  1732. X$xrom{"SR"}      = "165 000";
  1733. X$xrom{"SU"}      = "162 167";
  1734. X$xrom{"SV"}      = "165 010";
  1735. X$xrom{"SX"}      = "162 184";
  1736. X$xrom{"T1"}      = "162 175";
  1737. X$xrom{"TB"}      = "165 018";
  1738. X$xrom{"TN"}      = "162 160";
  1739. X$xrom{"UD"}      = "162 136";
  1740. X$xrom{"UG"}      = "165 044";
  1741. X$xrom{"VA"}      = "162 135";
  1742. X$xrom{"VF"}      = "165 058";
  1743. X$xrom{"VK"}      = "162 164";
  1744. X$xrom{"VM"}      = "162 154";
  1745. X$xrom{"VS"}      = "162 158";
  1746. X$xrom{"XD"}      = "162 153";
  1747. X$xrom{"XE"}      = "162 147";
  1748. X$xrom{"XL"}      = "165 057";
  1749. EEE_OOO_FFF
  1750. echo x - rom/ppc.rom
  1751. sed -e 's/^X//' >printer.rom <<'EEE_OOO_FFF'
  1752. X$xrom{"ACA"}     = "167 065";
  1753. X$xrom{"ACCHR"}   = "167 066";
  1754. X$xrom{"ACCOL"}   = "167 067";
  1755. X$xrom{"ACSPEC"}  = "167 068";
  1756. X$xrom{"ACX"}     = "167 069";
  1757. X$xrom{"BLDSPEC"} = "167 070";
  1758. X$xrom{"LIST"}    = "167 071";
  1759. X$xrom{"PRA"}     = "167 072";
  1760. X$xrom{"PRAXIS"}  = "167 073";
  1761. X$xrom{"PRBUF"}   = "167 074";
  1762. X$xrom{"PRFLAGS"} = "167 075";
  1763. X$xrom{"PRKEYS"}  = "167 076";
  1764. X$xrom{"PRP"}     = "167 077";
  1765. X$xrom{"PRPLOT"}  = "167 078";
  1766. X$xrom{"PRPLOTP"} = "167 079";
  1767. X$xrom{"PRREG"}   = "167 080";
  1768. X$xrom{"PRREGX"}  = "167 081";
  1769. X$xrom{"PR~"}     = "167 082";
  1770. X$xrom{"PRSTK"}   = "167 083";
  1771. X$xrom{"PRX"}     = "167 084";
  1772. X$xrom{"REGPLOT"} = "167 085";
  1773. X$xrom{"SKPCHR"}  = "167 086";
  1774. X$xrom{"SKPCOL"}  = "167 087";
  1775. X$xrom{"STKPLOT"} = "167 088";
  1776. EEE_OOO_FFF
  1777. echo x - rom/printer.rom
  1778. sed -e 's/^X//' >time.rom <<'EEE_OOO_FFF'
  1779. X$xrom{"ADATE"}   = "166 129";
  1780. X$xrom{"ALMCAT"}  = "166 130";
  1781. X$xrom{"ALMNOW"}  = "166 131";
  1782. X$xrom{"ATIME"}   = "166 132";
  1783. X$xrom{"ATIME24"} = "166 133";
  1784. X$xrom{"CLK12"}   = "166 134";
  1785. X$xrom{"CLK24"}   = "166 135";
  1786. X$xrom{"CLKT"}    = "166 136";
  1787. X$xrom{"CLKTD"}   = "166 137";
  1788. X$xrom{"CLOCK"}   = "166 138";
  1789. X$xrom{"CORRECT"} = "166 139";
  1790. X$xrom{"DATE"}    = "166 140";
  1791. X$xrom{"DATE+"}   = "166 141";
  1792. X$xrom{"DDAYS"}   = "166 142";
  1793. X$xrom{"DMY"}     = "166 143";
  1794. X$xrom{"DOW"}     = "166 144";
  1795. X$xrom{"MDY"}     = "166 145";
  1796. X$xrom{"RCLAF"}   = "166 146";
  1797. X$xrom{"RCLSW"}   = "166 147";
  1798. X$xrom{"RUNSW"}   = "166 148";
  1799. X$xrom{"SETAF"}   = "166 149";
  1800. X$xrom{"SETDATE"} = "166 150";
  1801. X$xrom{"SETSW"}   = "166 151";
  1802. X$xrom{"STOPSW"}  = "166 152";
  1803. X$xrom{"SW"}      = "166 153";
  1804. X$xrom{"T+X"}     = "166 154";
  1805. X$xrom{"TIME"}    = "166 155";
  1806. X$xrom{"XYZALM"}  = "166 156";
  1807. EEE_OOO_FFF
  1808. echo x - rom/time.rom
  1809. sed -e 's/^X//' >wand.rom <<'EEE_OOO_FFF'
  1810. X$xrom{"WNDDTA"}  = "166 193";
  1811. X$xrom{"WNDDTX"}  = "166 194";
  1812. X$xrom{"WNDLNK"}  = "166 195";
  1813. X$xrom{"WNDSUB"}  = "166 196";
  1814. X$xrom{"WNDSCN"}  = "166 197";
  1815. X$xrom{"WNDTST"}  = "166 198";
  1816. EEE_OOO_FFF
  1817. echo x - rom/wand.rom
  1818. test -d test || mkdir test
  1819. sed -e 's/^X//' >README <<'EEE_OOO_FFF'
  1820. XThese file were used to test the correct operation of the assembler.
  1821. XThey should be used to check out local changes you may make to the
  1822. Xperl scripts.  Every operator is checked.  See the comments at the
  1823. Xfront of each file of information on how to run each test.
  1824. EEE_OOO_FFF
  1825. echo x - test/README
  1826. sed -e 's/^X//' >numbers.test <<'EEE_OOO_FFF'
  1827. X# this test sould be run once with -n and once without
  1828. X# without -n the 000* should not be there
  1829. X.prog number-test
  1830. X'123456789'     # 000* 017 018 019 020 021
  1831. X        # 022 023 024 025
  1832. X'1.2'           # 000 017 026 018
  1833. X'1.2e2'         # 000 017 026 018 027 018
  1834. X'1.2E2'         # 000 017 026 018 027 018
  1835. X'-1.2e-2'       # 000 028 017 026 018 027
  1836. X        # 028 018
  1837. X+               # 064
  1838. X'E-10'          # 000* 027 028 017 016
  1839. X+               # 064
  1840. X'-E-1'          # 000* 028 027 028 017
  1841. X'E12'           # 000 028 027 018
  1842. X.data '1.234e-4' input value
  1843. EEE_OOO_FFF
  1844. echo x - test/numbers.test
  1845. sed -e 's/^X//' >rom.test <<'EEE_OOO_FFF'
  1846. X# note that this test needs to be invoked
  1847. X#   as "asm41c -X -r wand"
  1848. X.xrom foo 11 13
  1849. X.rom math
  1850. X.prog rom-test
  1851. XSWPT            # 166 163
  1852. XCLOCK           # 166 138
  1853. XWNDDTA          # 166 193
  1854. XC+              # 160 080
  1855. Xfoo             # 162 205
  1856. X.exec call foo
  1857. Xfoo
  1858. X.clear roms     # test of clear rom tables
  1859. X.exec call foo
  1860. Xfoo             # error & null = 000
  1861. EEE_OOO_FFF
  1862. echo x - test/rom.test
  1863. sed -e 's/^X//' >single.test <<'EEE_OOO_FFF'
  1864. X.prog single-test
  1865. XNULL    # 000
  1866. X+       # 064
  1867. X-       # 065
  1868. X*       # 066
  1869. X/       # 067
  1870. XX<Y?    # 068
  1871. XX>Y?    # 069
  1872. XX<=Y?   # 070
  1873. XSIG+    # 071
  1874. XSIG-    # 072
  1875. XHMS+    # 073
  1876. XHMS-    # 074
  1877. XMOD     # 075
  1878. X%       # 076
  1879. X%CH     # 077
  1880. XP->R    # 078
  1881. XR->P    # 079
  1882. XLN      # 080
  1883. X.title test new title
  1884. X.page   # sneak test of .page
  1885. X.prog private single-test2
  1886. XX^2     # 081
  1887. XSQRT    # 082
  1888. XY^X     # 083
  1889. XCHS     # 084
  1890. XE^X     # 085
  1891. XLOG     # 086
  1892. X10^X    # 087
  1893. XE^X-1   # 088
  1894. XSIN     # 089
  1895. XCOS     # 090
  1896. XTAN     # 091
  1897. XASIN    # 092
  1898. XACOS    # 093
  1899. XATAN    # 094
  1900. X->DEC   # 095
  1901. X1/X     # 096
  1902. XABS     # 097
  1903. XFACT    # 098
  1904. XX!=0?   # 099
  1905. XX>0?    # 100
  1906. XLN1+X   # 101
  1907. XX<0?    # 102
  1908. XX=0?    # 103
  1909. XINT     # 104
  1910. XFRC     # 105
  1911. XD->R    # 106
  1912. XR->D    # 107
  1913. X->HMS   # 108
  1914. X->HR    # 109
  1915. XRND     # 110
  1916. X->OCT   # 111
  1917. XCLSIG   # 112
  1918. XX<>Y    # 113
  1919. XPI      # 114
  1920. XCLST    # 115
  1921. XR^      # 116
  1922. XRDN     # 117
  1923. XLASTX   # 118
  1924. XCLX     # 119
  1925. XX=Y?    # 120
  1926. XX!=Y?   # 121
  1927. XSIGN    # 122
  1928. XX<=0?   # 123
  1929. XMEAN    # 124
  1930. XSDEV    # 125
  1931. XAVIEW   # 126
  1932. XCLD     # 127
  1933. XDEG     # 128
  1934. XRAD     # 129
  1935. XGRAD    # 130
  1936. XENTER^  # 131
  1937. XSTOP    # 132
  1938. XRTN     # 133
  1939. XBEEP    # 134
  1940. XCLA     # 135
  1941. XASHF    # 136
  1942. XPSE     # 137
  1943. XCLRG    # 138
  1944. XAOFF    # 139
  1945. XAON     # 140
  1946. XOFF     # 141
  1947. XPROMPT  # 142
  1948. XADV     # 143
  1949. XLBL 0   # 001
  1950. XLBL 7   # 008
  1951. XLBL 14  # 015
  1952. XSTO 0   # 048
  1953. XSTO 7   # 055
  1954. XSTO 15  # 063
  1955. XRCL 0   # 032
  1956. XRCL 7   # 039
  1957. XRCL 15  # 047
  1958. XBYTE 0  # 000
  1959. XBYTE 127 # 127
  1960. XBYTE 377 # 121
  1961. EEE_OOO_FFF
  1962. echo x - test/single.test
  1963. sed -e 's/^X//' >string.test <<'EEE_OOO_FFF'
  1964. X# test various thing with string args
  1965. X.prog string-test
  1966. X"abcdefg"               # 247 097 098 099 100 101
  1967. X            # 102 103
  1968. X"123456789012345"       # 255 049 050 051 052 053
  1969. X            # 054 055 056 057 048 049
  1970. X            # 050 051 052 053
  1971. X""                      # 240
  1972. X"12345678901234567890"  # trunc error
  1973. X            # 255 049 050 051 052 053
  1974. X            # 054 055 056 057 048 049
  1975. X            # 050 051 052 053
  1976. X"\000\001\127\255\128"  # 245 000 001 127 255 128
  1977. X"\x00\x01\x7f\xff\x80"  # 245 000 001 127 255 128
  1978. X"\-\=\S\M\L\P\A"        # 248 127 029 126 012 013
  1979. X            # 123 125
  1980. XLBL "abcde"             # 192 000 246 000 097 098
  1981. X            # 099 100 101
  1982. XGTO "abcde"             # 029 245 097 098 099 100
  1983. X            # 101
  1984. XXEQ "abcde"             # 030 245 097 098 099 100
  1985. X            # 101
  1986. XW "abcde"               # 031 245 097 098 099 100
  1987. X            # 101
  1988. X.string "abcdefg" test string
  1989. X            # 097 098 099 100 101 102
  1990. X            # 103
  1991. EEE_OOO_FFF
  1992. echo x - test/string.test
  1993. sed -e 's/^X//' >symbol.test <<'EEE_OOO_FFF'
  1994. X# test out predefined and user define symbols
  1995. X.prog symbol-test
  1996. XRCL A   # 144 102
  1997. XRCL B   # 144 103
  1998. XRCL C   # 144 104
  1999. XRCL D   # 144 105
  2000. XRCL E   # 144 106
  2001. XRCL F   # 144 107
  2002. XRCL G   # 144 108
  2003. XRCL H   # 144 109
  2004. XRCL I   # 144 110
  2005. XRCL J   # 144 111
  2006. XRCL T   # 144 112
  2007. XRCL Z   # 144 113
  2008. XRCL Y   # 144 114
  2009. XRCL X   # 144 115
  2010. XRCL L   # 144 116
  2011. XRCL M   # 144 117
  2012. XRCL N   # 144 118
  2013. XRCL O   # 144 119
  2014. XRCL P   # 144 120
  2015. XRCL Q   # 144 121
  2016. XRCL R   # 144 122
  2017. XRCL a   # 144 123
  2018. XRCL b   # 144 124
  2019. XRCL c   # 144 125
  2020. XRCL d   # 144 126
  2021. XRCL e   # 144 127
  2022. XRCL foo # error undefined symbol & 032
  2023. X.define foo 100
  2024. X.define bar 127
  2025. X.define gorf foo
  2026. X.prog symbol-test2
  2027. XRCL foo # 144 100
  2028. XRCL bar # 144 127
  2029. XRCL gorf # 144 100
  2030. X.clear names
  2031. X.prog symbol-test3
  2032. XRCL e   # 144 127
  2033. XRCL gorf # error undefined symbol & 032
  2034. X
  2035. EEE_OOO_FFF
  2036. echo x - test/symbol.test
  2037. sed -e 's/^X//' >three.test <<'EEE_OOO_FFF'
  2038. X# test out tree byte op codes
  2039. X.prog three-byte-test
  2040. XEND             # 192 000 009
  2041. XGTO 100         # 208 000 100
  2042. XGTO3 0          # 208 000 000
  2043. XXEQ 100         # 224 000 100
  2044. XXEQ 0           # 224 000 000
  2045. EEE_OOO_FFF
  2046. echo x - test/three.test
  2047. sed -e 's/^X//' >twobyte.test <<'EEE_OOO_FFF'
  2048. X# test out two byte op codes
  2049. X.prog   two-byte-test
  2050. XRCL     100     # 144 100
  2051. XSTO     100     # 145 100
  2052. XRCL2    0       # 144 000
  2053. XSTO2    0       # 145 000
  2054. XST+     0       # 146 000
  2055. XST-     0       # 147 000
  2056. XST*     0       # 148 000
  2057. XST/     0       # 149 000
  2058. XISG     0       # 150 000
  2059. XDSE     0       # 151 000
  2060. XVIEW    0       # 152 000
  2061. XSIGREG  0       # 153 000
  2062. XASTO    0       # 154 000
  2063. XARCL    0       # 155 000
  2064. XFIX     0       # 156 000
  2065. XSCI     0       # 157 000
  2066. XENG     0       # 158 000
  2067. XTONE    0       # 159 000
  2068. XSF      0       # 168 000
  2069. XCF      0       # 169 000
  2070. XFS?C    0       # 170 000
  2071. XFC?C    0       # 171 000
  2072. XFS?     0       # 172 000
  2073. XFC?     0       # 173 000
  2074. XSPARE1  0       # 175 000
  2075. XSPARE2  0       # 176 000
  2076. XX<>     0       # 206 000
  2077. XLBL2    0       # 207 000
  2078. XGTO     0       # 177 000
  2079. XGTO     7       # 184 000
  2080. XGTO     14      # 191 000
  2081. XGTO     IND 0   # 174 000
  2082. XXEQ     IND 0   # 174 128
  2083. XRCL     IND 0   # 144 128
  2084. XXROM    11 13   # 162 205
  2085. EEE_OOO_FFF
  2086. echo x - test/twobyte.test
  2087. sed -e 's/^X//' >test.41c <<'EEE_OOO_FFF'
  2088. X.prog test # comment
  2089. XLBL "A"
  2090. XENTER^
  2091. XLN
  2092. X+
  2093. XXEQ IND 000
  2094. XSTO M
  2095. XRTN
  2096. X"ABCDEFG"
  2097. X"\-\002hij"
  2098. X'-1.234e-8'
  2099. X
  2100. EEE_OOO_FFF
  2101. echo x - test/test.41c
  2102. test -d tmac || mkdir tmac
  2103. sed -e 's/^X//' >README <<'EEE_OOO_FFF'
  2104. XThe following macros are defined in the tmac.*bar files:
  2105. X
  2106. X.Sb "Label"
  2107. X
  2108. XStart a line of barcode labeled with Label (for programs this label usually
  2109. Xlooks something like "Line 1 (1 - 3)").  This macro automatically does a
  2110. X.ne directive to assure that the line of barcode, its label and tags if any
  2111. Xremain on the same page.
  2112. X
  2113. X.By Value
  2114. X
  2115. XEach byte of a line of barcode is specified by one of these macro calls.
  2116. XValue should be between 0 and 256 inclusive.
  2117. X
  2118. X.Eb [1]
  2119. X
  2120. XEnd a line of bar code. if the optional argument is non-zero then each
  2121. Xbyte of the line is taged with its value (in a tiny pointsize) just
  2122. Xbelow the bars
  2123. X
  2124. XThe following macro calls are generated but are not defined.
  2125. XSuitable definitions can be supplied by the user.
  2126. X
  2127. X.Tl "Title"
  2128. X
  2129. XEach asm41c .title directive (or -t flag) or bar41c title directive
  2130. Xgenerates this call.
  2131. X
  2132. X.Pg "Program Name"
  2133. X
  2134. XA call of this type is generated before the barcode for each
  2135. Xasm41c .prog or bar41c program directive.
  2136. X
  2137. XThe following macro, number or string register names are used in these
  2138. Xmacro definitions:
  2139. X
  2140. XAd B0 B1 B2 B3 B4 B5 B6 B7 Bb Bs Bt By Eb Fi Sb b0 b1
  2141. EEE_OOO_FFF
  2142. echo x - tmac/README
  2143. sed -e 's/^X//' >tmac.lwbar <<'EEE_OOO_FFF'
  2144. X.ds b0 \(bv\(bv   \"do not remove this comment
  2145. X.ds b1 \(bv\(bv\(bv\(bv   \"do not remove this comment
  2146. X.de Sb
  2147. X.ne 0.75i
  2148. X.nf
  2149. X.nr Bs \\n(.s
  2150. X.nr Ad \\n(.j
  2151. X.nr Fi \\n(.u
  2152. X.ps 8
  2153. X\\$1
  2154. X.sp 0.5v
  2155. X.ps 18
  2156. X.cs R 1
  2157. X\\*(b0\\*(b0\\c
  2158. X.cs R
  2159. X.rm Bt
  2160. X..
  2161. X.de By
  2162. X.ps 6
  2163. X.am Bt ..
  2164. X\\\\h'|\\n(.ku-\\\\n(.ku-1.1p'\(br \\$1\\\\c
  2165. X...
  2166. X.nr B7 (\\$1/128%2)
  2167. X.nr B6 (\\$1/64%2)
  2168. X.nr B5 (\\$1/32%2)
  2169. X.nr B4 (\\$1/16%2)
  2170. X.nr B3 (\\$1/8%2)
  2171. X.nr B2 (\\$1/4%2)
  2172. X.nr B1 (\\$1/2%2)
  2173. X.nr B0 (\\$1%2)
  2174. X.ps 18
  2175. X.cs R 1
  2176. X.di Bb
  2177. X\\\\*(b\\n(B7\\\\*(b\\n(B6\\\\*(b\\n(B5\\\\*(b\\n(B4\\\\c
  2178. X\\\\*(b\\n(B3\\\\*(b\\n(B2\\\\*(b\\n(B1\\\\*(b\\n(B0\\\\c
  2179. X.di
  2180. X.Bb
  2181. X.cs R
  2182. X..
  2183. X.de Eb
  2184. X.ps 18
  2185. X.cs R 1
  2186. X\*(b1\*(b0
  2187. X.cs R
  2188. X.ie '\\$1'1' \\{\\
  2189. X.ps 6
  2190. X.\".sp 0.05v
  2191. X.Bt
  2192. X.sp 0.1v
  2193. X'br \\}
  2194. X.el .sp 0.2v
  2195. X.ps \\n(Bs
  2196. X.if \\n(Fi .fi
  2197. X.ad \\n(Ad
  2198. X..
  2199. EEE_OOO_FFF
  2200. echo x - tmac/tmac.lwbar
  2201. sed -e 's/^X//' >tmac.vbar <<'EEE_OOO_FFF'
  2202. X.ds b0 \(bv \"do not remove this comment
  2203. X.ds b1 \(bv\(bv \"do not remove this comment
  2204. X.de Sb
  2205. X.ne 0.75i
  2206. X.nf
  2207. X.nr Bs \\n(.s
  2208. X.nr Ad \\n(.j
  2209. X.nr Fi \\n(.u
  2210. X.ps 8
  2211. X\\$1
  2212. X.sp 0.6v
  2213. X.ps 18
  2214. X.cs R 3
  2215. X\\*(b0\\*(b0\\c
  2216. X.cs R
  2217. X.rm Bt
  2218. X..
  2219. X.de By
  2220. X.ps 6
  2221. X.am Bt ..
  2222. X\\\\h'|\\n(.ku-\\\\n(.ku-1.5p'\(br \\$1\\\\c
  2223. X...
  2224. X.nr B7 (\\$1/128%2)
  2225. X.nr B6 (\\$1/64%2)
  2226. X.nr B5 (\\$1/32%2)
  2227. X.nr B4 (\\$1/16%2)
  2228. X.nr B3 (\\$1/8%2)
  2229. X.nr B2 (\\$1/4%2)
  2230. X.nr B1 (\\$1/2%2)
  2231. X.nr B0 (\\$1%2)
  2232. X.ps 18
  2233. X.cs R 3
  2234. X.di Bb
  2235. X\\\\*(b\\n(B7\\\\*(b\\n(B6\\\\*(b\\n(B5\\\\*(b\\n(B4\\\\c
  2236. X\\\\*(b\\n(B3\\\\*(b\\n(B2\\\\*(b\\n(B1\\\\*(b\\n(B0\\\\c
  2237. X.di
  2238. X.Bb
  2239. X.cs R
  2240. X..
  2241. X.de Eb
  2242. X.ps 18
  2243. X.cs R 3
  2244. X\*(b1\*(b0
  2245. X.cs R
  2246. X.ie '\\$1'1' \\{\\
  2247. X.ps 6
  2248. X.sp 0.05v
  2249. X.Bt
  2250. X.sp 0.1v
  2251. X'br \\}
  2252. X.el .sp 0.2v
  2253. X.ps \\n(Bs
  2254. X.if \\n(Fi .fi
  2255. X.ad \\n(Ad
  2256. X..
  2257. EEE_OOO_FFF
  2258. echo x - tmac/tmac.vbar
  2259. exit 0
  2260.  
  2261. --
  2262. Mark Biggar
  2263. {allegra,burdvax,cbosgd,hplabs,ihnp4,akgua,sdcsvax}!sdcrdcf!markb
  2264. markb@rdcf.sm.unisys.com
  2265.