Re: newbie: MUL product



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
.



Relevant Pages

  • Re: newbie: MUL product
    ... Maybe you should use an other assembler which allows you to define the alias MUL for this IMUL instruction. ... Herbert doesn't like Intel syntax - feel's it's illogical, and his 68K-style syntax is more logical and more regular. ...
    (alt.lang.asm)
  • Re: My view on this "Is blah an assembler"
    ... > means it would be an Assembler. ... Assembly language lacks higher-level logical ... inconsistent and ambiguous syntax (that directly ... > mov eax MySymbolic; Adress ...
    (alt.lang.asm)
  • Re: To C.
    ... to the member's label inside the structure ... relative offset of the data from the start of the structure... ... As NASM or any other "real assembler", as you like to put it, ... whatever strange syntax is accepted... ...
    (alt.lang.asm)
  • Re: HLA is a text converter (text to object code)
    ... I don't mind the HLA variable declarations and function ... They exist to help allow beginning programmers to write ... > syntax, newcomers can apply all the style guidelines they've used ... > who already use another assembler. ...
    (alt.lang.asm)
  • Re: Why there are so many assemblers.
    ... "Intel Syntax" means that the assembler uses the language grammar ... NASM doesn't use that grammar. ... it is not an "Intel Syntax" assembler. ...
    (alt.lang.asm)