SET LIB=C:\MASM615\LIB;%LIB%Then save this.
cd ..in order to get to the root directory. Then give the command
cd masm615to step into the Masm615 directory. Then do a
dirto see a listing of the directory. This listing won't fit in your screen, so now try
dir | moreinstead, to view it a screen's worth at a time.
type new-vars.batto see the contents of the batch file you altered earlier. Then type the command
new-varsto execute this batch file, and so execute all of the system commands contained in it. This will cause some system variables to be altered, so that the operating system will be able to find necessary files. Next give the command
make32which will cause the operating system to execute the batch file make32.bat, although it will complain about improper usage. Never mind that. For technical reasons that elude me, make32 doesn't always work from inside a different directory, unless you first execute it from inside Masm615. Therefore, execute make32 from this directory whenever you begin a session that will use make32. Ditto for make16.
cd examples cd ch06to step into a directory containing sample assembly language programs from the textbook. Do a
dirhere too. Then give the command
make32 encryptto assemble and link an assembly language program called encrypt. You should experience a nice clean assembling and linking of the code, without error messages. Assuming this, now execute this program by typing
encryptWhen it runs, type in a short sentence and see what happens.
mkdir Projects(you may name it whatever you wish though). Then use cd to step into this directory. Now, save the assembly language program at the link mysums.asm in a file named mysums.asm in your Projects directory. Use the dir command to make sure this worked OK. Make sure that it is mysums.asm and not mysums.asm.txt or something else. Now assemble and link this by giving the (case-sensitive) command
ml -Zi mysums.asmThen enter the on-line debugger (Code View) with mysums loaded by giving the command
cv mysumsUse the Windows menu option to make sure that you have "Source 1", "Memory 1", "Register" and "Watch" windows open. Also, close any other window (like "Command") by highlighting the window and then clicking its upper left corner. When you have the correct four windows open, select "Windows/Arrange" to organize these nicely.
01 00 02 00 03 00These six bytes of memory are used to store the three variables I, SUM, SUM2 and you can observe them change as you observe the values of the variables change in the watch window. There is a difference though. In the watch window the values are displayed using decimal notation, but in the memory1 and in the registers windows, information is always displayed using hexidecimal. As an experiment, change the above 01 to 11. Remember that this is hex 11. Now go look at the watch window and see what has happened to the variable I.
MOV I, 0is executed? Also, what exactly happens when the instruction
ADD SUM, AXis executed?
LOOP LOOP1is executed? (Hint: pay attention to the CX register.)