Answer to Question #286155 in Assembler for LKJHGUIO

Question #286155

WRITE ASSEMLY CODE ON EMU 8086

Arithmetic Operations(Multiplication) Perform following Arithmetic Operations

• 8*3

• 256*768

• -5*4

• -10*-20


1
Expert's answer
2022-01-10T00:24:27-0500
; 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.

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