I mentioned in class on Monday that I was hesitating between requiring you to hand in this homework or not. But I feel strongly enough about the usefulness of this exercise for the final project that I decided that you have to hand it in. Two concessions are (i) I will give you 2 weeks to do this, and (ii) you are to do this in your PROJECT TEAMS. I suggest that each team immediately schedule a FIRST meeting. If you delay this you are just taking up time that you can use for your final project!
(a) mov ax, WORD PTR bh (b) mov BYTE PTR [di], bh (c) REP mov ax,bx (d) mov es,ds (e) mov ah,[ByteVar+3] (f) mov si,[si] (g) mov sp,ax (h) mov sp,WordVar
newmac macro n mov ax,n newmac endm
DOS_RTN, NEW_LINE, DISP_STR, SAVE_REGS, RESTORE_REGS, HEX_OUTIn the future (e.g., in the game project), please use these macros whenever possible. You can include the macros in your file using the form suggested by the book:
IF1 INCLUDE MYMACROS.LIB ENDIFWhenever you invoke a macro, please add comments saying that you are invoking one. E.g.
DOS_RTN ; invoke macro in mymacros.lib
____abcd__12345______WXYZ_____then after you type ``HERE'', the new line will become
____abHEREcd__12345______WXYZ_and the cursor would still be at the letter ``c''. NOTE: the underscores (
___) signify blanks.
More precisely, consider what happens when you insert a
single character (inserting many characters just repeats
this procedure): of course, each character to the right
of the current cursor position moves one position to the
right. The interesting question is what to do with the
last character. We have two possibilities:
(1) if the last character is a blank,
then it simply disappears and the insertion process ends.
(2) if the last character is any non-blank character,
it will be inserted into the beginning of
the next row. Of course, this may have a cascading effect
and cause further insertions into the row after next, etc.
If this causes an insertion into the row
beyond the last row (row 24)
then we create a new blank row by scrolling the screen
up by one row (the contents of the previous row 0 is lost).
E.g., in the above example, suppose that there are two blank spaces after ``WXYZ'' before the end of line. Then inserting ``HERE'' in the example will cause (in turn) the insertion of ``YZ'' into the beginning of the next line.
@rem debug batch file echo DEBUGGING HW4 tasm /z /zi hw4 tlink /v hw4 td hw4 echo DONE DEBUGGING HW4If you have two modules (hw4.asm and hw4a.asm) then these instructions must be modified appropriately. [2 pts]