################################################################## # # # basic.mak # # # ################################################################## # This is a makefile. In simple terms, it provides the program # 'make' with instructions on how to assemble, link, and locate # your assembly files. # Executing makefiles is easy: # make -fmakefile.mak # Why use this instead of simply typing in commands, or making # simple batch files? First of all, typing in commands gets # old VERY quickly. More importantly, batch files continue # execution regardless of whether or not ASM86, LINK86, and # LOC86 generate errors. The danger is that you could miss # errors. Even if you do not miss errors, it can be a royal # pain to scroll a bunch of (what might seem to be successful) # 'assembles'. Also note that errors tend to 'cascade' -- one # error can cause many other errors. Trying to fix the # 'cascaded' errors is often a very tricky business. Using # make files greatly reduces this type of problem, and # ultimately saves YOU time. # It is very important to note that the make program # available from the EE51 website cannot operate on files # with names greater than 8 characters long (excluding the # extension), or names with spaces in them. # Sometimes make.exe has issues when ASM86, LINK86, and LOC86 # are located in a directory different from where the code # files are. The simplest solution is to put all of the # executables in the same directory as your code. # tell the makefile how to convert .asm files to .obj files # note that whitespace is required before the ASM86 line .asm.obj: ASM86 $*.ASM DB M1 EP # this is a dependency, telling make.exe that this makefile # depends on basic.obj and basic.mak # if something a file/target depends on is changed, then # that file/target needs to be rebuilt # in this case, we have a target, 'basic' basic : basic.obj basic.mak # the commands to run for the target # note that whitespace is required before each command LINK86 basic.obj TO basic.lnk # note 'code', 'data', and 'stack' in the statement below # these relate DIRECTLY to # CODE SEGMENT PUBLIC 'CODE' # DATA SEGMENT PUBLIC 'DATA' # STACK SEGMENT PUBLIC 'STACK' # in the assembly file LOC86 basic.lnk TO basic NOIC ad(sm(code(1000h),data(3000h),stack(4000h))) # .obj file dependencies (as opposed to target dependencies) basic.obj : basic.asm