WRITE ASSEMLY CODE ON EMU 8086
Arithmetic Operations(Multiplication) Perform following Arithmetic Operations
• 8*3
• 256*768
• -5*4
• -10*-20
; Multiplication
data segment
ends
code segment
start:
; set segment registers:
mov ax, data
mov ds, ax
mov es, ax
;****************************************
; MUL - Ansigned multiply
;****************************************
; IF (OperandSize = 8-bits) THEN
; AX <- AL * CL
mov al,8
mov cl,3
mul cl
; IF (OperandSize = 16-bits) THEN
; DX:AX <- AX * CX
mov ax,256
mov cx,768
mul cx
;***********************************************************************
;IMUL - Signed multiply
;****************************************************
; AX <- AL * CL
mov al,-5
mov cl,4
imul cl
mov al,-10
mov cl,-20
imul cl
; 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