home *** CD-ROM | disk | FTP | other *** search
/ Micro R&D 1 / MicroRD-CD-ROM-Vol1-1994.iso / hardware / drivr / ibmk.lha / ibmk / a51.doc < prev    next >
Text File  |  1992-08-20  |  3KB  |  74 lines

  1. This is an 8031/8051 assembler.
  2.  
  3. This assembler is a simple one, I think. It includes little error checking
  4. but it does work on programs that are correctly written. It will bomb out
  5. of assembling on any error. Usually when compling programs anyhow, the
  6. rest of the errors are useless anyhow. It is not "case sensative".
  7.  
  8. This assembler has several directives:
  9.  
  10.     .org exp    ;start address at exp.
  11.     .equ exp,exp    ;equate left expression to right one.
  12.     .db exp        ;define byte of expression
  13.     .dw exp        ;define word.
  14.     .rs exp        ;reserve exp bytes of space
  15.     .dm exp        ;define message. Put in single quotes.
  16.     .end exp    ;end assembly. Start address=exp
  17.  
  18. "exp" is either a string constant or a number, or a math function of both.
  19. Either way, the resulting expression must be a constant. I.e. No registers.
  20. Is that clear? (I am not good at documentation!)
  21.  
  22. string names, called "tags" can be up to 80 characters in length, but each
  23. line can ONLY be 80 characters long, so it's probably best to make them a
  24. little shorter than 80.
  25.  
  26. This compiler supports addition, subtraction, and multiplication of
  27. constants. Plus, any character within single quotes will be treated as the
  28. ASCII decimal equivalent. I.e. 'A'=65.
  29.  
  30. numerical constants can be specified in one of three ways, not including the
  31. character constant. Decimal, Hexidecimal, and Binary are all supported.
  32. Both H'xxx and 0xxxH and B'xxx and 0xxxB are supported. My favorite is 0xxxH.
  33. If the trailing H is used in hexidecimal format, like most compilers, if the
  34. first number is a alphabet character (A-F) it must be preceded with a 0.
  35.  
  36. The full 8051 instruction set it translated in this assembler EXCEPT for
  37. 1. ANL c,/bit and 2. ORL c,/bit. Oh well!
  38.  
  39. To use this assembler, first compile it with "cc a51.c -o a51"
  40. The compiler must be able to handle arrays of 32k long. With this capability,
  41. you can have programs with an ADDRESS SPACE OF 0-8000 HEX! Addresses
  42. farther than this will cause the program to BOMB. If your compiler can
  43. handle it, change the array bounds in a51.h to 64k and all limiting
  44. references to 32k in the program to 64k. I can't imagine a 32k program on
  45. the 8051 myself...
  46.  
  47. To use the program, type "a51 filename" The assembler will generate two
  48. files, a filename.lst file and a filename.hex file.
  49.     The .lst file will contain a listing of your program with the code
  50. beside it followed by a table of tags that were defined.
  51.     The .hex file will contain all the object code that is in your program
  52. but no checksums, since I don't know how to do that. (any ideas?)
  53.  
  54. To make life easy, the assembler comes with an additional file, "a51.equ"
  55. that has predefined tags with thier values. This file must end with a negative
  56. number as a delimiter. Feel free to add your own equates if you want. It will
  57. work the same.
  58.  
  59. Negative numbers are treated as two's complement. Always. If the number is
  60. negative and greater than -256, it is treated as a byte.
  61. If the number is negative and less than -255 (like -256) it is treated as
  62. a word. Remember this! It's probably best not even to use negative
  63. constants. Figure them out yourself and compliment them. Just to make sure,
  64. check the code listing and see if it's right.
  65.  
  66. rem statements are preceded by semicolons.
  67.  
  68. Example programs foo and foo2 are included to show a couple of the features.
  69.  
  70. Questions? Complaints? Bugs?
  71.  
  72. Eric Rudolph (503-745-5794)
  73.  
  74.