home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / compsrcs / misc / volume04 / hp41c.asm < prev    next >
Encoding:
Internet Message Format  |  1991-08-27  |  63.3 KB

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