I am new in Asemply language and the little man so I would be thankful if someone shed me a light how to write a program and multiply 2 numbers together.

Recommended Answers

All 2 Replies

All depends on your microprocessors intruction set. This is info for a 8086 microprocessor:

Unsigned multiply.
Algorithm:
when operand is a byte:
AX = AL * operand.
when operand is a word:
(DX AX) = AX * operand.
Example:

MOV AL, 200   ; AL = 0C8h
MOV BL, 4
MUL BL        ; AX = 0320h (800)
RET

C Z S O P A
r ? ? r ? ?
CF=OF=0 when high section of the result is zero.

Thank you for your prompt answer to my question ddanbe, but my language is low level one using by the following codes:
00 LDA #01;
01 STA 99;
02 LDA #05;
03 STA 98;
04 OUT 00;
05 SKP 00;
06 HLT 00;
07 SUB 99;
08 JMP 04;
Thank you inadvance

Be a part of the DaniWeb community

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