CHAP02.TXT Version 1.00 12/24/84 Leonard Gilberg 74126,2044 Robert Flagg 72466,2332 Chapter 2 - How to "Assemble" a File An assembly-language source code file (.ASM extension) is a list of instructions written using the abbreviated ("mnemonic") commands built into a particular microprocessor. The KayPro uses a Zilog Z-80 microprocessor and there are many others, all with their own special set of mnemonic instructions. An "assembler" is a translating program for converting the mnemonic commands into machine language, which consists of a series of "1s" and "0s" and is the only language understood by any computer. Common assemblers include ASM, LASM3 and Z80ASM. Many public domain programs are written in an earlier assembly language, that of the Intel 8080, the first widely used hobbyist microprocessor. A Z-80 can understand all 8080 mnemonics, but since a Z-80 microprocessor has many additional instructions, an 8080 microprocessor cannot understand and run Z-80 source code. ASM, the Digital Research assembler that usually comes with a KayPro's CP/M operating system, cannot assemble Z-80 source code. LASM3, a public domain assembler, can handle part of the Z-80 mnemonics, but for purely Z-80 source code, an assembler such as Z80ASM by SLR must be used. For practical purposes, ASM (or better yet LASM3) will handle the tasks needed by most users, such as preparing custom patches for WordStar, making different printers work properly and making other minor changes in the system. This is because the source of most of the programs for these applications arise in the public domain and are purposely written in 8080 mnemonics for the broadest possible use. For more detailed information on microprocessors and assembly language programming than provided in this introductory text, we suggest the following as a beginning bibliography: Introduction to Microcomputers, by Adam Osborne Vol 0 - The Beginner's Book Vol 1 - Basic Concepts Vol 2 - Some Real Microprocessors (1978 ed.) Vol 3 - Some Real Support Devices (1978 ed.) Vol 2 1978-79 Update Series Vol 3 1978-79 Update Series Z80 Assembly Language Programming, by Lance Leventhal The foregoing are all published by Osborne/McGraw-Hill. Actual assembly and creation of a .COM ("executable"): 1. Start with a disk containing the source code, an assembler (such as "ASM") and LOAD.COM. 2. The usual command is A>ASM Filename which will result in the creation of the following files: Filename.hex Filename.prn In this case, ASM will look for the source file on the same disk and put the new files on the same disk where ASM.COM is (A>). The file with the ".PRN" extension will normally not be used and takes up a lot of room. (It's purpose is to list each instruction in the source code, its translation and its location in memory in the hexadecimal file.) If you use the command: A>ASM Filename.AAZ ASM.COM will look for the source code on A drive, put the new .HEX file on A drive and the "Z" says "don't bother making a .PRN file." If all you want is a .HEX file, you've got it. Just save the source code (.ASM file) as a backup for potential further use. 3. If you want a .COM file, give the command: A>LOAD Filename and LOAD.COM will take the .HEX file you just made and make a .COM file from that. A .HEX file will not execute. It must first be LOADed using LOAD, which converts it to a .COM file which will execute when the name of the file is typed.