home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / program / compiler / fasbin21 / fas_src / as6502 / as6502.doc < prev    next >
Text File  |  1990-12-11  |  10KB  |  499 lines

  1. .HM A 1 1 1 1 1 1
  2. .H 1 "Appendix for as6502 Frankenstein Assembler"
  3. .H 2 "Pseudo Operations"
  4. .H 3 "Standard Pseudo Operation Mnemonics"
  5. .VL 40 5 1
  6. .LI "End"
  7. END
  8. .LI "File Inclusion"
  9. INCL
  10. INCLUDE
  11. .LI "If"
  12. IF
  13. .LI "Else"
  14. ELSE
  15. .LI "End If"
  16. ENDI
  17. .LI "Equate"
  18. EQU
  19. .LI "Set"
  20. SET
  21. .LI "Org"
  22. ORG
  23. .LI "Reserve Memory"
  24. RESERVE
  25. RMB
  26. .LI "Define Byte Data"
  27. BYTE
  28. DB
  29. FCB
  30. .LI "Define Word Data"
  31. DW
  32. FDB
  33. WORD
  34. .LI "Define String Data"
  35. FCC
  36. STRING
  37. .LI "Define Character Set Translation"
  38. CHARSET
  39. .LI "Define Character Value"
  40. CHARDEF
  41. CHD
  42. .LI "Use Character Translation"
  43. CHARUSE
  44. .LE
  45. .H 3 "Machine Dependent Pseudo Operations"
  46. .H 4 "Define Word Data"
  47. The define word pseudo-operations generates the byte reversed (low byte, high
  48. byte) representation.
  49. .H 4 "Instruction Set Selection"
  50. .DS I N
  51. CPU string
  52. .DE
  53. The instruction set can be specified in the source file with the CPU 
  54. pseudooperation.
  55. The string, delimited by quotes or apostrophes, is scanned for a
  56. substring which selects which instruction set is used.
  57. When the program is invoked, this operation is performed on the name of
  58. the program, then the -p optional arguement, if any, and then any CPU
  59. statements.
  60. The last one selects which subset of the instructions the assembler will
  61. accept.
  62. The instruction set can be changed at any place in the source file. 
  63. .DS
  64. .VL 30 5 1
  65. .LI "Instruction Set"
  66. Substrings
  67. .LI "ROCKWELL CMOS"
  68. R65C
  69. r65c
  70. .LI "CMOS"
  71. 65C
  72. 65c
  73. .LI "ROCKWELL Extended"
  74. R65
  75. r65
  76. .LI "R65C00/21"
  77. 21
  78. .LI "Standard NMOS"
  79. 65
  80. .LE
  81. .DE
  82. .H 2 "Instructions"
  83. .H 3 "Instruction List"
  84. .TS H
  85. ;
  86. l l l.
  87. Opcode    Syntax    Selection Criteria
  88. .sp
  89. .TH
  90. .sp
  91. ADC     '#' topexpr
  92. ADC     '(' topexpr ')' ',' INDEX    DIRECT INDEXY
  93. ADC     '(' topexpr ')'    DIRECT INSTCMOS
  94. ADC     '(' topexpr ',' INDEX ')'    DIRECT INDEXX
  95. ADC     topexpr ',' INDEX    DIRECT INDEXX
  96. ADC     topexpr ',' INDEX    EXTENDED INDEXX
  97. ADC     topexpr ',' INDEX    INDEXY
  98. ADC     topexpr    DIRECT
  99. ADC     topexpr    EXTENDED
  100. .sp
  101. AND     '#' topexpr
  102. AND     '(' topexpr ')' ',' INDEX    DIRECT INDEXY
  103. AND     '(' topexpr ')'    DIRECT INSTCMOS
  104. AND     '(' topexpr ',' INDEX ')'    DIRECT INDEXX
  105. AND     topexpr ',' INDEX    DIRECT INDEXX
  106. AND     topexpr ',' INDEX    EXTENDED INDEXX
  107. AND     topexpr ',' INDEX    INDEXY
  108. AND     topexpr    DIRECT
  109. AND     topexpr    EXTENDED
  110. .sp
  111. ASL     ACCUM
  112. ASL     topexpr ',' INDEX    DIRECT INDEXX
  113. ASL     topexpr ',' INDEX    EXTENDED INDEXX
  114. ASL     topexpr    DIRECT
  115. ASL     topexpr    EXTENDED
  116. .sp
  117. BBR0     topexpr ',' topexpr    INSTROCKWELL
  118. .sp
  119. BBR1     topexpr ',' topexpr    INSTROCKWELL
  120. .sp
  121. BBR2     topexpr ',' topexpr    INSTROCKWELL
  122. .sp
  123. BBR3     topexpr ',' topexpr    INSTROCKWELL
  124. .sp
  125. BBR4     topexpr ',' topexpr    INSTROCKWELL
  126. .sp
  127. BBR5     topexpr ',' topexpr    INSTROCKWELL
  128. .sp
  129. BBR6     topexpr ',' topexpr    INSTROCKWELL
  130. .sp
  131. BBR7     topexpr ',' topexpr    INSTROCKWELL
  132. .sp
  133. BBS0     topexpr ',' topexpr    INSTROCKWELL
  134. .sp
  135. BBS1     topexpr ',' topexpr    INSTROCKWELL
  136. .sp
  137. BBS2     topexpr ',' topexpr    INSTROCKWELL
  138. .sp
  139. BBS3     topexpr ',' topexpr    INSTROCKWELL
  140. .sp
  141. BBS4     topexpr ',' topexpr    INSTROCKWELL
  142. .sp
  143. BBS5     topexpr ',' topexpr    INSTROCKWELL
  144. .sp
  145. BBS6     topexpr ',' topexpr    INSTROCKWELL
  146. .sp
  147. BBS7     topexpr ',' topexpr    INSTROCKWELL
  148. .sp
  149. BCC     topexpr
  150. .sp
  151. BCS     topexpr
  152. .sp
  153. BEQ     topexpr
  154. .sp
  155. BGE     topexpr
  156. .sp
  157. BIT     '#' topexpr    INSTCMOS
  158. BIT     topexpr ',' INDEX    DIRECT INDEXX INSTCMOS
  159. BIT     topexpr ',' INDEX    EXTENDED INDEXX INSTCMOS
  160. BIT     topexpr    DIRECT
  161. BIT     topexpr    EXTENDED
  162. .sp
  163. BLT     topexpr
  164. .sp
  165. BMI     topexpr
  166. .sp
  167. BNE     topexpr
  168. .sp
  169. BPL     topexpr
  170. .sp
  171. BRA     topexpr    INST21
  172. BRA     topexpr    INSTCMOS
  173. .sp
  174. BRK     '#' topexpr
  175. BRK    
  176. .sp
  177. BVC     topexpr
  178. .sp
  179. BVS     topexpr
  180. .sp
  181. CLC    
  182. .sp
  183. CLD    
  184. .sp
  185. CLI    
  186. .sp
  187. CLV    
  188. .sp
  189. CMP     '#' topexpr
  190. CMP     '(' topexpr ')' ',' INDEX    DIRECT INDEXY
  191. CMP     '(' topexpr ')'    DIRECT INSTCMOS
  192. CMP     '(' topexpr ',' INDEX ')'    DIRECT INDEXX
  193. CMP     topexpr ',' INDEX    DIRECT INDEXX
  194. CMP     topexpr ',' INDEX    EXTENDED INDEXX
  195. CMP     topexpr ',' INDEX    INDEXY
  196. CMP     topexpr    DIRECT
  197. CMP     topexpr    EXTENDED
  198. .sp
  199. CPX     '#' topexpr
  200. CPX     topexpr    DIRECT
  201. CPX     topexpr    EXTENDED
  202. .sp
  203. CPY     '#' topexpr
  204. CPY     topexpr    DIRECT
  205. CPY     topexpr    EXTENDED
  206. .sp
  207. DEC     ACCUM    INSTCMOS
  208. DEC     topexpr ',' INDEX    DIRECT INDEXX
  209. DEC     topexpr ',' INDEX    EXTENDED INDEXX
  210. DEC     topexpr    DIRECT
  211. DEC     topexpr    EXTENDED
  212. .sp
  213. DEX    
  214. .sp
  215. DEY    
  216. .sp
  217. EOR     '#' topexpr
  218. EOR     '(' topexpr ')' ',' INDEX    DIRECT INDEXY
  219. EOR     '(' topexpr ')'    DIRECT INSTCMOS
  220. EOR     '(' topexpr ',' INDEX ')'    DIRECT INDEXX
  221. EOR     topexpr ',' INDEX    DIRECT INDEXX
  222. EOR     topexpr ',' INDEX    EXTENDED INDEXX
  223. EOR     topexpr ',' INDEX    INDEXY
  224. EOR     topexpr    DIRECT
  225. EOR     topexpr    EXTENDED
  226. .sp
  227. INC     ACCUM    INSTCMOS
  228. INC     topexpr ',' INDEX    DIRECT INDEXX
  229. INC     topexpr ',' INDEX    EXTENDED INDEXX
  230. INC     topexpr    DIRECT
  231. INC     topexpr    EXTENDED
  232. .sp
  233. INX    
  234. .sp
  235. INY    
  236. .sp
  237. JMP     '(' topexpr ')'
  238. JMP     '(' topexpr ',' INDEX ')'    INSTCMOS INDEXX
  239. JMP     topexpr
  240. .sp
  241. JSR     topexpr
  242. .sp
  243. LDA     '#' topexpr
  244. LDA     '(' topexpr ')' ',' INDEX    DIRECT INDEXY
  245. LDA     '(' topexpr ')'    DIRECT INSTCMOS
  246. LDA     '(' topexpr ',' INDEX ')'    DIRECT INDEXX
  247. LDA     topexpr ',' INDEX    DIRECT INDEXX
  248. LDA     topexpr ',' INDEX    EXTENDED INDEXX
  249. LDA     topexpr ',' INDEX    INDEXY
  250. LDA     topexpr    DIRECT
  251. LDA     topexpr    EXTENDED
  252. .sp
  253. LDX     '#' topexpr
  254. LDX     topexpr ',' INDEX    DIRECT INDEXY
  255. LDX     topexpr ',' INDEX    EXTENDED INDEXY
  256. LDX     topexpr    DIRECT
  257. LDX     topexpr    EXTENDED
  258. .sp
  259. LDY     '#' topexpr
  260. LDY     topexpr ',' INDEX    DIRECT INDEXX
  261. LDY     topexpr ',' INDEX    EXTENDED INDEXX
  262. LDY     topexpr    DIRECT
  263. LDY     topexpr    EXTENDED
  264. .sp
  265. LSR     ACCUM
  266. LSR     topexpr ',' INDEX    DIRECT INDEXX
  267. LSR     topexpr ',' INDEX    EXTENDED INDEXX
  268. LSR     topexpr    DIRECT
  269. LSR     topexpr    EXTENDED
  270. .sp
  271. MUL        INST21
  272. .sp
  273. NOP    
  274. .sp
  275. ORA     '#' topexpr
  276. ORA     '(' topexpr ')' ',' INDEX    DIRECT INDEXY
  277. ORA     '(' topexpr ')'    DIRECT INSTCMOS
  278. ORA     '(' topexpr ',' INDEX ')'    DIRECT INDEXX
  279. ORA     topexpr ',' INDEX    DIRECT INDEXX
  280. ORA     topexpr ',' INDEX    EXTENDED INDEXX
  281. ORA     topexpr ',' INDEX    INDEXY
  282. ORA     topexpr    DIRECT
  283. ORA     topexpr    EXTENDED
  284. .sp
  285. PHA    
  286. .sp
  287. PHP    
  288. .sp
  289. PHX        INST21
  290. PHX        INSTCMOS
  291. .sp
  292. PHY        INST21
  293. PHY        INSTCMOS
  294. .sp
  295. PLA    
  296. .sp
  297. PLP    
  298. .sp
  299. PLX        INST21
  300. PLX        INSTCMOS
  301. .sp
  302. PLY        INST21
  303. PLY        INSTCMOS
  304. .sp
  305. RMB0     topexpr    INSTROCKWELL
  306. .sp
  307. RMB1     topexpr    INSTROCKWELL
  308. .sp
  309. RMB2     topexpr    INSTROCKWELL
  310. .sp
  311. RMB3     topexpr    INSTROCKWELL
  312. .sp
  313. RMB4     topexpr    INSTROCKWELL
  314. .sp
  315. RMB5     topexpr    INSTROCKWELL
  316. .sp
  317. RMB6     topexpr    INSTROCKWELL
  318. .sp
  319. RMB7     topexpr    INSTROCKWELL
  320. .sp
  321. ROL     ACCUM
  322. ROL     topexpr ',' INDEX    DIRECT INDEXX
  323. ROL     topexpr ',' INDEX    EXTENDED INDEXX
  324. ROL     topexpr    DIRECT
  325. ROL     topexpr    EXTENDED
  326. .sp
  327. ROR     ACCUM
  328. ROR     topexpr ',' INDEX    DIRECT INDEXX
  329. ROR     topexpr ',' INDEX    EXTENDED INDEXX
  330. ROR     topexpr    DIRECT
  331. ROR     topexpr    EXTENDED
  332. .sp
  333. RTI    
  334. .sp
  335. RTS    
  336. .sp
  337. SBC     '#' topexpr
  338. SBC     '(' topexpr ')' ',' INDEX    DIRECT INDEXY
  339. SBC     '(' topexpr ')'    DIRECT INSTCMOS
  340. SBC     '(' topexpr ',' INDEX ')'    DIRECT INDEXX
  341. SBC     topexpr ',' INDEX    DIRECT INDEXX
  342. SBC     topexpr ',' INDEX    EXTENDED INDEXX
  343. SBC     topexpr ',' INDEX    INDEXY
  344. SBC     topexpr    DIRECT
  345. SBC     topexpr    EXTENDED
  346. .sp
  347. SEC    
  348. .sp
  349. SED    
  350. .sp
  351. SEI    
  352. .sp
  353. SMB0     topexpr    INSTROCKWELL
  354. .sp
  355. SMB1     topexpr    INSTROCKWELL
  356. .sp
  357. SMB2     topexpr    INSTROCKWELL
  358. .sp
  359. SMB3     topexpr    INSTROCKWELL
  360. .sp
  361. SMB4     topexpr    INSTROCKWELL
  362. .sp
  363. SMB5     topexpr    INSTROCKWELL
  364. .sp
  365. SMB6     topexpr    INSTROCKWELL
  366. .sp
  367. SMB7     topexpr    INSTROCKWELL
  368. .sp
  369. STA     '(' topexpr ')' ',' INDEX    DIRECT INDEXY
  370. STA     '(' topexpr ')'    DIRECT INSTCMOS
  371. STA     '(' topexpr ',' INDEX ')'    DIRECT INDEXX
  372. STA     topexpr ',' INDEX    DIRECT INDEXX
  373. STA     topexpr ',' INDEX    EXTENDED INDEXX
  374. STA     topexpr ',' INDEX    INDEXY
  375. STA     topexpr    DIRECT
  376. STA     topexpr    EXTENDED
  377. .sp
  378. STX     topexpr ',' INDEX    DIRECT INDEXY
  379. STX     topexpr    DIRECT
  380. STX     topexpr    EXTENDED
  381. .sp
  382. STY     topexpr ',' INDEX    DIRECT INDEXX
  383. STY     topexpr    DIRECT
  384. STY     topexpr    EXTENDED
  385. .sp
  386. STZ     topexpr ',' INDEX    DIRECT INDEXX INSTCMOS
  387. STZ     topexpr ',' INDEX    EXTENDED INDEXX INSTCMOS
  388. STZ     topexpr    DIRECT INSTCMOS
  389. STZ     topexpr    EXTENDED INSTCMOS
  390. .sp
  391. TAX    
  392. .sp
  393. TAY    
  394. .sp
  395. TRB     topexpr    DIRECT INSTCMOS
  396. TRB     topexpr    EXTENDED INSTCMOS
  397. .sp
  398. TSB     topexpr    DIRECT INSTCMOS
  399. TSB     topexpr    EXTENDED INSTCMOS
  400. .sp
  401. TSX    
  402. .sp
  403. TXA    
  404. .sp
  405. TXS    
  406. .sp
  407. TYA    
  408. .TE
  409. .H 3 "Operands"
  410. .VL 25 5
  411. .LI ACCUM
  412. The a or (A) reserved symbol
  413. .LI INDEX
  414. The x or y (or X or Y) reserved symbols
  415. .LE
  416. .H 3 "Selection Criteria Keywords"
  417. .VL 25 5 
  418. .LI DIRECT
  419. The instruction can use the direct addressing mode.  
  420. The expression must have a value between 0 and 255 that is defined when the
  421. instruction is processed in the input pass.
  422. .LI EXTENDED
  423. The instruction can use the extended (16 bit address) mode.
  424. .LI INDEXX
  425. The instruction can use the X index.
  426. .LI INDEXY
  427. The instruction can use the Y index.
  428. .LI INSTCMOS
  429. The instruction is in the CMOS and ROCKWELL CMOS instruction sets.
  430. .LI INSTROCKWELL
  431. The instruction is in the ROCKWELL, ROCKWELL CMOS, and R65c00/21 instruction
  432. sets.
  433. .LI INST21
  434. The instruction is in the R65c00/21 instruction set.
  435. .LE
  436. .H 3 "Apostrophes"
  437. The apostrophes in the syntax field are a notation used for the
  438. parser generator and are not put in the assembler source statement.
  439. .H 2 "Notes"
  440. .H 3 "Top Expressions"
  441. The syntax of some of the instructions combined with the standard expression
  442. syntax resulted in confusion whether an operand was an expression surrounded 
  443. by parenthesis, or a indexed reference.  
  444. To get around this, the expressions in these ambiguous cases were restricted
  445. to those forms of expression that don't have surrounding parenthesis at the 
  446. top level.
  447. Subexpressions may be parenthesized, but only if an operator seperates or
  448. precedes the subexpression.
  449. .DS I N
  450. Example
  451. .SP
  452. lda 47h,y    ; load absolute, y 
  453. lda +(47h),y    ; load absolute, y 
  454. lda (47h),y    ; load (indirect), y 
  455. lda ((47h)),y    ; error
  456. .DE
  457. .H 3 "Reserved Symbols"
  458. .H 4 "Machine Dependent Reserved Symbols"
  459. A
  460. X
  461. Y
  462. a
  463. x
  464. y
  465. .H 4 "Standard Reserved Symbols"
  466. AND
  467. DEFINED
  468. EQ
  469. GE
  470. GT
  471. HIGH
  472. LE
  473. LOW
  474. LT
  475. MOD
  476. NE
  477. NOT
  478. OR
  479. SHL
  480. SHR
  481. XOR
  482. and
  483. defined
  484. eq
  485. ge
  486. gt
  487. high
  488. le
  489. low
  490. lt
  491. mod
  492. ne
  493. not
  494. or
  495. shl
  496. shr
  497. xor
  498. .TC 1 1 7
  499.