result of subtraction of numbers from 32 to 64

0

I'm learning to program in assembly and I have a problem that is as follows:

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

Note: I am using a 32-bit linux vm

    
asked by anonymous 19.10.2017 / 23:03

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
    
20.10.2017 / 00:19