TITLE Week 2 Programming Assignment						(main.asm)

; Program Description:  This program adds 3 16-bit integers
; Author:				Bob Markham
; Instructor:           Panos Mastrogiannis
; Creation Date:        15 October 2012
; Revisions:            none

INCLUDE Irvine32.inc
.data
myMessage BYTE "MASM program example",0dh,0ah,0

; Problem 2
;   Define the string to display
msgIntro  BYTE "My name is --Bob Markham-- and this is my second assembly class",0dh,0ah,0
; /Problem 2

; Problem 3
;   Define 3 variables to sum up later
Var1 word  10
Var2 word -60
Var3 word  30
; /Problem 3

.code
main PROC
	call Clrscr  

	mov	 edx, offset myMessage
	call WriteString

; Problem 2
;   Display the intro string
    mov  edx, offset msgIntro
	call WriteString
; /Problem 2

; Problem 3
;   eax = Var1 + Var2 + Var3
;   Display all registers to show that eax is the sum of the 3 words
	mov  eax, 0        ; when running without this line, eax upper values were not zeros
    add  ax,  Var1     ; ax = Var1
	add  ax,  Var2     ; ax = Var1 + Var2
	add  ax,  Var3     ; ax = Var1 + Var2 + Var3

	call DumpRegs      ; Command to display registers on the screen
	call WaitMsg
; /Problem 3

	exit
main ENDP

END main

; Problem 4
;   I'm adding a comment to the end...  Why?
;   Well supposedly ax is only a 16-bit register needed for the 16-bit Var1-3 that we were told to use
;   When ax is changed, it only changes the lower 16-bits.
; /Problem 4
