mirror of
https://github.com/libretro/x86-assembly-cheat.git
synced 2026-11-07 12:47:59 -10:00
31 lines
426 B
NASM
31 lines
426 B
NASM
; # IMUL
|
|
|
|
; Signed multiply.
|
|
|
|
; Has many more forms than the unsigned version,
|
|
; including immediate and up to three arguments.
|
|
|
|
%include "lib/asm_io.inc"
|
|
|
|
ENTRY
|
|
mov eax, 2
|
|
mov ebx, 2
|
|
imul ebx
|
|
ASSERT_EQ 4
|
|
ASSERT_EQ ebx, 2
|
|
|
|
mov eax, -2
|
|
imul eax
|
|
ASSERT_EQ 4
|
|
|
|
mov eax, 2
|
|
imul eax, 2
|
|
ASSERT_EQ 4
|
|
|
|
mov eax, 0
|
|
mov ebx, 2
|
|
imul eax, ebx, 2
|
|
ASSERT_EQ 4
|
|
|
|
EXIT
|