I am a new to assembly and i am asked to multiply two 3x3 matrices and then show the given result. I am having problem in multiplication as

mov al,5
mov bl,6
imul bl

but how to print it?? i know the result will be in ax register but i cannot print it out. Please tell me the correct answer tat what should i do????

Recommended Answers

All 2 Replies

Unfortunately, the answer depends on information you haven't given us yet, namely, the operating system you are using (Windows, Linux, MacOS, etc), and if it is Windows, if you are using the older DOS mode or not. The specific assembler also is important, as just how you handle some aspects of it depend on the syntax specific to the assembler. If you let us know these things, we should be able to help.

I am using GUI turbo assembler on win 8. Here is the code.
As we cannot print whole ax at a time so i did thus but can't found actual results. plz help

; code for mul two numbers both of 1 byte an then print answer

.model small
.stack 100h
arr db 4 dup(?)     
.code c1
main proc

mov ax,@data
mov ds,ax

        mov ah,1        ; takes 1st input
        int 21h
mov [arr],al
        mov ah,1        ; takes 2nd input
        int 21h
mov [arr+1],al

mov ah,[arr]
mov bl,[arr+1]
mul bl              ; multiplying both numbers

mov bx,ax

mov ah,2
mov dl,bl
int 21h

mov ah,2
mov dl,bh
int 21h

mov ah,4ch      ; dos exit
int 21h
main endp
end main        
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.