CSC 222         Lab 3
Fall 2000

Topic: An introduction to MASAM and Code View


1) write and assemble the 'Hello World' program, then 
   view the listing file

2) change the 'Hello World' program to add two numbers
   (move into registers and add), then use CV to watch
    the execution of the program

3) change the program so that it will multiply 4 x 3,
   then use CV to watch the exectuion of the program



















Hello World

.model small
.stack 100H
.data
Message	DB	'Hello World', 13, 10, '$'

.code
Hello proc
	mov	ax, @data
	mov 	ds,	ax

	mov	dx,	offset Message
	mov	ah, 	9h
	int	21h

	mov	al, 	0
	mov 	ah,	4ch	
	int	21h
	Hello	endp
	end	 hello



Add two numbers

.model small
.stack 100H
.data
Message	DB	'Hello World', 13, 10, '$'

.code
Junk proc
	mov	ax, @data
	mov 	ds,	ax

	mov	ax,	0Ah
	mov	Bx, 	0Bh
	add	Ax,	Bx

	mov	al, 	0
	mov 	ah,	4ch	
	int	21h
	Junk	endp
	end	 Junk



	mov 	ax, 3
	mov 	cx, 4
	mov	dx, 0
loop:	add	dx, ax
	dec	cx
	cmp	0, cx
	jl 	loop