Magic Assembler v1.05 - Documentation ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Magic Assembler is a public domain assembly language compiler, which can produce as well as COM files as boot sector programs. Compiling to COM files can be done using the command line like this: ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ ASM MYPROG.ASM ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ To put the program in the boot sector of a disk wich is in drive A, the command line should be like this: ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ ASM MYPROG.ASM B:A ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ Note that if you want to make a boot program, you should include a code like this: ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ mov ax,07c0 ³ ³ mov ds,ax ³ ³ mov es,ax ³ ³ mov ss,ax ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ This is because DOS isn't loaded, so DOS cannot set the correct memory settings before running. All bootsector programs are loaded at 07c0:0000, so that's why include this code. ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ The commands included with this assembler are the standard assembly commands, but there are some exeptions. There are three different JMP commands, and 2 different CALL commands. Below the difference are discussed: JMPS jumps 128 bytes back to 127 bytes further, and uses 2 bytes of code. JMP jumps 32768 bytes back to 32767 bytes further, and uses 3 bytes of code. JMPF jumps to every possible place in the low memory, and uses 5 bytes of code. CALL see JMP, but with this the RET function can be used. CALLF see JMPF, but with this the RET function can be used. ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Variables can be declared with the following functions: DB byte(s) declares a byte, but can also be used to declare multiple bytes. DW word(s) declares a word, but can also be used to declare mutiple words. DS x bytes declares a free array of x bytes. DBE filename.ext this function puts a file in the compiled version, supposing that the file is build of bytes. DWE filename.ext this function puts a file in the compiled version, supposing that the file is build of words. With DB and DW you can also put a ? instead of a value. If you want to declare data, for which only space in memory must be reserved, but no space on disk, you should put them on the end of the source. Before you declare that data you must put an empty line before them, containing only a '-' on the first place. See the example programs for details. ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ You do not need to tell the assembler that a procedure is a procedure, so you can declare a procedure like this: ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ cls mov ax,0003 ³ ³ int 10 ³ ³ ret ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ You can then in the program put the line ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ call cls ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ I hope you'll enjoy the Magic Assembler. If you have any questions or suggestions about the assembler, the documenation or the sample programs, you can write me on E-mail bert.greevenbosch@mmm.xs4all.nl ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Magic Assembler was written by Bert Greevenbosch for Magic Software.