59 Program to perform operation Z = (A+B) * (C+D) using Procedure in 8086 Microprocessor

Code:

; Program to perform operation Z = (A+B) * (C+D)
; using Procedure
.MODEL SMALL
.STACK 100H
.DATA
   A DB 1
   B DB 2
   C DB 3
   D DB 4
   Z DW ?
   RES DB ?
.CODE

  MOV AX , @DATA ;Initializing Data Segment
  MOV DS , AX

  MOV AL , A
  MOV AH , B

  CALL ADD_BYTE

  MOV RES , AL   ; STORING RESULT OF A+B

  MOV AL , C
  MOV AH , D

  CALL ADD_BYTE

  MOV BL , RES

  MUL BL
  AAM          ; ASCII ADJUST AFTER MULTIPLICATION


  MOV Z , AX

  ; PRINTING RESULT
MOV BH , AL
MOV DL , AH   
ADD DL , 48
MOV AH , 02
INT 21H

MOV DH , 00
MOV DL , BH
ADD DL , 48
MOV AH , 02
INT 21H


MOV AH , 4CH  ; Service Routine for exit
INT 21H

  ; Creating Procedure
  ADD_BYTE PROC
     ADD AL , AH
     RET
  ENDP
END



Output:


operation Z = (A+B) * (C+D) in 8086

Previous
Next Post »

1 Comments:

Click here for Comments
Unknown
admin
May 31, 2022 at 2:54 PM ×

gd

Thank You Unknown For Comment.
Reply
avatar