head	1.1;
access;
symbols;
locks
	yap:1.1; strict;
comment	@# @;


1.1
date	97.12.04.16.21.31;	author yap;	state Exp;
branches;
next	;


desc
@@


1.1
log
@Initial revision
@
text
@<html>
<title>
V22.0201, Machine Organization I, Yap: Sample Programs
</title>
<body bgcolor="EEEEEE">

<h4><font color=AA0000> <center>
V22.0201.002, Machine Organization I <br>
Fall 1997
</center></font> </h4>

<img src="http://cs.nyu.edu/~yap/gifs/lines/rainbowline.gif">

<h3><font color=AA00AA> <center>
Samples: Programs, Old Exams, Comments on Lecture.
</center></font> </h3>

<ol>

<li> BATCH FILES:
	Batch programs can be used to organize your live in DOS.
	Here are two samples that I find useful.
	<a href=bat.bat>bat.bat</a>, <a href=clean.bat>clean.bat</a>.
	<br>
	Another useful one that I use is called ``mypath.bat''
	which is used to set the path variable to include
	the Turbo Assembler directory as well as your own
	directory containing your own executables (such as
	clean.bat!).  See FAQ for information on how to do this.
	(Basically, type ``path > mypath.bat'' and then
	edit mypath.bat accordingly.)

<li> OLD MIDTERM AND SOLUTION:
	These files, <a href=mid.ps>mid.ps</a>
	and <a href=mids.ps>mids.ps</a>, are postscript files.
	See FAQ for how to print them.

<li> <a href=mask.ams>mask.asm</a>:
	sample program from class lecture
	illustrating the shift/rotate functions.

<li> <a href=outhex.asm>outhex.asm</a>:
	sample program from class lecture (Oct 29)
	containing a procedure to print the contents
	of register BH in hex.  This is essentially
	question 9 of midterm.
 
<li>  <a href=readstring.asm>readstring.asm</a>:
	program from lecture of Nov 3, illustrating
	(1) function 10, int 21h, and
	(2) string representation.

<li> Programs used in Nov 5 lecture:
	<a href=pgm12_3.asm>prm12_3.asm</a>,
	<a href=pgm12_2.asm>prm12_2.asm</a>, and
	<a href=pgm12_1.asm>prm12_1.asm</a> are
	taken from the text (chap.12), and illustrates basic
	keyboard interrupts and text video mode.

<li> Program used in Nov 10 lecture on mouse interrupt:
	<a href=mse-2.asm>mse-2.asm</a>.

<li> Programs used on Nov 19 lecture: this is the
	<a href=timeout.asm>timeout.asm</a> program that
	waits for up to N (=50) ticks for any keyboard
	response (and prints ``timed out'' or ``in time'',
	accordingly).  It uses <a href=setupint.asm>setupint.asm</a>
	and <a href=tick.asm>tick.asm</a> from the text,
	and macro file <a href=mac.asm>mac.asm</a>.
	The bat file <a href=timeoutX.asm>timeoutX.bat</a>
	is also provided for your convenience.
	This example illustrates several important concepts,
	all useful for your final project:
	<ul>
	<li> the setting up of interrupts,
	<li> the use of the timer_tick interrupt function
	<li> checking if the keyboard buffer is empty (int 16h, fcn=1)
	<li> the use of modules in assembling (EXTRN, PUBLIC)
	</ul>
	It does this more simply than the book's example, which
	requires the use of TSR and .COM programming.

<li> For your convenience, here are the TSR clock programs
	from chapter 15:
	<a href=p15_3.asm>
	p15_3.asm</a>
	<a href=p15_3a.asm>
	p15_3a.asm</a>
	<a href=p15_3b.asm>
	p15_3b.asm</a>
	<a href=p15_3c.asm>
	p15_3c.asm</a>.
	Remember that this is how you assemble this into
	a .COM file under TASM:
	<pre>
	tasm p15_3+p15_3b+p15_3c+p15_3a
	tlink /t p15_3+p15_3b+p15_3c+p15_3a
	</pre>
	That is, p15_3 is first and p15_3a is last, and you
	need the /t flag for tlink.
<li> <a href=random.asm>Random number generator program</a>
	that must be assembled into a .com file.
	Here is a simple <a href=trand.asm>test routine</a>
	for the random number generator.

<li> Here is a <a href=vga> directory </a>
	containing large number of routines for
	EGA and VGA graphics. The routines are in 
	the subdirectory <b>asm</b>
	and I have written some test programs in
	the subdirectory <b>progs</b> (see below).
	To download all the files in <b>asm</b>, just
	get the file <b>asm.tar.gz</b> (this is a tar file that
	has been gzipped).   Rename it to <b>asm_tar.gz</b> 
	(it may already have this name) on
	your Win95 system before calling winzip to unpack its contents.
	These routines are from a diskette accompanying
	the following "vga-book":
	<b>Programmer's Guide to EGA/VGA</b>,
	from Simon &amp; Schuster, Inc (1988).

<li> Programs discussed in Nov 26 Lecture:
	<a href=vga/progs/vgaclear.asm>vgaclear.asm</a>,
	<a href=vga/progs/vgabox.asm>vgabox.asm</a>,
	<a href=vga/progs/vgaline.asm>vgaline.asm</a>.
	These programs simply calls the procedures from the vga-book
	mentioned above. Please download the latest
	version of my <a href=basic.mac>macro file</a> to
	use in conjunction with these programs.
	NOTE: <a href=vga/progs/vgabox1.asm>vgabox1.asm</a> is
	a variation of vgabox.asm.

<li> Lecture on Dec 1:
	basically discussed the "Bit Block Transfer"
	routine <b>_BitBlt</b> found in prog087.asm.
	A program that exercises this function is found in
	<a href=vga/progs/vgablt.asm>vgablt.asm</a>.
	We also discussed the passing of arguments in
	high level languages such as C, as illustrated
	by the function <b>_BitBlt</b>.
	A trivial variation of mse-2.asm program above is
	<a href=mse3.asm>mse3.asm</a>, using mode 12h.
<li> Lecture on Dec 3:
	Here is information on <b>TLIB</b>, the
	<a href=../info/tlib.htm>
	Turbo Library Facilities</a>.
	Here are notes on <a href=../info/memory.htm>memory models</a>,
	especially how to use extra data segments.

</ol>
</body>
</html>
@
