Write a program using procedure that performs all arithmetic operators.

Procedure in Assembly Language:
Procedure are important features of assembly language it can be used as function. When assembly language program are large in size we use procedure. We define procedure at starting of program and call these procedure where we need. Due to procedure our program become simple. Procedure are use to reduce the complexity of software.
There is simple program of Procedure and it output:
Write a program using procedure that performs all arithmetic operators.
org 100h
mov al,03h
mov bl,02h
 call s1
 call s2
 call s3
 call s4
ret
s1 proc
mul al
ret
endp
s2 proc
add al,bl
ret
endp
s3 proc
sub al,bl
ret
endp
s4 proc
div al
ret
endp
end
output result:
Procedure in Assembly Language


Explanation of Program:
First of all we call procedure name of S1,S2,S3.S4 for arithmetic operation Addition, Multiplication, subtraction and division. We make procedure for every call.
When one procedure is executed it will end and the second procedure will be called.
                          Thanks

Post a Comment

Total Pageviews