KEMBAR78
Arthimatic Operation Assembly Language | PDF | Computing | Computer Science
0% found this document useful (0 votes)
38 views4 pages

Arthimatic Operation Assembly Language

The document contains assembly code for performing basic arithmetic operations including addition, subtraction, multiplication, and division using the Irvine32 library. Each operation is implemented in separate sections, prompting the user for two numbers and displaying the result. Additionally, there is a combined program that executes all four operations sequentially.

Uploaded by

Muhammad Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views4 pages

Arthimatic Operation Assembly Language

The document contains assembly code for performing basic arithmetic operations including addition, subtraction, multiplication, and division using the Irvine32 library. Each operation is implemented in separate sections, prompting the user for two numbers and displaying the result. Additionally, there is a combined program that executes all four operations sequentially.

Uploaded by

Muhammad Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

;COAL PROGRAMS

;ARTHIMATIC OPERATIONS:
;multiplication
include Irvine32.inc
.data
a dd ?
b dd ?
s1 byte "Enter First Number :",0
s2 byte "Enter Second Number :",0
s3 byte "Multiplicaion of two Numbers is:",0

.code
main proc
mov edx,offset s1
call writestring
call readint
mov a,eax
call crlf

mov edx,offset s2
call writestring
call readint
mov b,eax
call crlf
mul a
mov edx,offset s3
call writestring
call writedec
exit
main endp
end

;addition
include Irvine32.inc
.data
a dd ?
b dd ?
s1 byte "Enter First Number :",0
s2 byte "Enter Second Number :",0
s3 byte "Addition of two Numbers is :",0

.code
main proc
mov edx,offset s1
call writestring
call readint
mov a,eax
call crlf
mov edx,offset s2
call writestring
call readint
add eax,a
mov edx,offset s3
call writestring
call writeint
exit
main endp
end
;subtraction
include Irvine32.inc
.data
a dd ?
b dd ?
s1 byte "Enter First Number :",0
s2 byte "Enter Second Number :",0
s3 byte "Subtraction of two Numbers is :",0

.code
main proc
mov edx,offset s1
call writestring
call readint
mov a,eax
call crlf
mov edx,offset s2
call writestring
call readint
sub a,eax
mov eax,a
mov edx,offset s3
call writestring
call writeint
exit
main endp
end

;dividion
include Irvine32.inc
.data
a dd ?
b dd ?
s1 byte "Enter First Number :",0
s2 byte "Enter Second Number :",0
s3 byte "Division of two Numbers is :",0
s4 byte "Remainder is :",0

.code
main proc
mov edx,offset s1
call writestring
call readint
mov a,eax
call crlf
mov edx,offset s2
call writestring
call readint
mov edx,0
mov b,eax
mov eax,a
div b
mov ebx,edx
mov edx,offset s3
call writestring
call writeint
call crlf
mov edx,offset s4
call writestring
mov eax,ebx
call writedec
exit
main endp
end

//ALL OPERATIONS IN ONE PROGRAMME


include Irvine32.inc
.data
a dd ?
b dd ?
addition dd ?
multiply dd ?
subtraction dd ?
division dd ?

s1 byte "Enter First Number :",0


s2 byte "Enter Second Number :",0
s3 byte "Additions of two Numbers is:",0
s4 byte "Subtraction of two Numbers is:",0
s5 byte "Multiplication of two Numbers is:",0
s6 byte "Division of two Numbers is:",0
.code
main proc
;+
mov edx,offset s1
call writestring
call readint
mov a,eax
mov edx,offset s2
call writestring
call readint
mov b,eax
add eax,a
mov addition,eax
mov edx,offset s3
call crlf
call writestring
call writedec
;-
call crlf
mov eax,a
sub eax,b
mov subtraction,eax
mov edx,offset s4
call writestring
call writeint
;*
call crlf
mov eax,a
mul b
mov multiply,eax
mov edx,offset s5
call writestring
call writedec
;/
call crlf
mov eax,a
mov edx,0
div b
mov division,eax
mov ebx,edx
mov edx,offset s6
call writestring
call writedec

exit
main endp
end

You might also like