I got an assignment to write a program in assembly that can multiply a number by -1 without using the neg
or mul
instructions. I tried to use shl
and shr
but I can't make it work for some reason. Does someone know how I can do it? (in the binary signed 2's complement)
This is the frame of the code:
org 100h
jmp start
start:
mov bx, 0000000000000010b
; here i need to multiply by -1 the number that in bx
mov ah, 0
int 16h
ret