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

  1. .TL
  2. Frankenstein Cross Assemblers Users Manual
  3. .AU "Mark Zenier"
  4. .AF
  5. .MT 4
  6. .H 1 "Disclaimer"
  7. This software is in the public domain.  Any prior copyright claims
  8. are relinquished.  
  9. .P
  10. This software is distributed with no warranty whatever.  The author
  11. takes no responsibility for the consequences of its use.
  12. .H 1 "Introduction"
  13. .H 2 "This Manual"
  14. This manual covers the basic features for the Frankenstein cross assemblers.
  15. The specific features for a given target architecture will be covered
  16. in the appendix for that cross-assembler.
  17. .H 2 "Notation"
  18. Items enclosed in [] are optional. The "[]" are not entered in the
  19. source statement or command line, and are just a notation.
  20. .H 1 "Invocation"
  21. name [-o binary] [-l listing] [-s symbols] [-d] input
  22. .P
  23. The optional operands on the command line can be in any order.
  24. .H 2 "Input File"
  25. The input file must appear after the optional entries on the command line.
  26. Only one input file is used with this version. 
  27. If the file name is a single minus sign, the standard input is used.
  28. .H 2 "Listing File"
  29. .DS I N
  30. -l filename
  31. .DE
  32. .P
  33. An annotated listing will only be produced if an optional list file is
  34. provided, otherwise the error messages and summary will be output to the
  35. console.
  36. There is no required suffix or default extension for the file name.
  37. .H 2 "Hex Output File"
  38. .DS I N
  39. -h filename or
  40. -o filename
  41. .DE
  42. .P
  43. The binary output will only be produced if the optional file is provided.
  44. See the section in the description of the output files for the format
  45. of the data records.
  46. If any errors occur, the hex output file is either not created
  47. or is deleted depending on whether the error occurred in the
  48. input or output phases of processing.
  49. There is no required suffix or default extension for the file name.
  50. .H 2 "Symbol Listing File"
  51. .DS I N
  52. -s filename
  53. .DE
  54. .P
  55. The symbol table is dumped with one entry per line for whatever use is 
  56. desired, normally with the sort utility to produce symbol listings in 
  57. a different order that the one provided.
  58. See the section on the output files for a description of the format.
  59. There is no required suffix or default extension for the file name.
  60. .H 2 "Debug"
  61. .SP 
  62. The -d debug option
  63. .DL
  64. .LI
  65. Saves the intermediate file in the /usr/tmp directory
  66. .LI
  67. Calls the abort() system call to produce a "core" file
  68. .LE
  69. .H 2 "Processor Selection"
  70. .DS I N
  71. assembler name or
  72. -p string
  73. .DE
  74. .P
  75. Some of these assemblers support related families of processors, and
  76. can be limited to specific subsets of the total instructions by sending
  77. the processor number or name as an operand.  The operand is scanned for
  78. unique substrings which identify the target processor.
  79. The operand can be either the name of the executable, or the operand
  80. of the -p option, with the operand of the -p having precedence.
  81. The name of the executable may not available in some operating systems.
  82. The CPU pseudo-operation has precedence over both the name scan and
  83. the -p operand [see the appendix for the specific processor].
  84. .DS I N
  85. Example
  86. .SP
  87. a6800 for the mc6800 instruction set
  88. a6801 for the 6801/6803 instruction set
  89. a6811 for the mc68hc11 instruction set
  90. .DE
  91. .H 1 "Source Input File"
  92. The source input is a text file a with one statement per line.
  93. Adjacent symbols must be separated by spaces or tabs or special characters 
  94. such as operators or parenthesis. 
  95. .H 2 "Input Lines"
  96. .SP
  97. Source lines consist of up to four parts
  98. .DS I N
  99. [Label] [Opcode [Operands] ] [; comments]
  100. .DE
  101. .VL +10
  102. .LI Labels
  103. A symbol that starts in the first column of the line is a
  104. label.  
  105. A label is used as the defining instance of a symbol, the place
  106. where it is given a value, normally the address of the location
  107. in memory where the data generated by the rest of the statement is placed.
  108. Labels are optional for target machine instructions statements.
  109. Label are required on some pseudo-operations, and are not allowed on others.
  110. .LI Opcode
  111. The first symbol in a line that doesn't start in
  112. column 1 is treated as an opcode, all symbols after that are
  113. treated as symbol references.
  114. Opcodes are treated as a separate set of symbols, so a label
  115. can have the same character string as an opcode.  
  116. Opcodes are converted to uppercase for comparison, so case is not 
  117. significant.
  118. .LI Operands
  119. The rest of the line is the operands associated with the opcode.
  120. These are expressions, symbol references, or other syntactic elements
  121. determined by the specific operation.
  122. .LI Comments
  123. Comments start with a ';', anything on a line after a
  124. semicolon is ignored.
  125. Lines that consist of only a comment are treated as empty lines.
  126. .LE
  127. .DS I N
  128. Example
  129.  
  130. ; just a little example
  131.     org $700
  132. label    equ *  ; set label to current location
  133.     adda    #$21 ; a 6800 example
  134.     end
  135. .DE
  136. .H 3 "Limitations"
  137. Input lines should be shorter than 256 characters.
  138. An error message is issued if lines are longer.
  139. .H 3 "Empty"
  140. Empty lines are ignored as input, but are copied to the listing
  141. file.
  142. .H 2 "Syntactic Elements"
  143. .H 3 "Symbols"
  144. Symbols are strings of characters.  The first of which is one of
  145. the following.
  146. .DS I N
  147. A-Z a-z ! & ^ _ ~
  148. .DE
  149. .P
  150. The rest of the string consists of zero or more of the 
  151. following.
  152. .DS I N
  153. 0-9 A-Z a-z ! & ^ _ ~
  154. .DE
  155. .P
  156. There is no length limit to symbols, all characters are
  157. significant.  Case is significant.
  158. .H 3 "Reserved Variables Names"
  159. Machine specific names, and operator names that can appear in
  160. symbolic expressions share the same symbol table with labels,
  161. and cannot be used as labels.  The list will vary from machine
  162. to machine.  Case is significant for these symbols. 
  163. .DS I F
  164. Examples
  165. .SP
  166. and defined eq ge gt high le low lt mod ne
  167. not or shl shr xor AND DEFINED EQ GE GT HIGH
  168. LE LOW LT MOD NE NOT OR SHL SHR XOR
  169. .DE
  170. .H 3 "Numeric Constants"
  171. numeric constants can be specified in decimal, hexadecimal,
  172. octal, and binary.  Constants are maintained as long 
  173. variables, but the instruction generation will cause an error
  174. if the value is too big to fit in its destination field.
  175. .H 4 "Decimal Constants"
  176. .DL
  177. .LI
  178. one or more decimal characters (0-9) followed by an
  179. optional "d" or "D" base designator.
  180. .LE
  181. .H 4 "Hexadecimal Constants"
  182.  
  183. .P 1
  184. Either 
  185. .DL
  186. .LI
  187. one or more hexadecimal characters
  188. (0-9 a-f A-F) preceded by a "$" base designator.
  189. .LI
  190. a decimal character (0-9) followed by zero or
  191. more hexadecimal characters (0-9 a-f A-F) 
  192. followed by a "h" or "H" base designator
  193. .LE
  194. .H 4 "Octal Constants"
  195.  
  196. .P 1
  197. Either
  198. .DL
  199. .LI
  200. one or more octal characters (0-7) preceded
  201. by a "@" base designator
  202. .LI
  203. one or more octal characters (0-7) followed
  204. by a "o" or "O" or "q" or "Q" base designator.
  205. Note: this is the letter "O" not the number "0".
  206. .LE
  207. .H 4 "Binary Constants"
  208.  
  209. .P 1
  210. Either
  211. .DL
  212. .LI
  213. one or more binary characters (0 or 1) preceded
  214. by a "%" base designator.
  215. .LI
  216. one or more binary characters (0 or 1) followed
  217. by a "b" or "B" base designator.
  218. .LE
  219. .H 4 "Examples"
  220. .VL +15 +5 1
  221. .LI 123
  222. decimal number
  223. .LI 123d
  224. decimal number
  225. .LI $faf 
  226. hexadecimal number
  227. .LI 0fafh
  228. hexadecimal number, note leading zero used to differentiate this from symbol 
  229. "fafh"
  230. .LI @1234
  231. octal number
  232. .LI 1234Q
  233. octal number
  234. .LI %010101
  235. binary number
  236. .LI 010101b
  237. binary number
  238. .LE
  239. .H 3 "String Constants"
  240. String constants are specified using either the quotation mark
  241. " or the apostrophe '.  A string starting with one of these 
  242. character is terminated by only that character and can contain
  243. the other string delimiter as data.  
  244. A string with no characters is valid.
  245. .P
  246. The values generated in the binary output can be different from
  247. the host computers character set (the default).  
  248. See the section on Defining Target Character Sets.
  249. .P
  250. Within the character string, the backslash is an escape character.
  251. .VL +20 +5 1
  252. .LI " \ec Character escapes"
  253. .LI "\ "
  254. The only characters defined for
  255. the default (no) translation are \e\e \e" \e\'.  
  256. Any other translation, (the control characters '\en', '\er', etc.) require
  257. a translation table be defined.
  258. Values can be set up for any character following the backslash escape 
  259. except x and 0 through 7.  
  260. .SP
  261. .LI " \e777 Octal character escapes"
  262. .LI "\ "
  263. An one, two or three character octal constant.  The one byte value
  264. is the binary representation of the number. 
  265. The value is masked off for a maximum value of 255.
  266. .SP
  267. .LI " \exFF Hexadecimal character escapes"
  268. .LI "\ "
  269. A one or two character hexadecimal constant, preceded by a lower
  270. case x.  Upper and lower case characters A through F are valid.
  271. The one byte value is the binary representation of the number. 
  272. .SP
  273. .LE
  274. .DS I N
  275. Examples
  276. .SP
  277.     "this isn't illegal"
  278.     'this is the other delimiter'
  279.     '"'
  280.     "\exfe\e0\en"
  281. .DE
  282. .H 2 "Expressions"
  283. .SP
  284. Expressions consist of
  285. .DL "" 1
  286. .LI
  287. Symbolic References
  288. .LI
  289. Location Counter References
  290. .LI
  291. Numeric Constants
  292. .LI
  293. String Constants
  294. .LI
  295. Operators
  296. .LE
  297. .P
  298. Expressions are used as operands in statements where any numeric value or 
  299. memory address is desired.
  300. .H 3 "Symbols"
  301. A symbol reference is the name of an item in the symbol table, which
  302. has a numeric value associated with it.
  303. This value is either the memory address of the statement which has this
  304. symbol as a label, or the value of the expression defined in a SET or EQU
  305. statement which has this symbol as a label. 
  306. .H 4 "Forward References"
  307. During the input phase of processing, a symbol value may not be known if the 
  308. definition of the symbol has not yet occurred.
  309. Some pseudo-operations require that their operand expressions have a value
  310. at the input phase, so no references to as yet undefined symbols can occur
  311. in this case.
  312. In the output phase of processing, it will result in an error if any of the
  313. symbols used in expressions do not have values defined.
  314. .H 4 "Reserved Symbols for Operators"
  315. Using reserved symbols as labels will result in a syntax error as they
  316. are predefined as a different type of syntactic element than the rest
  317. of the symbol table.  
  318. Operators for which there is no special character representation, and items 
  319. like machine register names and condition code types will be represented by
  320. reserved symbols.
  321. The set of the reserved symbols will vary for
  322. each target machine, and will be documented in the appendix for each target.
  323. .H 3 "Location Counter"
  324. The special name '*' used in an expression represents the location of the
  325. first byte of the binary output for the current statement.
  326. Some assemblers use some other character for source code compatiblity.
  327. .H 3 "Constants"
  328. The form of numeric constants is defined in the previous section.
  329. .H 3 "Strings"
  330. String constants, as defined in the previous section, are valid in
  331. expressions.
  332. However, at most the first two characters are used.
  333. If the string is the null string, i.e. "", the numeric value is zero.
  334. If the string is one character long, the value is the value of
  335. the current character set translation, or the host computers character
  336. set if no translation is active.
  337. If the string is two or more characters long, the value is 
  338. 256*(the first character) + (the second character).
  339. .H 3 "Operators"
  340. .H 4 "Description"
  341. .VL +20 +5 1
  342. .LI " '+' expression "
  343. .LI "\ "
  344. Unary plus. No real effect.
  345. .SP
  346. .LI " '-' expression"
  347. .LI "\ "
  348. Unary minus, the result is the negative of the expression.
  349. .SP
  350. .LI " NOT expression"
  351. .LI "\ "
  352. Logical negation. The result is 0 if the expression is nonzero, 1 if the
  353. expression is 0.
  354. .SP
  355. .LI " HIGH expression"
  356. .LI "\ "
  357. Result is the High half of a two byte number, equivalent to 
  358. (expression SHR 8) AND $FF.
  359. .SP
  360. .LI " LOW expression"
  361. .LI "\ "
  362. Result is the Low order byte of the expression, equivalent to
  363. (expression AND $FF)
  364. .SP
  365. .LI " expression '*' expression"
  366. .LI " expression '/' expression"
  367. .LI " expression '+' expression"
  368. .LI " expression '-' expression"
  369. .LI "\ "
  370. Standard arithmetic operations.
  371. .SP
  372. .LI " expression MOD expression"
  373. .LI "\ "
  374. Result is the remainder of the division of the value of the left expression 
  375. by the right.
  376. .SP
  377. .LI " expression SHL expression"
  378. .LI " expression SHR expression"
  379. .LI "\ "
  380. Shift the value of the left expression left or right by the number of bit
  381. positions given by the right operation.
  382. .SP
  383. .LI " expression GT expression"
  384. .LI " expression GE expression"
  385. .LI " expression LT expression"
  386. .LI " expression LE expression"
  387. .LI " expression NE expression"
  388. .LI " expression EQ expression"
  389. .LI " expression '>'  expression"
  390. .LI " expression '>=' expression"
  391. .LI " expression '<'  expression"
  392. .LI " expression '<=' expression"
  393. .LI " expression '='  expression"
  394. .LI " expression '<>' expression"
  395. .LI "\ "
  396. Relational expressions.  
  397. If the relation is true, the value is 1. 
  398. If false, the value is 0.
  399. The operators are nonassociative, the  expression " 1 < 3 < 5 " is not legal.
  400. .SP
  401. .LI " expression AND expression"
  402. .LI " expression OR expression"
  403. .LI " expression XOR expression"
  404. .LI "\ "
  405. Bitwise logical operations.
  406. .SP
  407. .LI " DEFINED symbol"
  408. .LI "\ "
  409. If the symbol (not an expression) is defined, i.e. used as a label, before 
  410. this point in the input the value is 1.
  411. If not, the value is 0.
  412. .SP
  413. .LI " '(' expression ')'"
  414. .LI "\ "
  415. Parenthesis are available to override the operator precedence.
  416. .LE
  417. .H 4 "Precedence"
  418. The precedence of the operators from lowest to highest.
  419. .AL 1 "" 1
  420. .LI
  421.  HIGH LOW
  422. .LI
  423.  OR XOR
  424. .LI
  425.  AND
  426. .LI
  427.  NOT
  428. .LI
  429.  GT GE LE LT NE EQ '>' '>=' '<' '<=' '=' '<>'   
  430. .LI
  431.  '+' '-'
  432. .LI
  433.  '*' '/' MOD SHL SHR
  434. .LI
  435.  unary '+' '-'
  436. .LI
  437.  ( expression )
  438. .LE
  439. .H 1 "Statements"
  440. The names for the operations and pseudo-operations for each assembler are
  441. specified in the adaptation files,
  442. and can be different from the examples given here.
  443. .H 2 "Label Only Line"
  444. A line with only a label starting in column 1 will define that symbol
  445. with the current value of the location counter.
  446. .H 2 "End"
  447. .DS I N
  448. [Label] END 
  449. .DE
  450. .P
  451. The End statement terminates the processing of the current file.
  452. For an include file, the file is closed and input resumes in the
  453. file that contained the include statement.
  454. For the main file, processing shifts to the following passes of the
  455. assembly.
  456. The end statement is optional, as the end of file condition is treated in the
  457. same fashion.
  458. If the optional label is present, The symbol specified is used as the
  459. execution start address that is output in the binary file.  
  460. The symbol must be used as a label somewhere else in the file.
  461. When more than one start address is specified, the last one in the file is 
  462. used.
  463. .H 2 "File Inclusion"
  464. .DS I N
  465. INCLUDE "filename"
  466. INCL "filename"
  467. .DE
  468. .P
  469. The include statement shifts input from the current file to the file
  470. specified. 
  471. Input resumes from the file containing the include statement when
  472. the end of file or the End statement is reached in the included file.
  473. Includes can be nested up to the limits of the include file stack,
  474. currently a limit of 20 deep, or the limits of the operating system,
  475. whichever comes first.
  476. Includes can be recursive, i.e., a file can include itself.
  477. If a file cannot be opened, either do to an bad filename or a lack of
  478. system resources, an error is issued.
  479. .H 2 "Conditional Assembly"
  480. .H 3 "If"
  481. .DS I N
  482. IF expression 
  483. .DE
  484. .P
  485. The IF statement allows selective assembly.
  486. If the expression evaluates to a nonzero value, all statements between the 
  487. IF and the matching ELSE or ENDI are assembled.
  488. If the expression evaluates to zero, or the expression in noncomputable due
  489. to a forward reference, all statements between the IF and the matching
  490. ELSE or ENDI are ignored.
  491. .P
  492. Note: it is safer to use the DEFINED operator when testing for the existence
  493. of a symbol than to rely on the noncomputability of an expression.
  494. .P
  495. IF statements can be nested to a depth determined by a configuration 
  496. constant, currently 32.
  497. No label is allowed on an IF statement.
  498. .H 3 "Else"
  499. .DS I N
  500. ELSE 
  501. .DE
  502. .P
  503. The ELSE statement causes all statements between it and its corresponding
  504. ENDI statement to be treated the opposite of the statements between the
  505. matching IF and this statement.
  506. When the expression on the matching IF is nonzero, the statements between
  507. the ELSE and ENDI are ignored.
  508. If the IF expression failed, the statements between the ELSE and the ENDI
  509. are assembled.
  510. Labels are not allowed on ELSE statements.
  511. .H 3 "End If"
  512. .DS I N
  513. ENDI 
  514. .DE
  515. .P
  516. The ENDI statement terminates processing of its matching IF statement.
  517. Labels are not allowed on ENDI statements.
  518. .H 2 "Symbolic Constants"
  519. Symbols can be assigned numeric values with the SET and EQU statements.
  520. The expressions cannot have forward references to as yet undefined symbols.
  521. .H 3 "Equate"
  522. .DS I N
  523. Label EQU expression
  524. .DE
  525. .P
  526. The EQU statement takes the value of the expression and creates a symbol
  527. with that value.
  528. Symbols defined in EQU statements cannot already exist, or be redefined.
  529. .H 3 "Set"
  530. .DS I N
  531. Label SET expr 
  532. .DE
  533. .P
  534. The SET statement sets the symbol specified in the label field with the
  535. numeric value of the expression.
  536. The SET statement can change the value of a symbol, but only if the
  537. symbol is originally defined in a previous SET statement.
  538. .DS I N
  539. Example
  540. .SP
  541. counter set 1
  542. counter set counter+1
  543. counter set counter+1
  544. .DE
  545. .H 2 "Location Counter Value Setting"
  546. The address of the generated binary data can be changed with the ORG and
  547. reserve statements.
  548. .H 3 "Org"
  549. .DS I N
  550. [Label] ORG expression
  551. .DE
  552. .P
  553. The location counter is set to the numeric value of expression.
  554. It is an error if the expression contains references to symbols not
  555. yet defined.
  556. The optional label is set to the new value of the location counter.
  557. .H 3 "Reserve Memory"
  558. .DS I N
  559. [Label] RMB expression
  560. [Label] RESERVE expression
  561. .DE
  562. .P
  563. The reserve memory statement moves the location counter forward by
  564. the number of bytes specified in the expression.
  565. The label is set to the first location of this area.
  566. .H 2 "Data Definitions"
  567. .H 3 "Define Byte Data"
  568. .DS I N
  569. [Label]  BYTE  expression [, expression] ...
  570. [Label]  FCB   expression [, expression] ...
  571. [Label]  DB  expression [, expression] ...
  572. .DE
  573. .P
  574. The define byte statement generates one character of data for each
  575. expression in the expression list.
  576. There can be up to 128 expressions on a line, more than the line length will
  577. allow.
  578. The optional label is set to the first location of this area.
  579. .H 3 "Define Word Data"
  580. .DS I N
  581. [Label]  WORD  expression [, expression] ...
  582. [Label]  FDB   expression [, expression] ...
  583. [Label]  DW  expression [, expression] ...
  584. .DE
  585. .P
  586. The define word statement generates a two byte integer for each expression
  587. in the expression list.
  588. There can be up to 128 expressions on a line, more than the line length will
  589. allow.
  590. The byte order of the data is determined by the adaptation files for
  591. the target processor.
  592. The optional label is set to the first location of this area.
  593. .H 3 "Define String Data"
  594. .DS I N
  595. [Label] STRING string [, string] ...
  596. [Label] FCC string [, string] ...
  597. .DE
  598. .P
  599. The define string statement generates data encoded in the current character 
  600. set translation,
  601. one byte per character, excluding the delimiter characters.
  602. The optional label is set to the first location of this area.
  603. .H 2 "Defining Target Character Sets"
  604. The values generated for String Constants in both the Define String
  605. Data and in expressions can be specified on a character by character
  606. basis.  This is to support cross assembly where the target system
  607. has a different character set from the host computer.
  608. .H 3 "Define Character Set Translation"
  609. .DS I N
  610. .DE
  611. Label CHARSET
  612. .P
  613. The define character set translation statement defines a name and creates 
  614. an internal table for a character set.  
  615. The label symbol is treated like the label on an EQU statement.
  616. The value is from an internal counter and has little or no meaning
  617. outside of using it on a CHARUSE statement to specify which translation
  618. to use.  There can be up to 5 [configurable] character
  619. translation sets.
  620. A CHARSET statement must precede any CHARDEF statements.
  621. .H 3 "Define Character Value"
  622. .DS I N
  623. CHARDEF string, expression [, expression ] ...
  624. CHD string, expression [, expression ] ...
  625. .DE
  626. .P
  627. The define character value statement set the translation for one
  628. or more characters in the table defined by the preceding CHARSET
  629. statement.
  630. There can be more than one character in the string, but the
  631. number of expression in the value list must match the number
  632. of characters.
  633. Octal and Hexadecimal escape sequences cannot occur in the string.
  634. .P
  635. There are two sets in each translation table.  
  636. The first is for the characters, the second for characters escaped with 
  637. the backslash.
  638. .P
  639. Note: the characters '"' and '\e"' (and "'" and "\e'") each have an entry in 
  640. different halves of the translation tables.
  641. .H 3 "Use Character Translation"
  642. .DS I N
  643. CHARUSE
  644. CHARUSE expression
  645. .DE
  646. .P
  647. The use character translation statement changes the translation for the
  648. following statements.
  649. The statement without an expression turns off the translation, so
  650. the host character set is used.
  651. The statement with an expression (the name given on the CHARSET statement)
  652. sets the translation to the set defined in the respective CHARSET.
  653. .DS I N
  654. Example
  655. .SP
  656. ascii    charset
  657.     chardef    " !\e"#$%&\e'",$20,$21,$22,$23,$24,$25,$26,$27
  658.     chardef    "()*+,-./",$28,$29,$2a,$2b,$2c,$2d,$2e,$2f
  659.     chardef    "01234567",$30,$31,$32,$33,$34,$35,$36,$37
  660.     chardef    "89:;<=>?",$38,$39,$3a,$3b,$3c,$3d,$3e,$3f
  661.     chardef    "@ABCDEFG",$40,$41,$42,$43,$44,$45,$46,$47
  662.     chardef    "HIJKLMNO",$48,$49,$4a,$4b,$4c,$4d,$4e,$4f
  663.     chardef    "PQRSTUVW",$50,$51,$52,$53,$54,$55,$56,$57
  664.     chardef    "XYZ[\e\e]^_",$58,$59,$5a,$5b,$5c,$5d,$5e,$5f
  665.     chardef    "`abcdefg",$60,$61,$62,$63,$64,$65,$66,$67
  666.     chardef    "hijklmno",$68,$69,$6a,$6b,$6c,$6d,$6e,$6f
  667.     chardef    "pqrstuvw",$70,$71,$72,$73,$74,$75,$76,$77
  668.     chardef    "xyz{|}~",$78,$79,$7a,$7b,$7c,$7d,$7e
  669.     chardef    '"', $22 ; not the same table entry as '\e"'
  670.     chardef    "'", $27 ; 
  671.     chardef    "\en\et\ev\eb\er\ef\ea", $0a,$09,$0b,$08,$0d,$0c,$07
  672.     charuse ascii
  673. .DE
  674. .H 2 "Machine Instructions"
  675. .DS I N
  676. [Label] opcode operands?
  677. .DE
  678. .P
  679. Machine instructions generate the binary output by evaluating the expressions
  680. for the operands, and matching the opcode with the entry in the instruction 
  681. generation tables. 
  682. .P
  683. If the instruction has more than one format which is selected by the
  684. value of the operands, the selection criteria must able to be determined at
  685. the input phase of processing.
  686. For example, in the mc6800 architecture direct address mode, any memory 
  687. variables that are have an address between 0 and 255 must be defined before 
  688. any reference to these symbols. 
  689. .P
  690. The optional label is set to the first location of the generated instruction.
  691. .H 1 "Output"
  692. .H 2 "Program Generated Messages and Errors"
  693. .H 3 "Messages"
  694. .VL 10 5 1
  695. .LI "`` ERROR SUMMARY - ERRORS DETECTED {count}''"
  696. .LI "``               -  WARNINGS       {count}''"
  697. .LI "\ "
  698. output at the end of the listing and on the console.
  699. .LE
  700. .H 3 "System Errors"
  701. .VL 10 5 1
  702. .LI "``cannot open hex output {filename}''"
  703. .LI "\ "
  704. file cannot be opened for output. The assembly continues
  705. as if the -[oh] option was not specified.
  706. .SP
  707. .LI "``cannot open input file {filename}''"
  708. .LI "\ "
  709. file cannot be opened for reading. Fatal error.
  710. .SP
  711. .LI "``cannot open list file {filename}''"
  712. .LI "\ "
  713. file cannot be opened for output. The assembly continues
  714. as if the -l option was not specified.
  715. .SP
  716. .LI "``cannot open symbol file {filename}''"
  717. .LI "\ "
  718. file cannot be opened for output. The assembly continues
  719. as if the -s option was not specified.
  720. .SP
  721. .LI "``cannot open temp file {filename}''"
  722. .LI "\ "
  723. file cannot be opened for input or output. Fatal error.
  724. .SP
  725. .LI "``no input file''"
  726. .LI "\ "
  727. no input operand specified. Fatal error.
  728. .SP
  729. .LI "``no match on CPU type {string}, default used''"
  730. .LI "\ "
  731. operand for a -p option can't be matched.
  732. .SP
  733. .LI "``cannot allocate string storage''"
  734. .LI "\ "
  735. Request to operating system for more memory failed.
  736. Fatal error.  The string storage pool is where the
  737. character representation of symbols and names for
  738. include files are stored.
  739. .SP
  740. .LI "``cannot allocate symbol space''"
  741. .LI "\ "
  742. Request to operating system for more memory failed.
  743. Fatal error.  The symbol table is full. The symbol
  744. space is the set of arrays where the symbol values
  745. and other numeric information is stored.
  746. .SP
  747. .LI "``cannot redefine reserved symbol''"
  748. .LI "\ "
  749. Error in defining reserved symbols. Two calls to
  750. "reservedsym()" with the same character string value
  751. exist in the setup. Fatal error.  Should not occur
  752. in a production executable.
  753. .SP
  754. .LI "``excessive number of subexpressions''"
  755. .LI "\ "
  756. The first pass ran out of element storage for the expression 
  757. parse tree.  The expression is too complex.  Internal error 
  758. which should never occur.  Fatal error.
  759. .SP
  760. .LI "``unable to allocate symbol index''"
  761. .LI "\ "
  762. Request to operating system for more memory failed.
  763. Fatal error.  The symbol table is full.  The symbol index
  764. is used in the output pass to direct symbol references to
  765. the symbol table entry.
  766. .LE
  767. .H 3 "Error"
  768. .VL 10 5 1
  769. .LI "``ELSE with no matching if''"
  770. .LI "``ENDI with no matching if''"
  771. .LI "\ "
  772. mismatched if/else/endi results in an else/endi left over
  773. .SP
  774. .LI "``IF stack overflow''"
  775. .LI "\ "
  776. more than IFSTKDEPTH (32) nested if statements
  777. .SP
  778. .LI "``Overlength/Unterminated Line''"
  779. .LI "\ "
  780. line longer than input buffer, or not terminated with newline
  781. character.
  782. .SP
  783. .LI "``active IF at end of file''"
  784. .LI "\ "
  785. mismatched if/else/endi results in an unclosed if
  786. .SP
  787. .LI "``cannot change symbol value with EQU''"
  788. .LI "\ "
  789. symbol is already defined.
  790. .SP
  791. .LI "``cannot change symbol value with SET''"
  792. .LI "\ "
  793. symbol is already defined, but not with a Set statement.
  794. .SP
  795. .LI "``cannot create character translation table''"
  796. .LI "\ "
  797. the internal table for a character translation set
  798. cannot be allocated due to lack of space, or
  799. more translation sets than the assembler is
  800. configured for.
  801. .SP
  802. .LI "``cannot open include file''"
  803. .LI "\ "
  804. The include file cannot be opened for reading, or not enough 
  805. system resources are available to open the file.
  806. .SP
  807. .LI "``character already defined 'char' ''"
  808. .LI "\ "
  809. the character is already present in a previous CHARDEF
  810. statement for this translation set.
  811. .SP
  812. .LI "``expression exceeds available field width''"
  813. .LI "\ "
  814. The value of an expression is too large to fit into
  815. the field of the instruction.  Relative branch target
  816. is too far away.
  817. .SP
  818. .LI "``expression fails validity test''"
  819. .LI "\ "
  820. An explicit test programmed in the generation string for the instruction 
  821. failed.
  822. These conditions are documented in the appendix for the specific instruction
  823. set.
  824. .SP
  825. .LI "``expression stack overflow''"
  826. .LI "\ "
  827. Too many level of parenthesis or complex expression
  828. with operator precedence that results in the expression
  829. evaluation stack overflowing.  
  830. .SP
  831. .LI "``include file nesting limit exceeded''"
  832. .LI "\ "
  833. include files are nested to more than FILESTKDPTH (20)
  834. levels deep.  "cannot open include file" usually occurs first.
  835. .SP
  836. .LI "``invalid char in instruction generation''"
  837. .LI "\ "
  838. Internal error, instruction generation string is not
  839. defined properly.  Should not occur in a production executable.
  840. .SP
  841. .LI "``invalid character constant 'char' ''"
  842. .LI "\ "
  843. A character specification in a string constant isn't 
  844. properly formed.
  845. .SP
  846. .LI "``invalid character to define 'char' ''"
  847. .LI "\ "
  848. a constant in the string in a CHARDEF statement is of a form
  849. (octal, hex, or improperly formed) that does not have a
  850. translation table entry.
  851. .SP
  852. .LI "``invalid opcode''"
  853. .LI "\ "
  854. No such string occurs in the opcode symbol table.  Opcode 
  855. strings are converted to uppercase before comparison, and 
  856. therefore are case insensitive.
  857. .SP
  858. .LI "``invalid operands''"
  859. .LI "``invalid operands/illegal instruction for cpu''"
  860. .LI "\ "
  861. statement has a valid opcode, with the correct syntax, but
  862. no code generation can be found in the table for these operands
  863. .SP
  864. .LI "``invalid syntax for instruction''"
  865. .LI "\ "
  866. opcode is valid, but not for this syntax form
  867. .SP
  868. .LI "``more characters than expressions''"
  869. .LI "``more expressions than characters''"
  870. .LI "\ "
  871. A mismatch between the string constant and the number of expressions
  872. in a CHARDEF statement.
  873. .SP
  874. .LI "``multiple definition of label''"
  875. .LI "\ "
  876. label symbol is already defined.
  877. .SP
  878. .LI "``no CHARSET statement active''"
  879. .LI "\ "
  880. a CHARDEF statement occurs before any CHARSET statement.
  881. .SP
  882. .LI "``noncomputable expression for EQU''"
  883. .LI "``noncomputable expression for ORG''"
  884. .LI "``noncomputable expression for SET''"
  885. .LI "``noncomputable result for RMB expression''"
  886. .LI "\ "
  887. expression contains reference to symbols that have not
  888. yet been defined, and thus has no numeric value.
  889. .SP
  890. .LI "``nonexistent character translation table''"
  891. .LI "\ "
  892. expression in a CHARUSE statement does not
  893. correspond to any CHARSET statements label.
  894. .SP
  895. .LI "``overflow in instruction generation''"
  896. .LI "``overflow in polish expression conversion''"
  897. .LI "\ "
  898. The intermediate file line being built exceeds the length
  899. of the buffer.  The expression is too complex.
  900. .SP
  901. .LI "``syntax error at/before character ^{character}''"
  902. .LI "``syntax error at/before character {character}''"
  903. .LI "``syntax error at/before token {symbol/constant}''"
  904. .LI "``syntax error at invalid token {constant/string} ''"
  905. .LI "``syntax error at/before string {string} ''"
  906. .LI "``syntax error at/before End of Line''"
  907. .LI "``syntax error at/before {relational op}''"
  908. .LI "``syntax error at/before Undeterminable Symbol''"
  909. .LI "``syntax error - undetermined yyerror type''"
  910. .LI "\ "
  911. statement is in a form that the first pass parser cannot
  912. recognize.  The next syntactic element is inappropriate for
  913. whatever language element the parser is working on.  
  914. .SP
  915. .LI "``error or premature end of intermediate file''"
  916. .LI "``syntax error - cannot backup''"
  917. .LI "``unimplemented width''"
  918. .LI "``unknown intermediate file command''"
  919. .LI "``yacc stack overflow''"
  920. .LI "\ "
  921. Internal errors, should not occur.
  922. .SP
  923. .LI "``undefined character value 'char' ''"
  924. .LI "\ "
  925. A string constant contains a character not defined in
  926. a CHARDEF statement for the current character translation.
  927. .SP
  928. .LI "``undefined symbol {symbolname}''"
  929. .LI "\ "
  930. symbol has no definition anywhere in file.
  931. .LE
  932. .H 3 "Warnings"
  933. .VL 10 5 1
  934. .LI "``character translation value truncated''"
  935. .LI "\ "
  936. An expression in a CHARDEF statment has a value less than zero
  937. or greater then 255.
  938. .SP
  939. .LI "``forward reference to SET/EQU symbol''"
  940. .LI "\ "
  941. A symbol in an expression is defined in a set/equ statement 
  942. that occurs after the line.  For set statements, the value 
  943. of the symbol is that defined in the set statement closest 
  944. to the end of the file.
  945. .SP
  946. .LI "``string constant in expression more than 2 characters long''"
  947. .LI "\ "
  948. The first two characters are used as the numeric value of
  949. the subexpression.
  950. .LE
  951. .H 2 "Listing"
  952. When the -l option is used, the detailed listing is output
  953. to the given file.
  954. This consists of the symbol listing followed by the annotated listing.
  955. .H 3 "Symbol Table"
  956. The symbol listing is printed three symbols across, with the
  957. value then name of the symbol.  
  958. Undefined symbols will have "????????" in their value field.
  959. The symbols are listed in order of first occurrence in the input.
  960. Only the first fifteen characters of a symbol are printed.
  961. .H 3 "Instruction Lines"
  962. The source statements are printed in the same form as they were input with
  963. no reformatting.
  964. Following the source line, will be any error or warning messages associated
  965. with the line.
  966. Statements which generate data will be preceded with the address and
  967. data for them in hexadecimal format.
  968. If more than six bytes of data are generated, the remainder will be
  969. printed on the following lines, with up to sixteen bytes per line.
  970. All data generated is printed in the file.
  971. Statements that don't generate data but have some value oriented operation, 
  972. like EQU, SET, ORG, or RESERVE, will print that value in the first 24 
  973. columns of the source line.
  974. .H 2 "Symbol File"
  975. When the -s option is used, the symbol table is printed to the given
  976. file.  The format is one symbol per line, address then symbol name.
  977. If the symbol is undefined, "????????" is printed for the address.  The
  978. symbols are printed in the order of first occurrence, either definition 
  979. or reference, in the source file.  This feature is provided so the
  980. system sort utility can be used to produce symbol tables sorted by
  981. either address or name.
  982. The entire symbol name is printed.
  983. .H 2 "Binary Output"
  984. .H 3 "Intel Hex Record Format"
  985. The Intel hex record is a printable text string with an ASCII character
  986. representing 4 bits of a byte.
  987. The characters used are "0" through "9" and "a" through "f", representing 
  988. binary data 0000 to 01001, and 1010 through 1111.
  989. There are always two ASCII characters used to represent 1 byte, the high
  990. half, then the low half.
  991. There is one record per line in a text file. 
  992. This format is accepted by most of prom programmers.
  993. .P
  994. Record Layout
  995. .VL 15 5
  996. .LI :ccaaaattddddddddddkk
  997. .LI ':'
  998. indicator character
  999. .LI cc
  1000. ascii-hex representation of an 8 bit count of data characters
  1001. .LI aaaa
  1002. ascii-hex representation of 16 bit address
  1003. .LI tt
  1004. ascii-hex representation of an 8 bit type
  1005. .VL +10
  1006. .LI 00 is a data record
  1007. the address is the first location to store the data
  1008. .LI 01 is an end of file record
  1009. the address is the location to start execution, the
  1010. count is 00, no data is present.
  1011. .LE
  1012. .LI dd...
  1013. ascii-hex representation of the data, two characters per byte. 
  1014. The number of 8 bit bytes is given by the count field.
  1015. .LI kk
  1016. ascii-hex representation of an 8 bit checksum.  The sum of the
  1017. binary representation, modulo 256, of the count, the high half 
  1018. of the address, the low half of the address, the type, all the 
  1019. data bytes, and the checksum must be zero.
  1020. .LE
  1021. .H 1 "Program Limits"
  1022. .VL +30 ""
  1023. .LI "Line Length"
  1024. 256 characters including end of line control characters
  1025. .LI "Number of Symbols"
  1026. .DL +2
  1027. .LI
  1028. The maximum allocatable block size divided by the size of a pointer.
  1029. For a iAPX286, about 16000 entries.
  1030. .LI
  1031. The amount of allocatable memory divided by the amount of space per symbol.
  1032. For an iAPX286, 22 + 1 + the length of the string bytes.
  1033. .LE
  1034. .LI "Symbol Length"
  1035. See line length
  1036. .LI "Output"
  1037. A 16 bit address in the output record format limits output to 65536 
  1038. binary bytes.
  1039. .LI "Expressions per Line"
  1040. 128 (in BYTE and WORD statements)
  1041. .LI "Strings per Line"
  1042. 128 (in STRING statements)
  1043. .LI "Nested If Statements"
  1044. 32 levels
  1045. .LI "Nested Include Files"
  1046. 20 or whatever the operating system allows 
  1047. .LI "Subexpressions per Line"
  1048. 258 symbols, constants, operators (total)
  1049. .LI "Character Translation Sets"
  1050. 5 sets, plus the default (host) character set
  1051. .LE
  1052. .TC 1 1 7
  1053.