Re: newbie: MUL product
- From: Herbert Kleebauer <klee@xxxxxxxxx>
- Date: Fri, 30 Mar 2007 13:02:09 +0200
Frank Kotler wrote:
Okay, Herbert was joking about the "case" part. But I think he was
making a point about why his syntax is "better" than Intel's...
Nobody understands my jokes! It was meant the way, that if people
(and I also belonged to these people when I wrote my assembler, so
I called the instruction "muls" instead just "mul") don't know that for
a 32x32->32 multiplication there is no difference between signed
and unsigned multiplication, then it would be better if an assembler
would provide two different mnemonics (mul and imul in the case
of Intel syntax) for the same opcode.
Intel syntax wants to give us fewer mnemonics to learn. We just say
"imul" in every case, and let the assembler figure out which opcode from
the operands. If *we* care which opcode, *we* need to figure it out from
the operands, too. In some cases ("inc [esi]"), we need to tell the
assembler "inc byte [esi]" or "inc word [esi]" or "inc dword [esi]".
Herbert's "inc.b", "inc.w", and "inc.l" put the information "where it
belongs". In the case of "muls.l" and "mulu.l"... since they generate
the same opcode... logic fails me... :)
I don't have mulu.l for 32x32->32 (see above). But if I would now
write the assembler, I either would call the 32x32->32 only
"mul" or would really allow both names ("muls" and "mulu") for
the same opcode. But yes, I think my syntax is more clear, because
you immediately see what is multiplied and where the result is stored:
muls.b ADRS,r0,m0|r0
muls.l ADRS,r0,r1|r0
muls.l ADRS,rk,rk ; k=0..7
muls.l #imm32,ADRS,rk ; k=0..7
muls.w ADRS,r0,r1|r0
muls.w ADRS,rk,rk ; k=0..7
muls.w #imm16,ADRS,rk ; k=0..7
mulsq.l #imm8,ADRS,rk ; k=0..7
mulsq.w #imm8,ADRS,rk ; k=0..7
mulu.b ADRS,r0,m0|r0
mulu.l ADRS,r0,r1|r0
mulu.w ADRS,r0,r1|r0
.
- Follow-Ups:
- Re: newbie: MUL product
- From: Brian
- Re: newbie: MUL product
- References:
- newbie: MUL product
- From: Brian
- Re: newbie: MUL product
- From: Wolfgang Kern
- Re: newbie: MUL product
- From: Herbert Kleebauer
- Re: newbie: MUL product
- From: Brian
- Re: newbie: MUL product
- From: Frank Kotler
- Re: newbie: MUL product
- From: Brian
- Re: newbie: MUL product
- From: Frank Kotler
- newbie: MUL product
- Prev by Date: Re: newbie: MUL product
- Next by Date: Re: ascii to tword - help
- Previous by thread: Re: newbie: MUL product
- Next by thread: Re: newbie: MUL product
- Index(es):
Relevant Pages
|