home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 December / simtel1292_SIMTEL_1292_Walnut_Creek.iso / msdos / crossasm / svasm02.arc / INFORMAL.DOC next >
Text File  |  1988-05-24  |  10KB  |  159 lines

  1.                                 S V A S M 0 2
  2.  
  3.                     SOME INFORMAL COMMENTS ON VERSION 1.0
  4.  
  5.                                   May, 1988
  6.  
  7.  
  8. I had been using an 8-bit (CP/M) commercial assembler for developing 6502 code 
  9. for an amateur radio 2 meter repeater system I had built.  As the code grew, I 
  10. needed  an assembler that would give me a cross reference listing of  symbols. 
  11. I also wanted to try the 65C02 chip,  which I had no assembler for.  The price 
  12. for  a new commercial product was ludicrous,  and GEnie had nothing that would 
  13. suit my needs.   The solution was obvious:  write one.   I started in the  old 
  14. TRS-80 (CP/M) using 8080 assembly language,  but soon outgrew the system.   It 
  15. was time to upgrade anyway, so I switched to an IBM XT compatible.  Then I had 
  16. to learn 8086 assembly and rewrite what I had thus far.  After about a year of 
  17. work,  I  had a two pass assembler that would produce loadable hex code for  a 
  18. 6502 or 65C02, and give me a cross referenced symbol table.
  19.  
  20. SVASM02 is written in good tight 8086 assembly for efficiency.  I once wrote a 
  21. cross  referencing  assembler in 8-bit CP/M BASIC.   The compiled version  was 
  22. over 27K long,  and was still slow.   The SVASM02 assembler is around 12K, and 
  23. runs  quite rapidly.   A single 64K segment is sufficient for  the  code,  I/O 
  24. buffers,  and the symbol table.  No "temporary" files are generated, since the 
  25. symbol  table  is constructed in RAM.   The second pass reads the source  code 
  26. from  the disk a second time,  and undefined first pass symbols are  resolved.
  27. This  approach  is much more efficient than writing temporary  information  to 
  28. disk  for later read back,  and significantly reduces disk and  CPU  overhead.
  29. There are no support files required for SVASM02.
  30.  
  31. The program was developed by first writing all of the support routines  before 
  32. adding  the  instruction set decoder.   This modular approach will  allow  the 
  33. generation  of other assemblers by merely writing the instruction set  decoder 
  34. for the chip in question.  I plan to write one for the Motorola 6805 series (I 
  35. have  an application for it),  using the SVASM02 code as a foundation.   Other 
  36. chips,  like the 6800 or 6809 (for which I don't have an application) may also 
  37. be done if the demand (and rewards) are forthcoming.
  38.  
  39. The nice part about writing an assembler is that you get to define the  syntax 
  40. of the code you are assembling.   I had used a couple of commercial assemblers 
  41. for various chips,  and liked some features of each.   For example,  I use the 
  42. asterisk (*) as the symbol for the program counter in preference to the dollar 
  43. sign.   I also don't like the colon as a label delimiter.   In SVASM02, labels 
  44. are the first thing on a line other than an instruction, pseudo-op, comment or 
  45. an  equate,  without the dumb colon.  Future versions may permit the use of  a 
  46. colon but not require it.   Also,  I don't like DB, DW, ORG, and similar Intel 
  47. type syntax.  I use the  pseudo-ops .BYTE and .WORD for bytes and words and "* 
  48. =  " for defining the program counter and setting aside uninitialized storage. 
  49. The equal sign is used to define equates.
  50.  
  51. SVASM02 is easy to run.   Once the program name is entered,  prompts are given 
  52. for  the  filenames  for source,  object,  and listing files.   There  are  no 
  53. switches  or  modifiers.    The program directives will do  about  anything  a 
  54. switch  would do,  with less confusion and more options.   Selection of object 
  55. and listing output is optional,  and the listing output may be specified to go 
  56. to  the  screen  or the printer by entering the destination  at  the  filename 
  57. prompt.
  58.  
  59. Now a word or two about case.   I don't like lower case for assembly language. 
  60. In fact,  I can't STAND lower case for assembly language.   This is probably a 
  61. quirk  on  my  part,  but  I find lower case  almost  impossible  to  read  in 
  62. expressions  like "start1 = $a3c6".   Perhaps it wouldn't be too bad if we had 
  63. lower case numbers.  Except for filename entry during invocation,  the SVASM02 
  64. assembler will not convert lower to upper,  and is totally based on upper case 
  65. characters only.   Lower case is fully acceptable within a quoted string or as 
  66. commentary information, however, as it should be.
  67.  
  68. There  are a few other things SVASM02 will and will not do.   It will assemble 
  69. 6502  and/or 65C02 mnemonics and produce both a line-numbered  source  listing 
  70. with  a  cross referenced symbol table,  and a HEX load file in Intel  format. 
  71. Input is from disk only.   The HEX file normally will go to disk.  The  source 
  72. listing output may be directed to disk,  the printer, or the screen.  Both the 
  73. source  listing and HEX files are optional.  While DOS supports the use of the 
  74. Reserved Device Names, SVASM02 may not perform as expected if they are used in 
  75. place  of the usual disk name.   Drivers have been included to permit  correct 
  76. console (CON) and printer (LPT) output if desired.   See the SVASM02.DOC  file 
  77. for details.
  78.  
  79. Assembly  time errors (all 25 of them) are shown in English words,  and not  a 
  80. single  letter  code  that  one has to waste time fumbling  through  a  manual 
  81. looking for to get an explanation.  Regardless of the I/O routes selected, all 
  82. errors  are written to the screen as well as any other chosen  output  medium. 
  83. With regard to disk I/O, the present version does not support directory paths.
  84. Valid disk designations (A:, B:, etc.) may be freely used.
  85.  
  86. SVASM02 Version 1.0 will not do macros, but I am looking at the possibility of 
  87. including  macro  assembly  in  a  future  version.    SVASM02  will  not   do 
  88. parenthetical  or  hierarchical  arithmetic,  like "SCRADR  =  ((REW+WER)/ONE-
  89. TWO)/DSF".   For  the  present  I recommend BASIC.   SVASM02  will  do  simple 
  90. arithmetic,  evaluating  an  expression from left to right as  the  terms  are 
  91. encountered.   For  example,  "TABADR  =  BASADR+OFFSET*2" will  be  correctly 
  92. evaluated  from left to right.   The value of OFFSET is added to the value  of 
  93. BASADR  and  the sum is multiplied by 2.   The four arithmetic  operators  are 
  94. supported as well as Boolean AND,  OR,  NOT,  and XOR; also SHL and SHR (shift 
  95. left  and  right);  MOD;  and byte extraction operators.   The left  to  right 
  96. restriction applies to the logical,  MOD, and shift operators also.  (A future 
  97. version  may  include  the capability to  do  hierarchical  and  parenthetical 
  98. evaluations,  as  well as relational operations like less than,  greater than, 
  99. etc.)
  100.  
  101. Labels and symbols are limited to six characters.  I know some assemblers will 
  102. use up to 40 or even more, but why take up a lot of file and memory space, and 
  103. CPU  time to evaluate them when a few characters will do the same  thing?   If 
  104. you  need a lot of characters to describe a variable or code sequence,  use  a 
  105. comment.  The CPU overhead is a lot less.  I could be talked into 8 characters 
  106. for a future version.
  107.  
  108. There are several pseudo-ops in SVASM02,  like .PAGE, .WIDTH, .INCLUDE, .CMOS, 
  109. conditional assembly, .LIST and .NOLIST, .PRINTC, and others.  These are fully 
  110. described in the DOC file.
  111.  
  112. The  TEST02.ASM file contains all of the 6502 and 65C02 instruction  mnemonics 
  113. and addressing modes,  as well as examples of syntax,  errors, etc.  This file 
  114. should be assembled and the output referred to to answer additional  questions 
  115. the programmer may have regarding the program or its operation.
  116.  
  117. SVASM02  has  been used to assemble 6502 code for the control of  two  amateur 
  118. radio repeaters,  at KM2H and N2CEH.  There are no known bugs.  That is not to 
  119. say  a bug may not be present.   Other programmers,  using their own style  of 
  120. programming technique,  may uncover a hidden bug.   If I am informed of a bona 
  121. fide  bug,  I  will fix it and return a free corrected version to the  sender, 
  122. whether he or she is a registered user or not.   This offer does not apply  to 
  123. users who use the program for profit unless they were originally registered.
  124.  
  125. A  software  project  of this magnitude is never really  complete.   There  is 
  126. always  something  more  one can add,  and I  plan  to  do  so.   Hierarchical 
  127. and parenthetical arithmetic (a bear to write!); relational operators like EQ, 
  128. NE, GT, LT, etc. (I've started looking at this one); more than 6 characters in 
  129. labels  and symbols (will require more RAM and disk space and slow the program 
  130. a  trifle);  and  maybe even macros (good-bye 64K memory use)  are  all  being 
  131. considered.   User comments and input will all be considered,  but frivolities 
  132. and user-specific functions will be rejectd.
  133.  
  134. Now  the  tough  part.   While  writing  SVASM02  was  a  labor  of  love,  it 
  135. nevertheless  was a labor.   I offer it to GEnie users and others for private, 
  136. non-commercial, non-profit use only.  If you find it useful, a contribution of 
  137. $25.00  would be appreciated.   If you intend to profit from its use,  I  must 
  138. also.   Upon  written  application  and receipt  of  $100.00,  a  license  for 
  139. commercial use of SVASM02 will be issued.   In either case, you will receive a 
  140. disk containing the latest versions of the code and documentation,  and future 
  141. notification of any new versions.  No future versions, even to fix a bug, will 
  142. be  released  to the public domain.  Future assemblers referred to  previously 
  143. will be released in their initial versions only.   At no time will the  source 
  144. code  be  released for any reason to anyone.   Please contact me for terms  of 
  145. commercial distribution.  I may be reached by amateur packet radio (rapid), by 
  146. U.S.  mail (less rapid), or by GE mail on GEnie (slowest, since I don't get to 
  147. log on as often as I would like).   Comments,  constructive or otherwise,  are 
  148. welcome and will be appreciated.  Please, no phone calls.
  149.  
  150.  
  151.                 U.S. Mail:    John Michne
  152.                               10 Evergreen Ave.
  153.                               Clifton Park, New York   12065
  154.  
  155.      Amateur Packet Radio:    KM2H @ WA2WNI-4
  156.                           or  KM2H @ WA2PVV
  157.  
  158.        GEnie Mail Address:    KM2H
  159.