Re: newbie: MUL product



Brian wrote:

ie: IMUL eax,ebx,-09

(unfortunately no unsigned MUL in this forms)

Maybe you should use an other assembler which allows
you to define the alias MUL for this IMUL instruction.
Or directly code it in HEX, if you use uppercase letters,
the CPU does an unsigned multiply (try it and you will
see it works):

00000000: 69 c3 fffffff7 muls.l #-9,r3,r0
00000006: 69 C3 FFFFFFF7 mulu.l #4294967287,r3,r0

Thanks Herbert, but to switch to another assembler would seem
counter-productive for me at this point, as I'm a complete newbie, and
I mainly want to learn "one" assembler at this point.

Sorry if I confused you. This was meant as a joke for Wolfgang
(he is a hex coder). The "IMUL eax,ebx,-09" instruction is
a 32x32->32 operation and therefore the result is (as for
add/sub) calculated modulo 2^32. And the least significant
32 bit of a 32 x 32 bit multiplication are independent from
the interpretation of the number (signed/unsigned). Only
the most significant 32 bit are different for signed/unsigned
numbers. Therefore there exist two different instructions
for 32x32->64 multiplication (one for signed and one for
unsigned numbers) but only one for 32x32->32 multiplication
which gives the correct result for signed and unsigned numbers.
The different meaning of uppercase/lowercase letters was just
a joke.
.



Relevant Pages

  • Re: newbie: MUL product
    ... (unfortunately no unsigned MUL in this forms) ... you to define the alias MUL for this IMUL instruction. ... but to switch to another assembler would seem ...
    (alt.lang.asm)
  • Re: newbie: MUL product
    ... (unfortunately no unsigned MUL in this forms) ... Maybe you should use an other assembler which allows ... you to define the alias MUL for this IMUL instruction. ...
    (alt.lang.asm)
  • Re: hla set up for the art of assembly
    ... are using it to teach assembly programming, ... Very assembler like: ... Note that HLA allows a form that lets you specify a constant. ... actually support a MUL or IMUL instruction that has a constant operand. ...
    (alt.lang.asm)
  • Re: Loading single word to a xmm register
    ... Certainly not the types of programming that is being done with SSE ... And keep in mind that if your assembler were running on a CPU prior to ... the advent of the SSE instruction set, then your assember ...
    (alt.lang.asm)
  • Re: HLA v1.86 is now available
    ... Which instruction do they know, when they the first time need ... Most students in the lab *would* be capable of loading a constant into ... you ought to learn Intel syntax and drop nonsense like this. ... Why is it important to "learn how to operate the assembler, ...
    (alt.lang.asm)