home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / enterprs / cpm / utils / a / asmhelp.lzh / CHAP2.TXT < prev    next >
Encoding:
Text File  |  1992-12-08  |  3.6 KB  |  91 lines

  1.                   CHAP02.TXT
  2.              Version 1.00 12/24/84
  3.               Leonard Gilberg 74126,2044
  4.             Robert Flagg 72466,2332
  5.  
  6.          Chapter 2 - How to "Assemble" a File
  7.  
  8.      An assembly-language source code file (.ASM extension) is a
  9. list of instructions written using the abbreviated ("mnemonic")
  10. commands built into a particular microprocessor. The KayPro uses a
  11. Zilog Z-80 microprocessor and there are many others, all with their own
  12. special set of mnemonic instructions.
  13.  
  14.      An "assembler" is a translating program for converting the
  15. mnemonic commands into machine language, which consists of a series of
  16. "1s" and "0s" and is the only language understood by any computer.
  17. Common assemblers include ASM, LASM3 and Z80ASM.
  18.  
  19.      Many public domain programs are written in an earlier assembly
  20. language, that of the Intel 8080, the first widely used hobbyist
  21. microprocessor. A Z-80 can understand all 8080 mnemonics, but since a
  22. Z-80 microprocessor has many additional instructions, an 8080
  23. microprocessor cannot understand and run Z-80 source code. ASM, the
  24. Digital Research assembler that usually comes with a KayPro's CP/M
  25. operating system, cannot assemble Z-80 source code. LASM3, a public
  26. domain assembler, can handle part of the Z-80 mnemonics, but for purely
  27. Z-80 source code, an assembler such as Z80ASM by SLR must be used.
  28.  
  29.      For practical purposes, ASM (or better yet LASM3) will handle
  30. the tasks needed by most users, such as preparing custom patches for
  31. WordStar, making different printers work properly and making other
  32. minor changes in the system. This is because the source of most of the
  33. programs for these applications arise in the public domain and are
  34. purposely written in 8080 mnemonics for the broadest possible use.
  35.  
  36.      For more detailed information on microprocessors and assembly
  37. language programming than provided in this introductory text, we
  38. suggest the following as a beginning bibliography:
  39.  
  40. Introduction to Microcomputers, by Adam Osborne
  41.      Vol 0 - The Beginner's Book
  42.      Vol 1 - Basic Concepts
  43.      Vol 2 - Some Real Microprocessors (1978 ed.)
  44.      Vol 3 - Some Real Support Devices (1978 ed.)
  45.          Vol 2 1978-79 Update Series
  46.          Vol 3 1978-79 Update Series
  47.  
  48. Z80 Assembly Language Programming, by Lance Leventhal
  49.  
  50.      The foregoing are all published by Osborne/McGraw-Hill.
  51.  
  52.      Actual assembly and creation of a .COM ("executable"):
  53.  
  54.      1.  Start with a disk containing the source code, an
  55. assembler (such as "ASM") and LOAD.COM.
  56.  
  57.      2.  The usual command is
  58.  
  59.         A>ASM Filename
  60.  
  61. which will result in the creation of the following files:
  62.  
  63.      Filename.hex        Filename.prn
  64.  
  65. In this case, ASM will look for the source file on the same disk and
  66. put the new files on the same disk where ASM.COM is (A>). The file
  67. with the ".PRN" extension will normally not be used and takes up a lot
  68. of room. (It's purpose is to list each instruction in the source code,
  69. its translation and its location in memory in the hexadecimal file.)
  70. If you use the command:
  71.  
  72.         A>ASM Filename.AAZ
  73.  
  74. ASM.COM will look for the source code on A drive, put the new .HEX
  75. file on A drive and the "Z" says "don't bother making a .PRN file." If
  76. all you want is a .HEX file, you've got it.    Just save the source
  77. code (.ASM file) as a backup for potential further use.
  78.  
  79.      3.  If you want a .COM file, give the command:
  80.  
  81.         A>LOAD Filename
  82.  
  83. and LOAD.COM will take the .HEX file you just made and make a .COM
  84. file from that. A .HEX file will not execute.    It must first be
  85. LOADed using LOAD, which converts it to a .COM file which will execute
  86. when the name of the file is typed.
  87. s:
  88.  
  89.      Filename.hex        Filename.prn
  90.  
  91. In this case, ASM will look for the source file on the sa