Answer to Question #286157 in Assembler for ERTYUI

Question #286157

WRITE A ASSEMBLY CODE ON EMU 8086

Arithmetic Operations(Division) Perform following

Arithmetic Operations

·  10/2

· 15/9

· 3844/5


1
Expert's answer
2022-01-10T00:24:14-0500

; 8086 DIV Instruction ( Unsigned Operands)

data segment

ends


code segment

start:

; set segment registers:

   mov ax, data

   mov ds, ax

   mov es, ax   



;****************************************

; Byte with Byte Division

;****************************************

; AL stores the quotient and remainder is stored in AH register

   MOV AX, 10      

   MOV BL, 2     

   DIV Bl         ; al = 5, ah = 0



    MOV AX, 15    

    MOV bL, 9    

    DIV Bl        ; al = 1, ah = 6



;****************************************

; Word with Byte        

;****************************************

; AX stores the quotient and remainder is stored in DX register

   MOV AX,3844

   MOV BX,5

   DIV BX            ; ax = 300h, dx = 0004h


   ; wait for any key....   

   mov ah, 1

   int 21h


   mov ax, 4c00h ; exit to operating system.

   int 21h   

ends


end start ; set entry point and stop the assembler.



Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS