Re: newbie: MUL product
- From: Herbert Kleebauer <klee@xxxxxxxxx>
- Date: Thu, 29 Mar 2007 17:04:48 +0200
Brian wrote:
but I'm not sure if there is a simpler way, or a way to get to the
32-bit product with just one instruction.
Sure, don't use a 16 but a 32 bit multiplication.
00000100: 66 a1 010a move.l val1,r0
00000104: 66 f7 26 010e mulu.l val2,r0,r1|r0
00000109: c3 rts.w
0000010a: 00002000 val1: dc.l $2000
0000010e: 00000100 val2: dc.l $0100
TITLE MULPract (mul.asm).
INCLUDE Irvine32.inc
.data
val1 WORD 2000h
val2 WORD 0100h
.code
main PROC
mov ax, val1
mul val2
;mov ebx, dx:ax ;<== doesn't work
shl edx, 16 ;<== this works but requires 2 instructions
mov dx, ax ; --- shl then mov
exit
main ENDP
END main
- Follow-Ups:
- Re: newbie: MUL product
- From: Brian
- Re: newbie: MUL product
- References:
- newbie: MUL product
- From: Brian
- newbie: MUL product
- Prev by Date: Re: How send character to keyboardbuffer?
- Next by Date: Re: cFASM (calling FASM as a C function)
- Previous by thread: newbie: MUL product
- Next by thread: Re: newbie: MUL product
- Index(es):