WRITE A ASSEMBLY CODE ON EMU 8086
Arithmetic Operations(Division) Perform following
Arithmetic Operations
· 10/2
· 15/9
· 3844/5
; 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.
Comments
Leave a comment