home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 2 / 2220 < prev    next >
Internet Message Format  |  1990-12-28  |  23KB

  1. From: markz@ssc.UUCP (Mark Zenier)
  2. Newsgroups: alt.sources
  3. Subject: Frankenstein Cross Assemblers, 6502 flavor, part 1 of 2
  4. Message-ID: <613@ssc.UUCP>
  5. Date: 6 Dec 90 07:19:51 GMT
  6.  
  7. ---- Cut Here and feed the following to sh ----
  8. #!/bin/sh
  9. # This is Frankasm/As6502, a shell archive (shar 3.43)
  10. # made 12/04/1990 08:45 UTC by markz@ssc.uucp
  11. # Source directory /usr/mark/frank.shar
  12. #
  13. # existing files will NOT be overwritten unless -c is specified
  14. # This format requires very little intelligence at unshar time.
  15. # "if test", "echo", "true", and "sed" may be needed.
  16. #
  17. # This shar contains:
  18. # length  mode       name
  19. # ------ ---------- ------------------------------------------
  20. #   1648 -r--r----- as6502.1
  21. #   9447 -r--r----- as6502.doc
  22. #   2771 -r--r----- as6502.tst
  23. #   5954 -r--r--r-- as6502.tut
  24. #  41188 -r--r--r-- as6502.y
  25. #
  26. # ============= as6502.1 ==============
  27. if test -f 'as6502.1' -a X"$1" != X"-c"; then
  28.     echo 'x - skipping as6502.1 (File already exists)'
  29. else
  30. echo 'x - extracting as6502.1 (Text)'
  31. sed 's/^X//' << 'SHAR_EOF' > 'as6502.1' &&
  32. X.TH AS6502 1L
  33. X.SH NAME
  34. Xas6502, as65c00, asr65c00 \- cross assemblers for microcomputers
  35. X.SH SYNOPSIS
  36. X.nf
  37. Xas6502 [-p cpu] [-l listfile] [-o hexfile] [-d] [-s symbolfile] input
  38. Xas65c00 [-p cpu] [-l listfile] [-o hexfile] [-d] [-s symbolfile] input
  39. Xasr65c00 [-p cpu] [-l listfile] [-o hexfile] [-d] [-s symbolfile] input
  40. X.fi
  41. X.SH DESCRIPTION
  42. XThe as6502, as65c00, asr65c00 command assembles the input file into a
  43. Xtext output file representing the program memory for a microcomputer.
  44. X
  45. XOptions
  46. X.IP "-p cpu"
  47. XOverride the instruction set selection.
  48. X.RS 10
  49. XValid Values for Cpu
  50. X.RS 5
  51. X65, 65c, r65, r65c, 21
  52. X.RE
  53. X.RE
  54. X.IP "-l listfile"
  55. XOutput a file formated with the memory address, data, and source input lines.
  56. X.IP "-o hexfile"
  57. XOutput the memory data image in a form accepted by most prom programmers.
  58. X.IP "-h hexfile"
  59. XSame as \-o.
  60. X.IP \-d
  61. XSave the intermediate data file (see FILE) and abort the execution at the
  62. Xend of processing.
  63. X.IP "-s symbolfile"
  64. XPrint the symbol table values and names, one per line in the specified file.
  65. X.SH FILES
  66. X/usr/tmp/frtXXXXXX
  67. X.SH SEE ALSO
  68. XFrankenstein Cross Assemblers Users Manual (file base.doc)
  69. XAppendix for as6502 Frankenstein Assembler (file as6502.doc)
  70. X.SH NOTES
  71. XThere is only one input file.
  72. X
  73. XThe program can select which subset of instructions is accepted.
  74. XThe program first uses the name with which it is invoked.
  75. XThis is scanned for a substring which indicates which set to use.
  76. XThe -p options overrides this selction by performing the same substring
  77. Xsearch.
  78. XFinally the input file can select which subset to use with the CPU statement.
  79. X
  80. XThere should only be one executable file with all of its names linked to it.
  81. SHAR_EOF
  82. true || echo 'restore of as6502.1 failed'
  83. fi
  84. # ============= as6502.doc ==============
  85. if test -f 'as6502.doc' -a X"$1" != X"-c"; then
  86.     echo 'x - skipping as6502.doc (File already exists)'
  87. else
  88. echo 'x - extracting as6502.doc (Text)'
  89. sed 's/^X//' << 'SHAR_EOF' > 'as6502.doc' &&
  90. X.HM A 1 1 1 1 1 1
  91. X.H 1 "Appendix for as6502 Frankenstein Assembler"
  92. X.H 2 "Pseudo Operations"
  93. X.H 3 "Standard Pseudo Operation Mnemonics"
  94. X.VL 40 5 1
  95. X.LI "End"
  96. XEND
  97. X.LI "File Inclusion"
  98. XINCL
  99. XINCLUDE
  100. X.LI "If"
  101. XIF
  102. X.LI "Else"
  103. XELSE
  104. X.LI "End If"
  105. XENDI
  106. X.LI "Equate"
  107. XEQU
  108. X.LI "Set"
  109. XSET
  110. X.LI "Org"
  111. XORG
  112. X.LI "Reserve Memory"
  113. XRESERVE
  114. XRMB
  115. X.LI "Define Byte Data"
  116. XBYTE
  117. XDB
  118. XFCB
  119. X.LI "Define Word Data"
  120. XDW
  121. XFDB
  122. XWORD
  123. X.LI "Define String Data"
  124. XFCC
  125. XSTRING
  126. X.LI "Define Character Set Translation"
  127. XCHARSET
  128. X.LI "Define Character Value"
  129. XCHARDEF
  130. XCHD
  131. X.LI "Use Character Translation"
  132. XCHARUSE
  133. X.LE
  134. X.H 3 "Machine Dependent Pseudo Operations"
  135. X.H 4 "Define Word Data"
  136. XThe define word pseudo-operations generates the byte reversed (low byte, high
  137. Xbyte) representation.
  138. X.H 4 "Instruction Set Selection"
  139. X.DS I N
  140. XCPU string
  141. X.DE
  142. XThe instruction set can be specified in the source file with the CPU 
  143. Xpseudooperation.
  144. XThe string, delimited by quotes or apostrophes, is scanned for a
  145. Xsubstring which selects which instruction set is used.
  146. XWhen the program is invoked, this operation is performed on the name of
  147. Xthe program, then the -p optional arguement, if any, and then any CPU
  148. Xstatements.
  149. XThe last one selects which subset of the instructions the assembler will
  150. Xaccept.
  151. XThe instruction set can be changed at any place in the source file. 
  152. X.DS
  153. X.VL 30 5 1
  154. X.LI "Instruction Set"
  155. XSubstrings
  156. X.LI "ROCKWELL CMOS"
  157. XR65C
  158. Xr65c
  159. X.LI "CMOS"
  160. X65C
  161. X65c
  162. X.LI "ROCKWELL Extended"
  163. XR65
  164. Xr65
  165. X.LI "R65C00/21"
  166. X21
  167. X.LI "Standard NMOS"
  168. X65
  169. X.LE
  170. X.DE
  171. X.H 2 "Instructions"
  172. X.H 3 "Instruction List"
  173. X.TS H
  174. X;
  175. Xl l l.
  176. XOpcode    Syntax    Selection Criteria
  177. X.sp
  178. X.TH
  179. X.sp
  180. XADC     '#' topexpr
  181. XADC     '(' topexpr ')' ',' INDEX    DIRECT INDEXY
  182. XADC     '(' topexpr ')'    DIRECT INSTCMOS
  183. XADC     '(' topexpr ',' INDEX ')'    DIRECT INDEXX
  184. XADC     topexpr ',' INDEX    DIRECT INDEXX
  185. XADC     topexpr ',' INDEX    EXTENDED INDEXX
  186. XADC     topexpr ',' INDEX    INDEXY
  187. XADC     topexpr    DIRECT
  188. XADC     topexpr    EXTENDED
  189. X.sp
  190. XAND     '#' topexpr
  191. XAND     '(' topexpr ')' ',' INDEX    DIRECT INDEXY
  192. XAND     '(' topexpr ')'    DIRECT INSTCMOS
  193. XAND     '(' topexpr ',' INDEX ')'    DIRECT INDEXX
  194. XAND     topexpr ',' INDEX    DIRECT INDEXX
  195. XAND     topexpr ',' INDEX    EXTENDED INDEXX
  196. XAND     topexpr ',' INDEX    INDEXY
  197. XAND     topexpr    DIRECT
  198. XAND     topexpr    EXTENDED
  199. X.sp
  200. XASL     ACCUM
  201. XASL     topexpr ',' INDEX    DIRECT INDEXX
  202. XASL     topexpr ',' INDEX    EXTENDED INDEXX
  203. XASL     topexpr    DIRECT
  204. XASL     topexpr    EXTENDED
  205. X.sp
  206. XBBR0     topexpr ',' topexpr    INSTROCKWELL
  207. X.sp
  208. XBBR1     topexpr ',' topexpr    INSTROCKWELL
  209. X.sp
  210. XBBR2     topexpr ',' topexpr    INSTROCKWELL
  211. X.sp
  212. XBBR3     topexpr ',' topexpr    INSTROCKWELL
  213. X.sp
  214. XBBR4     topexpr ',' topexpr    INSTROCKWELL
  215. X.sp
  216. XBBR5     topexpr ',' topexpr    INSTROCKWELL
  217. X.sp
  218. XBBR6     topexpr ',' topexpr    INSTROCKWELL
  219. X.sp
  220. XBBR7     topexpr ',' topexpr    INSTROCKWELL
  221. X.sp
  222. XBBS0     topexpr ',' topexpr    INSTROCKWELL
  223. X.sp
  224. XBBS1     topexpr ',' topexpr    INSTROCKWELL
  225. X.sp
  226. XBBS2     topexpr ',' topexpr    INSTROCKWELL
  227. X.sp
  228. XBBS3     topexpr ',' topexpr    INSTROCKWELL
  229. X.sp
  230. XBBS4     topexpr ',' topexpr    INSTROCKWELL
  231. X.sp
  232. XBBS5     topexpr ',' topexpr    INSTROCKWELL
  233. X.sp
  234. XBBS6     topexpr ',' topexpr    INSTROCKWELL
  235. X.sp
  236. XBBS7     topexpr ',' topexpr    INSTROCKWELL
  237. X.sp
  238. XBCC     topexpr
  239. X.sp
  240. XBCS     topexpr
  241. X.sp
  242. XBEQ     topexpr
  243. X.sp
  244. XBGE     topexpr
  245. X.sp
  246. XBIT     '#' topexpr    INSTCMOS
  247. XBIT     topexpr ',' INDEX    DIRECT INDEXX INSTCMOS
  248. XBIT     topexpr ',' INDEX    EXTENDED INDEXX INSTCMOS
  249. XBIT     topexpr    DIRECT
  250. XBIT     topexpr    EXTENDED
  251. X.sp
  252. XBLT     topexpr
  253. X.sp
  254. XBMI     topexpr
  255. X.sp
  256. XBNE     topexpr
  257. X.sp
  258. XBPL     topexpr
  259. X.sp
  260. XBRA     topexpr    INST21
  261. XBRA     topexpr    INSTCMOS
  262. X.sp
  263. XBRK     '#' topexpr
  264. XBRK    
  265. X.sp
  266. XBVC     topexpr
  267. X.sp
  268. XBVS     topexpr
  269. X.sp
  270. XCLC    
  271. X.sp
  272. XCLD    
  273. X.sp
  274. XCLI    
  275. X.sp
  276. XCLV    
  277. X.sp
  278. XCMP     '#' topexpr
  279. XCMP     '(' topexpr ')' ',' INDEX    DIRECT INDEXY
  280. XCMP     '(' topexpr ')'    DIRECT INSTCMOS
  281. XCMP     '(' topexpr ',' INDEX ')'    DIRECT INDEXX
  282. XCMP     topexpr ',' INDEX    DIRECT INDEXX
  283. XCMP     topexpr ',' INDEX    EXTENDED INDEXX
  284. XCMP     topexpr ',' INDEX    INDEXY
  285. XCMP     topexpr    DIRECT
  286. XCMP     topexpr    EXTENDED
  287. X.sp
  288. XCPX     '#' topexpr
  289. XCPX     topexpr    DIRECT
  290. XCPX     topexpr    EXTENDED
  291. X.sp
  292. XCPY     '#' topexpr
  293. XCPY     topexpr    DIRECT
  294. XCPY     topexpr    EXTENDED
  295. X.sp
  296. XDEC     ACCUM    INSTCMOS
  297. XDEC     topexpr ',' INDEX    DIRECT INDEXX
  298. XDEC     topexpr ',' INDEX    EXTENDED INDEXX
  299. XDEC     topexpr    DIRECT
  300. XDEC     topexpr    EXTENDED
  301. X.sp
  302. XDEX    
  303. X.sp
  304. XDEY    
  305. X.sp
  306. XEOR     '#' topexpr
  307. XEOR     '(' topexpr ')' ',' INDEX    DIRECT INDEXY
  308. XEOR     '(' topexpr ')'    DIRECT INSTCMOS
  309. XEOR     '(' topexpr ',' INDEX ')'    DIRECT INDEXX
  310. XEOR     topexpr ',' INDEX    DIRECT INDEXX
  311. XEOR     topexpr ',' INDEX    EXTENDED INDEXX
  312. XEOR     topexpr ',' INDEX    INDEXY
  313. XEOR     topexpr    DIRECT
  314. XEOR     topexpr    EXTENDED
  315. X.sp
  316. XINC     ACCUM    INSTCMOS
  317. XINC     topexpr ',' INDEX    DIRECT INDEXX
  318. XINC     topexpr ',' INDEX    EXTENDED INDEXX
  319. XINC     topexpr    DIRECT
  320. XINC     topexpr    EXTENDED
  321. X.sp
  322. XINX    
  323. X.sp
  324. XINY    
  325. X.sp
  326. XJMP     '(' topexpr ')'
  327. XJMP     '(' topexpr ',' INDEX ')'    INSTCMOS INDEXX
  328. XJMP     topexpr
  329. X.sp
  330. XJSR     topexpr
  331. X.sp
  332. XLDA     '#' topexpr
  333. XLDA     '(' topexpr ')' ',' INDEX    DIRECT INDEXY
  334. XLDA     '(' topexpr ')'    DIRECT INSTCMOS
  335. XLDA     '(' topexpr ',' INDEX ')'    DIRECT INDEXX
  336. XLDA     topexpr ',' INDEX    DIRECT INDEXX
  337. XLDA     topexpr ',' INDEX    EXTENDED INDEXX
  338. XLDA     topexpr ',' INDEX    INDEXY
  339. XLDA     topexpr    DIRECT
  340. XLDA     topexpr    EXTENDED
  341. X.sp
  342. XLDX     '#' topexpr
  343. XLDX     topexpr ',' INDEX    DIRECT INDEXY
  344. XLDX     topexpr ',' INDEX    EXTENDED INDEXY
  345. XLDX     topexpr    DIRECT
  346. XLDX     topexpr    EXTENDED
  347. X.sp
  348. XLDY     '#' topexpr
  349. XLDY     topexpr ',' INDEX    DIRECT INDEXX
  350. XLDY     topexpr ',' INDEX    EXTENDED INDEXX
  351. XLDY     topexpr    DIRECT
  352. XLDY     topexpr    EXTENDED
  353. X.sp
  354. XLSR     ACCUM
  355. XLSR     topexpr ',' INDEX    DIRECT INDEXX
  356. XLSR     topexpr ',' INDEX    EXTENDED INDEXX
  357. XLSR     topexpr    DIRECT
  358. XLSR     topexpr    EXTENDED
  359. X.sp
  360. XMUL        INST21
  361. X.sp
  362. XNOP    
  363. X.sp
  364. XORA     '#' topexpr
  365. XORA     '(' topexpr ')' ',' INDEX    DIRECT INDEXY
  366. XORA     '(' topexpr ')'    DIRECT INSTCMOS
  367. XORA     '(' topexpr ',' INDEX ')'    DIRECT INDEXX
  368. XORA     topexpr ',' INDEX    DIRECT INDEXX
  369. XORA     topexpr ',' INDEX    EXTENDED INDEXX
  370. XORA     topexpr ',' INDEX    INDEXY
  371. XORA     topexpr    DIRECT
  372. XORA     topexpr    EXTENDED
  373. X.sp
  374. XPHA    
  375. X.sp
  376. XPHP    
  377. X.sp
  378. XPHX        INST21
  379. XPHX        INSTCMOS
  380. X.sp
  381. XPHY        INST21
  382. XPHY        INSTCMOS
  383. X.sp
  384. XPLA    
  385. X.sp
  386. XPLP    
  387. X.sp
  388. XPLX        INST21
  389. XPLX        INSTCMOS
  390. X.sp
  391. XPLY        INST21
  392. XPLY        INSTCMOS
  393. X.sp
  394. XRMB0     topexpr    INSTROCKWELL
  395. X.sp
  396. XRMB1     topexpr    INSTROCKWELL
  397. X.sp
  398. XRMB2     topexpr    INSTROCKWELL
  399. X.sp
  400. XRMB3     topexpr    INSTROCKWELL
  401. X.sp
  402. XRMB4     topexpr    INSTROCKWELL
  403. X.sp
  404. XRMB5     topexpr    INSTROCKWELL
  405. X.sp
  406. XRMB6     topexpr    INSTROCKWELL
  407. X.sp
  408. XRMB7     topexpr    INSTROCKWELL
  409. X.sp
  410. XROL     ACCUM
  411. XROL     topexpr ',' INDEX    DIRECT INDEXX
  412. XROL     topexpr ',' INDEX    EXTENDED INDEXX
  413. XROL     topexpr    DIRECT
  414. XROL     topexpr    EXTENDED
  415. X.sp
  416. XROR     ACCUM
  417. XROR     topexpr ',' INDEX    DIRECT INDEXX
  418. XROR     topexpr ',' INDEX    EXTENDED INDEXX
  419. XROR     topexpr    DIRECT
  420. XROR     topexpr    EXTENDED
  421. X.sp
  422. XRTI    
  423. X.sp
  424. XRTS    
  425. X.sp
  426. XSBC     '#' topexpr
  427. XSBC     '(' topexpr ')' ',' INDEX    DIRECT INDEXY
  428. XSBC     '(' topexpr ')'    DIRECT INSTCMOS
  429. XSBC     '(' topexpr ',' INDEX ')'    DIRECT INDEXX
  430. XSBC     topexpr ',' INDEX    DIRECT INDEXX
  431. XSBC     topexpr ',' INDEX    EXTENDED INDEXX
  432. XSBC     topexpr ',' INDEX    INDEXY
  433. XSBC     topexpr    DIRECT
  434. XSBC     topexpr    EXTENDED
  435. X.sp
  436. XSEC    
  437. X.sp
  438. XSED    
  439. X.sp
  440. XSEI    
  441. X.sp
  442. XSMB0     topexpr    INSTROCKWELL
  443. X.sp
  444. XSMB1     topexpr    INSTROCKWELL
  445. X.sp
  446. XSMB2     topexpr    INSTROCKWELL
  447. X.sp
  448. XSMB3     topexpr    INSTROCKWELL
  449. X.sp
  450. XSMB4     topexpr    INSTROCKWELL
  451. X.sp
  452. XSMB5     topexpr    INSTROCKWELL
  453. X.sp
  454. XSMB6     topexpr    INSTROCKWELL
  455. X.sp
  456. XSMB7     topexpr    INSTROCKWELL
  457. X.sp
  458. XSTA     '(' topexpr ')' ',' INDEX    DIRECT INDEXY
  459. XSTA     '(' topexpr ')'    DIRECT INSTCMOS
  460. XSTA     '(' topexpr ',' INDEX ')'    DIRECT INDEXX
  461. XSTA     topexpr ',' INDEX    DIRECT INDEXX
  462. XSTA     topexpr ',' INDEX    EXTENDED INDEXX
  463. XSTA     topexpr ',' INDEX    INDEXY
  464. XSTA     topexpr    DIRECT
  465. XSTA     topexpr    EXTENDED
  466. X.sp
  467. XSTX     topexpr ',' INDEX    DIRECT INDEXY
  468. XSTX     topexpr    DIRECT
  469. XSTX     topexpr    EXTENDED
  470. X.sp
  471. XSTY     topexpr ',' INDEX    DIRECT INDEXX
  472. XSTY     topexpr    DIRECT
  473. XSTY     topexpr    EXTENDED
  474. X.sp
  475. XSTZ     topexpr ',' INDEX    DIRECT INDEXX INSTCMOS
  476. XSTZ     topexpr ',' INDEX    EXTENDED INDEXX INSTCMOS
  477. XSTZ     topexpr    DIRECT INSTCMOS
  478. XSTZ     topexpr    EXTENDED INSTCMOS
  479. X.sp
  480. XTAX    
  481. X.sp
  482. XTAY    
  483. X.sp
  484. XTRB     topexpr    DIRECT INSTCMOS
  485. XTRB     topexpr    EXTENDED INSTCMOS
  486. X.sp
  487. XTSB     topexpr    DIRECT INSTCMOS
  488. XTSB     topexpr    EXTENDED INSTCMOS
  489. X.sp
  490. XTSX    
  491. X.sp
  492. XTXA    
  493. X.sp
  494. XTXS    
  495. X.sp
  496. XTYA    
  497. X.TE
  498. X.H 3 "Operands"
  499. X.VL 25 5
  500. X.LI ACCUM
  501. XThe a or (A) reserved symbol
  502. X.LI INDEX
  503. XThe x or y (or X or Y) reserved symbols
  504. X.LE
  505. X.H 3 "Selection Criteria Keywords"
  506. X.VL 25 5 
  507. X.LI DIRECT
  508. XThe instruction can use the direct addressing mode.  
  509. XThe expression must have a value between 0 and 255 that is defined when the
  510. Xinstruction is processed in the input pass.
  511. X.LI EXTENDED
  512. XThe instruction can use the extended (16 bit address) mode.
  513. X.LI INDEXX
  514. XThe instruction can use the X index.
  515. X.LI INDEXY
  516. XThe instruction can use the Y index.
  517. X.LI INSTCMOS
  518. XThe instruction is in the CMOS and ROCKWELL CMOS instruction sets.
  519. X.LI INSTROCKWELL
  520. XThe instruction is in the ROCKWELL, ROCKWELL CMOS, and R65c00/21 instruction
  521. Xsets.
  522. X.LI INST21
  523. XThe instruction is in the R65c00/21 instruction set.
  524. X.LE
  525. X.H 3 "Apostrophes"
  526. XThe apostrophes in the syntax field are a notation used for the
  527. Xparser generator and are not put in the assembler source statement.
  528. X.H 2 "Notes"
  529. X.H 3 "Top Expressions"
  530. XThe syntax of some of the instructions combined with the standard expression
  531. Xsyntax resulted in confusion whether an operand was an expression surrounded 
  532. Xby parenthesis, or a indexed reference.  
  533. XTo get around this, the expressions in these ambiguous cases were restricted
  534. Xto those forms of expression that don't have surrounding parenthesis at the 
  535. Xtop level.
  536. XSubexpressions may be parenthesized, but only if an operator seperates or
  537. Xprecedes the subexpression.
  538. X.DS I N
  539. XExample
  540. X.SP
  541. Xlda 47h,y    ; load absolute, y 
  542. Xlda +(47h),y    ; load absolute, y 
  543. Xlda (47h),y    ; load (indirect), y 
  544. Xlda ((47h)),y    ; error
  545. X.DE
  546. X.H 3 "Reserved Symbols"
  547. X.H 4 "Machine Dependent Reserved Symbols"
  548. XA
  549. XX
  550. XY
  551. Xa
  552. Xx
  553. Xy
  554. X.H 4 "Standard Reserved Symbols"
  555. XAND
  556. XDEFINED
  557. XEQ
  558. XGE
  559. XGT
  560. XHIGH
  561. XLE
  562. XLOW
  563. XLT
  564. XMOD
  565. XNE
  566. XNOT
  567. XOR
  568. XSHL
  569. XSHR
  570. XXOR
  571. Xand
  572. Xdefined
  573. Xeq
  574. Xge
  575. Xgt
  576. Xhigh
  577. Xle
  578. Xlow
  579. Xlt
  580. Xmod
  581. Xne
  582. Xnot
  583. Xor
  584. Xshl
  585. Xshr
  586. Xxor
  587. X.TC 1 1 7
  588. SHAR_EOF
  589. true || echo 'restore of as6502.doc failed'
  590. fi
  591. # ============= as6502.tst ==============
  592. if test -f 'as6502.tst' -a X"$1" != X"-c"; then
  593.     echo 'x - skipping as6502.tst (File already exists)'
  594. else
  595. echo 'x - extracting as6502.tst (Text)'
  596. sed 's/^X//' << 'SHAR_EOF' > 'as6502.tst' &&
  597. X    cpu    "r65c"
  598. Ximmed    equ    $55
  599. Xdirect    equ    $44
  600. Xextend    equ    $1234
  601. X    adc    # immed
  602. X    adc    ( direct, x )
  603. X    adc    (direct)
  604. X    adc    (direct),y
  605. X    adc    direct
  606. X    adc    direct,x
  607. X    adc    extend
  608. X    adc    extend,x
  609. X    adc    extend,y
  610. X    and    # immed
  611. X    and    ( direct, x )
  612. X    and    (direct)
  613. X    and    (direct),y
  614. X    and    direct
  615. X    and    direct,x
  616. X    and    extend
  617. X    and    extend,x
  618. X    and    extend,y
  619. X    asl    a
  620. X    asl    direct
  621. X    asl    direct,x
  622. X    asl    extend
  623. X    asl    extend,x
  624. X    bbr0    direct, jmpdst
  625. X    bbr1    direct, jmpdst
  626. X    bbr2    direct, jmpdst
  627. X    bbr3    direct, jmpdst
  628. X    bbr4    direct, jmpdst
  629. X    bbr5    direct, jmpdst
  630. X    bbr6    direct, jmpdst
  631. X    bbr7    direct, jmpdst
  632. X    bbs0    direct, jmpdst
  633. X    bbs1    direct, jmpdst
  634. X    bbs2    direct, jmpdst
  635. X    bbs3    direct, jmpdst
  636. X    bbs4    direct, jmpdst
  637. X    bbs5    direct, jmpdst
  638. X    bbs6    direct, jmpdst
  639. X    bbs7    direct, jmpdst
  640. Xjmpdst    bcc    jmpdst
  641. X    bcs    jmpdst
  642. X    beq    jmpdst
  643. X    bge    jmpdst
  644. X    bit    # immed
  645. X    bit    direct
  646. X    bit    direct ,x
  647. X    bit    extend
  648. X    bit    extend, x
  649. X    blt    jmpdst
  650. X    bmi    jmpdst
  651. X    bne    jmpdst
  652. X    bpl    jmpdst
  653. X    bra    jmpdst
  654. X    brk
  655. X    brk    #99
  656. X    bvc    jmpdst
  657. X    bvs    jmpdst
  658. X    clc
  659. X    cld
  660. X    cli
  661. X    clv
  662. X    cmp    # immed
  663. X    cmp    ( direct, x )
  664. X    cmp    (direct)
  665. X    cmp    (direct),y
  666. X    cmp    direct
  667. X    cmp    direct,x
  668. X    cmp    extend
  669. X    cmp    extend,x
  670. X    cmp    extend,y
  671. X    cpx    # immed
  672. X    cpx    direct
  673. X    cpx    extend
  674. X    cpy    # immed
  675. X    cpy    direct
  676. X    cpy    extend
  677. X    dec    a
  678. X    dec    direct
  679. X    dec    direct,x
  680. X    dec    extend
  681. X    dec    extend,x
  682. X    dex
  683. X    dey
  684. X    eor    # immed
  685. X    eor    ( direct, x )
  686. X    eor    (direct)
  687. X    eor    (direct),y
  688. X    eor    direct
  689. X    eor    direct,x
  690. X    eor    extend
  691. X    eor    extend,x
  692. X    eor    extend,y
  693. X    inc    a
  694. X    inc    direct
  695. X    inc    direct,x
  696. X    inc    extend
  697. X    inc    extend,x
  698. X    inx
  699. X    iny
  700. X    jmp    (jmpdst)
  701. X    jmp    (jmpdst,x)
  702. X    jmp    jmpdst
  703. X    jsr    jmpdst
  704. X    lda    # immed
  705. X    lda    ( direct, x )
  706. X    lda    (direct)
  707. X    lda    (direct),y
  708. X    lda    direct
  709. X    lda    direct,x
  710. X    lda    extend
  711. X    lda    extend,x
  712. X    lda    extend,y
  713. X    ldx    # immed
  714. X    ldx    direct
  715. X    ldx    direct ,y
  716. X    ldx    extend
  717. X    ldx    extend, y
  718. X    ldy    # immed
  719. X    ldy    direct
  720. X    ldy    direct ,x
  721. X    ldy    extend
  722. X    ldy    extend, x
  723. X    lsr    a
  724. X    lsr    direct
  725. X    lsr    direct,x
  726. X    lsr    extend
  727. X    lsr    extend,x
  728. X    mul
  729. X    nop
  730. X    ora    # immed
  731. X    ora    ( direct, x )
  732. X    ora    (direct)
  733. X    ora    (direct),y
  734. X    ora    direct
  735. X    ora    direct,x
  736. X    ora    extend
  737. X    ora    extend,x
  738. X    ora    extend,y
  739. X    pha
  740. X    php
  741. X    phx
  742. X    phy
  743. X    pla
  744. X    plp
  745. X    plx
  746. X    ply
  747. X    rmb0    direct
  748. X    rmb1    direct
  749. X    rmb2    direct
  750. X    rmb3    direct
  751. X    rmb4    direct
  752. X    rmb5    direct
  753. X    rmb6    direct
  754. X    rmb7    direct
  755. X    rol    a
  756. X    rol    direct
  757. X    rol    direct,x
  758. X    rol    extend
  759. X    rol    extend,x
  760. X    ror    a
  761. X    ror    direct
  762. X    ror    direct,x
  763. X    ror    extend
  764. X    ror    extend,x
  765. X    rti
  766. X    rts
  767. X    sbc    # immed
  768. X    sbc    ( direct, x )
  769. X    sbc    (direct)
  770. X    sbc    (direct),y
  771. X    sbc    direct
  772. X    sbc    direct,x
  773. X    sbc    extend
  774. X    sbc    extend,x
  775. X    sbc    extend,y
  776. X    sec
  777. X    sed
  778. X    sei
  779. X    smb0    direct
  780. X    smb1    direct
  781. X    smb2    direct
  782. X    smb3    direct
  783. X    smb4    direct
  784. X    smb5    direct
  785. X    smb6    direct
  786. X    smb7    direct
  787. X    sta    ( direct, x )
  788. X    sta    (direct)
  789. X    sta    (direct),y
  790. X    sta    direct
  791. X    sta    direct,x
  792. X    sta    extend
  793. X    sta    extend,x
  794. X    sta    extend,y
  795. X    stx    direct
  796. X    stx    direct,y
  797. X    stx    extend
  798. X    sty    direct
  799. X    sty    direct,x
  800. X    sty    extend
  801. X    stz    direct
  802. X    stz    direct ,x
  803. X    stz    extend
  804. X    stz    extend, x
  805. X    tax
  806. X    tay
  807. X    trb    direct
  808. X    trb    extend
  809. X    tsb    direct
  810. X    tsb    extend
  811. X    tsx
  812. X    txa
  813. X    txs
  814. X    tya
  815. SHAR_EOF
  816. true || echo 'restore of as6502.tst failed'
  817. fi
  818. # ============= as6502.tut ==============
  819. if test -f 'as6502.tut' -a X"$1" != X"-c"; then
  820.     echo 'x - skipping as6502.tut (File already exists)'
  821. else
  822. echo 'x - extracting as6502.tut (Text)'
  823. sed 's/^X//' << 'SHAR_EOF' > 'as6502.tut' &&
  824. X00000055 immed            00000044 direct           00001234 extend           
  825. X00000065 jmpdst           
  826. X                 cpu    "r65c"
  827. X 0x55                   immed    equ    $55
  828. X 0x44                   direct    equ    $44
  829. X 0x1234                 extend    equ    $1234
  830. X0000 69 55             adc    # immed
  831. X0002 61 44             adc    ( direct, x )
  832. X0004 72 44             adc    (direct)
  833. X0006 71 44             adc    (direct),y
  834. X0008 65 44             adc    direct
  835. X000a 75 44             adc    direct,x
  836. X000c 6d 34 12             adc    extend
  837. X000f 7d 34 12             adc    extend,x
  838. X0012 79 34 12             adc    extend,y
  839. X0015 29 55             and    # immed
  840. X0017 21 44             and    ( direct, x )
  841. X0019 32 44             and    (direct)
  842. X001b 31 44             and    (direct),y
  843. X001d 25 44             and    direct
  844. X001f 35 44             and    direct,x
  845. X0021 2d 34 12             and    extend
  846. X0024 3d 34 12             and    extend,x
  847. X0027 39 34 12             and    extend,y
  848. X002a 0a             asl    a
  849. X002b 06 44             asl    direct
  850. X002d 16 44             asl    direct,x
  851. X002f 0e 34 12             asl    extend
  852. X0032 1e 34 12             asl    extend,x
  853. X0035 0f 44 2d             bbr0    direct, jmpdst
  854. X0038 1f 44 2a             bbr1    direct, jmpdst
  855. X003b 2f 44 27             bbr2    direct, jmpdst
  856. X003e 3f 44 24             bbr3    direct, jmpdst
  857. X0041 4f 44 21             bbr4    direct, jmpdst
  858. X0044 5f 44 1e             bbr5    direct, jmpdst
  859. X0047 6f 44 1b             bbr6    direct, jmpdst
  860. X004a 7f 44 18             bbr7    direct, jmpdst
  861. X004d 8f 44 15             bbs0    direct, jmpdst
  862. X0050 9f 44 12             bbs1    direct, jmpdst
  863. X0053 af 44 0f             bbs2    direct, jmpdst
  864. X0056 bf 44 0c             bbs3    direct, jmpdst
  865. X0059 cf 44 09             bbs4    direct, jmpdst
  866. X005c df 44 06             bbs5    direct, jmpdst
  867. X005f ef 44 03             bbs6    direct, jmpdst
  868. X0062 ff 44 00             bbs7    direct, jmpdst
  869. X0065 90 fe         jmpdst    bcc    jmpdst
  870. X0067 b0 fc             bcs    jmpdst
  871. X0069 f0 fa             beq    jmpdst
  872. X006b b0 f8             bge    jmpdst
  873. X006d 89 55             bit    # immed
  874. X006f 24 44             bit    direct
  875. X0071 34 44             bit    direct ,x
  876. X0073 2c 34 12             bit    extend
  877. X0076 3c 34 12             bit    extend, x
  878. X0079 90 ea             blt    jmpdst
  879. X007b 30 e8             bmi    jmpdst
  880. X007d d0 e6             bne    jmpdst
  881. X007f 10 e4             bpl    jmpdst
  882. X0081 80 e2             bra    jmpdst
  883. X0083 00             brk
  884. X0084 00 63             brk    #99
  885. X0086 50 dd             bvc    jmpdst
  886. X0088 70 db             bvs    jmpdst
  887. X008a 18             clc
  888. X008b d8             cld
  889. X008c 58             cli
  890. X008d b8             clv
  891. X008e c9 55             cmp    # immed
  892. X0090 c1 44             cmp    ( direct, x )
  893. X0092 d2 44             cmp    (direct)
  894. X0094 d1 44             cmp    (direct),y
  895. X0096 c5 44             cmp    direct
  896. X0098 d5 44             cmp    direct,x
  897. X009a cd 34 12             cmp    extend
  898. X009d dd 34 12             cmp    extend,x
  899. X00a0 d9 34 12             cmp    extend,y
  900. X00a3 e0 55             cpx    # immed
  901. X00a5 e4 44             cpx    direct
  902. X00a7 ec 34 12             cpx    extend
  903. X00aa c0 55             cpy    # immed
  904. X00ac c4 44             cpy    direct
  905. X00ae cc 34 12             cpy    extend
  906. X00b1 3a             dec    a
  907. X00b2 c6 44             dec    direct
  908. X00b4 d6 44             dec    direct,x
  909. X00b6 ce 34 12             dec    extend
  910. X00b9 de 34 12             dec    extend,x
  911. X00bc ca             dex
  912. X00bd 88             dey
  913. X00be 49 55             eor    # immed
  914. X00c0 41 44             eor    ( direct, x )
  915. X00c2 52 44             eor    (direct)
  916. X00c4 51 44             eor    (direct),y
  917. X00c6 45 44             eor    direct
  918. X00c8 55 44             eor    direct,x
  919. X00ca 4d 34 12             eor    extend
  920. X00cd 5d 34 12             eor    extend,x
  921. X00d0 59 34 12             eor    extend,y
  922. X00d3 1a             inc    a
  923. X00d4 e6 44             inc    direct
  924. X00d6 f6 44             inc    direct,x
  925. X00d8 ee 34 12             inc    extend
  926. X00db fe 34 12             inc    extend,x
  927. X00de e8             inx
  928. X00df c8             iny
  929. X00e0 6c 65 00             jmp    (jmpdst)
  930. X00e3 7c 65 00             jmp    (jmpdst,x)
  931. X00e6 4c 65 00             jmp    jmpdst
  932. X00e9 20 65 00             jsr    jmpdst
  933. X00ec a9 55             lda    # immed
  934. X00ee a1 44             lda    ( direct, x )
  935. X00f0 b2 44             lda    (direct)
  936. X00f2 b1 44             lda    (direct),y
  937. X00f4 a5 44             lda    direct
  938. X00f6 b5 44             lda    direct,x
  939. X00f8 ad 34 12             lda    extend
  940. X00fb bd 34 12             lda    extend,x
  941. X00fe b9 34 12             lda    extend,y
  942. X0101 a2 55             ldx    # immed
  943. X0103 a6 44             ldx    direct
  944. X0105 b6 44             ldx    direct ,y
  945. X0107 ae 34 12             ldx    extend
  946. X010a be 34 12             ldx    extend, y
  947. X010d a0 55             ldy    # immed
  948. X010f a4 44             ldy    direct
  949. X0111 b4 44             ldy    direct ,x
  950. X0113 ac 34 12             ldy    extend
  951. X0116 bc 34 12             ldy    extend, x
  952. X0119 4a             lsr    a
  953. X011a 46 44             lsr    direct
  954. X011c 56 44             lsr    direct,x
  955. X011e 4e 34 12             lsr    extend
  956. X0121 5e 34 12             lsr    extend,x
  957. X                mul
  958. X ERROR - invalid operands/illegal instruction for cpu
  959. X0124 ea             nop
  960. X0125 09 55             ora    # immed
  961. X0127 01 44             ora    ( direct, x )
  962. X0129 12 44             ora    (direct)
  963. X012b 11 44             ora    (direct),y
  964. X012d 05 44             ora    direct
  965. X012f 15 44             ora    direct,x
  966. X0131 0d 34 12             ora    extend
  967. X0134 1d 34 12             ora    extend,x
  968. X0137 19 34 12             ora    extend,y
  969. X013a 48             pha
  970. X013b 08             php
  971. X013c da             phx
  972. X013d 5a             phy
  973. X013e 68             pla
  974. X013f 28             plp
  975. X0140 fa             plx
  976. X0141 7a             ply
  977. X0142 07 44             rmb0    direct
  978. X0144 17 44             rmb1    direct
  979. X0146 27 44             rmb2    direct
  980. X0148 37 44             rmb3    direct
  981. X014a 47 44             rmb4    direct
  982. X014c 57 44             rmb5    direct
  983. X014e 67 44             rmb6    direct
  984. X0150 77 44             rmb7    direct
  985. X0152 2a             rol    a
  986. X0153 26 44             rol    direct
  987. X0155 36 44             rol    direct,x
  988. X0157 2e 34 12             rol    extend
  989. X015a 3e 34 12             rol    extend,x
  990. X015d 6a             ror    a
  991. X015e 66 44             ror    direct
  992. X0160 76 44             ror    direct,x
  993. X0162 6e 34 12             ror    extend
  994. X0165 7e 34 12             ror    extend,x
  995. X0168 40             rti
  996. X0169 60             rts
  997. X016a e9 55             sbc    # immed
  998. X016c e1 44             sbc    ( direct, x )
  999. X016e f2 44             sbc    (direct)
  1000. X0170 f1 44             sbc    (direct),y
  1001. X0172 e5 44             sbc    direct
  1002. X0174 f5 44             sbc    direct,x
  1003. X0176 ed 34 12             sbc    extend
  1004. X0179 fd 34 12             sbc    extend,x
  1005. X017c f9 34 12             sbc    extend,y
  1006. X017f 38             sec
  1007. X0180 f8             sed
  1008. X0181 78             sei
  1009. X0182 87 44             smb0    direct
  1010. X0184 97 44             smb1    direct
  1011. X0186 a7 44             smb2    direct
  1012. X0188 b7 44             smb3    direct
  1013. X018a c7 44             smb4    direct
  1014. X018c d7 44             smb5    direct
  1015. X018e e7 44             smb6    direct
  1016. X0190 f7 44             smb7    direct
  1017. X0192 81 44             sta    ( direct, x )
  1018. X0194 92 44             sta    (direct)
  1019. X0196 91 44             sta    (direct),y
  1020. X0198 85 44             sta    direct
  1021. X019a 95 44             sta    direct,x
  1022. X019c 8d 34 12             sta    extend
  1023. X019f 9d 34 12             sta    extend,x
  1024. X01a2 99 34 12             sta    extend,y
  1025. X01a5 86 44             stx    direct
  1026. X01a7 96 44             stx    direct,y
  1027. X01a9 8e 34 12             stx    extend
  1028. X01ac 84 44             sty    direct
  1029. X01ae 94 44             sty    direct,x
  1030. X01b0 8c 34 12             sty    extend
  1031. X01b3 64 44             stz    direct
  1032. X01b5 74 44             stz    direct ,x
  1033. X01b7 9c 34 12             stz    extend
  1034. X01ba 9e 34 12             stz    extend, x
  1035. X01bd aa             tax
  1036. X01be a8             tay
  1037. X01bf 14 44             trb    direct
  1038. X01c1 1c 34 12             trb    extend
  1039. X01c4 04 44             tsb    direct
  1040. X01c6 0c 34 12             tsb    extend
  1041. X01c9 ba             tsx
  1042. X01ca 8a             txa
  1043. X01cb 9a             txs
  1044. X01cc 98             tya
  1045. X ERROR SUMMARY - ERRORS DETECTED 1
  1046. X               -  WARNINGS       0
  1047. SHAR_EOF
  1048. true || echo 'restore of as6502.tut failed'
  1049. fi
  1050. true || echo 'restore of as6502.y failed'
  1051. echo End of part 1, continue with part 2
  1052. exit 0
  1053.