Re: newbie: MUL product
- From: Brian <stringchopperREMOVEALLCAPS@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 29 Mar 2007 11:25:23 -0400
On Thu, 29 Mar 2007 17:04:48 +0200, Herbert Kleebauer <klee@xxxxxxxxx>
wrote:
Brian wrote:Herbert, thanks for your reply. I haven't memorized opcodes yet, but
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
I suppose I can work it out.
What if my multiplier and multiplicand are both 32-bit to begin with,
and I'm in a 32 bit environment.
Are my options in that case as follows:
Define a QWORD (64-bit) "product" variable
move offset of product variable to register
copy edx (high dword) to offset of product variable
copy eax (low dword) to (offset + 4)
Then, assuming that is a good way to store my 64 bit product, that
raises another question with which I'm ignorant at this point:
I think I will have little endian issues at this point. My intel
processor uses little endian storage, so I think that means I want to
store the LOW Dword at the offset first, then the high dword (opposite
to what I wrote in the above paragraph). Correct?
--
thanks,
Brian
To the best of my knowledge, I have:
1) asked a question specifically related to this newsgroup
2) not used my email to request answers be sent there
3) not top-posted
4) not used bad grammar that would make me appear more stupider
.
- Follow-Ups:
- Re: newbie: MUL product
- From: Herbert Kleebauer
- Re: newbie: MUL product
- References:
- newbie: MUL product
- From: Brian
- Re: newbie: MUL product
- From: Herbert Kleebauer
- newbie: MUL product
- Prev by Date: Re: cFASM (calling FASM as a C function)
- Next by Date: Re: newbie: MUL product
- Previous by thread: Re: newbie: MUL product
- Next by thread: Re: newbie: MUL product
- Index(es):
Relevant Pages
|