subtraction of numbers from 32 to 64

Asked

Viewed 135 times

0

I am learning to code in Assembly and I have a problem which is the following:

I have a result of a subtraction in number of 32 bits, and it has to return a number of 64 bits.

Note: I’m using a 32-bit linux vm

1 answer

0

.intel_syntax noprefix

.comm   diff64, 8, 8         # Declara simbolo de 64 bits

MOV EBX, 87654321            # Minuendo em EBX
MOV EAX, 12345678            # Subtraendo em EAX

SUB EBX, EAX                 # Subtrai EAX de EBX, resultado em EAX

MOV DWORD PTR diff64, EAX    # Preenche 32bits menos significativos do simbolo de 64bits
MOV DWORD PTR diff64 + 4, 0  # Preenche 32bits mais significativos do simbolo de 64bits

Browser other questions tagged

You are not signed in. Login or sign up in order to post.