CSI 212 Project 1, Fall 2011
American University of Science and Technology · Computer Organization And Assembly · 1 page
Stuck on a question? A tutor can walk you through it.
More CSI 212 files
- Project 2 · Fall 2011ProjectView
- Chapter 1 Slides · Spring 2012ChapterView
- Chapter 2 Slides · Spring 2012ChapterView
- Chapter 3 Slides · Spring 2012ChapterView
- Chapter 4 Slides · Spring 2012ChapterView
- Chapter 5 Slides · Spring 2012ChapterView
- Chapter 6 Slides Part I · Spring 2012ChapterView
- Chapter 6 Slides Part II · Spring 2012ChapterView
Show the text of this project
;This program find the sum, the product and the average of five numbers
introduced in the program
INCLUDE Irvine32.inc
.data ;to insert the variables
num1 BYTE 10
;initializing num1 as BYTE of value 10
num2 BYTE 20
;initializing num2 as BYTE of value 20
num3 BYTE 30
;initializing num3 as BYTE of value 30
num4 BYTE 40
;initializing num4 as BYTE of value 40
num5 BYTE 50
;initializing num5 as BYTE of value 50
.code
main PROC
;insert executable instructions here
mov eax,num1
;moving num1 to reg eax
add eax,num2
;adding num2 to num1
add eax,num3
;adding num3 to the previous values
add eax,num4
;adding num4 to the previous values
add eax,num5
;adding num5 to the previous values
mov ecx,num1
;moving num1 to ecx to calc the product
mul num2
;multiplying num2 to num1
mul num3
;multiplying num3 to the previous values
mul num4
;multiplying num4 to the previous values
mul num5
;multiplying num5 to the previous values
mov ebx,eax ;moving sum to ebx reg
div 5
;dividing sum by 5 to find the average
call DumpRegs
;display registers
exit
main ENDP
END main