logo
Tags down

shadow

Imul in 64-assembly


By : Rashi Rakkar
Date : September 15 2020, 09:00 PM
like below fixes the issue Your code assembles to
code :
0:  48 b8 ce a1 c7 fb c2    movabs rax,0x93f3ffc2fbc7a1ce
7:  ff f3 93
a:  48 bb be 5c 38 5a a0    movabs rbx,0x5862d8a05a385cbe
11: d8 62 58
14: 0f af c3                imul   eax,ebx


Share : facebook icon twitter icon

What exactly does the 3 operand imul instruction do in ia-32 assembly?


By : user2347519
Date : March 29 2020, 07:55 AM
hop of those help? Hooray for AT&T assembly base/index syntax! It's not a 3-operand multiply at all. It's the same 2-operand one you know and love, it's just that the first one is a bit complicated. It means:
code :
%ebp + (4 * %ebx) + 0xffffffd4
%ebp + (4 * %ebx) - 44
offset(base, index, multiplier)

I still don't get how IMUL works in Assembly


By : Rach
Date : March 29 2020, 07:55 AM
Hope this helps I am a begginer with assembly i just started learning it and i don't get how the instruction IMUL really works
code :
MOV AX, Mat    AX = 0x0A2A  (...00101010)
AND AL,7Ch     AX = 0x0A28  (...00101000)
OR AL,83h      AX = 0x0AAB  (...10101011)
XOR BL,BL      BL = 0x00
SUB BL,2       BL = 0xFE
IMUL BL        AX = 0xFFAB * 0xFFFE = 0x00AA
MOV Ris5,AX    Ris5 = 0x00AA
   00000000aaaaaaaa
*  00000000bbbbbbbb
=====================

   AAAAAAAAAAaaaaaa
*  BBBBBBBBBBbbbbbb
====================
         bbbbbbbb *a[0]
        bbbbbbbb  *a[1]
       bbbbbbbb   *a[2]
      bbbbbbbb    *a[3]
     bbbbbbbb     *a[4]
    bbbbbbbb      *a[5]
   bbbbbbbb       *a[6]
+ bbbbbbbb        *a[7]
==================
 cyyyyyyyxxxxxxxx       
Mat = 0A2A(hexadecimal)

Assembly 8086: Multiplication a*b without using MUL and IMUL


By : seagull
Date : March 29 2020, 07:55 AM
may help you . You can calculate a*b for n-bit numbers a and b by using n bit-tests, shifts and adds. But this is essentially what the MUL instructions does, in hardware, so you won't get anything faster than that.

x86 - Assembly, sub and imul doesn't work


By : kaushik srivatsan
Date : March 29 2020, 07:55 AM
Hope that helps Now I did check your source too, and it doesn't do anything meaningful. You don't understand the format of arguments you receive, and you don't understand the format of arguments for int 80h, 4 (sys_write).

Assembly imul signed


By : Oberluz
Date : March 29 2020, 07:55 AM
I hope this helps you . imul cl does AX = AL * CL, producing a full 16-bit signed product from 8-bit signed inputs.
Why did you expect the upper byte to be zero? That makes no sense for signed or unsigned.
Related Posts Related Posts :
  • 6502 randy hyde subroutine problem "JSR INCRTN"
  • when changing interrupt in assembly...?
  • Anonymous local labels (@@): Which assemblers support multi-step references such as @FF (second-next @@)?
  • How to implement the totalOrder predicate for floating point values?
  • Does nasm code automatically move to the next label if it meets the end of _start?
  • How to perform a calculation that triggers interrupt 0 without using the "int" command.?
  • How to check if number is even or odd in Assembler
  • Assembly push or reserve stack for 2 or more registers
  • Nasm - How does the program keep track of which register has stored negative or positive values
  • Call Instruction: Compilation into machine code
  • Why stack pointer need to be updated before jumping to application from bootloader
  • How to properly link two object files without affecting rip relative addressing?
  • UBUNTU 16.04 Getting libx86emu x86emu-demo to work?
  • Symbol 'a1' undefined (Assembly language)
  • Table of the instruction length of each assembly command
  • What is the difference between the instructions STI, RET and IRET in assembly
  • why SHL AL does not always multiply register AL by 2
  • x86 dissasembler that shows instruction extensions needed
  • Access violation when using two consecutive mov instructions
  • How to read x86 instruction tables from this site
  • 'wrong parameters' while using pointer in assembly, what's wrong?
  • Assembly using rN registers (r8,r9,...) have more code-size than other registers
  • Assembly: Not Executing Commands After Boot Signature
  • List for TI-84 z80 assembly calls?
  • Modifying Makefile to produce assembly files
  • Code converted from emu8086 to NASM isn't working
  • Can anyone explain this DOS hello world for emu8086?
  • EIP register value goes over 100 bytes
  • Which instructions can produce a branch misprediction on x86 CPUs?
  • Mixed destination/source operand order in RISC-V assembly syntax
  • shadow
    Privacy Policy - Terms - Contact Us © 35dp-dentalpractice.co.uk