mirror of
https://github.com/libretro/x86-assembly-cheat.git
synced 2026-11-07 12:47:59 -10:00
24 lines
409 B
NASM
24 lines
409 B
NASM
; # CDQ
|
|
|
|
; Convert double word to quadword.
|
|
|
|
; Sign extend `eax` into `edx:eax`.
|
|
|
|
; Common combo with idiv 32-bit, which takes the input from `edx:eax`:
|
|
; so you need to set up `edx` before calling it.
|
|
|
|
%include "lib/asm_io.inc"
|
|
|
|
ENTRY
|
|
mov eax, 1
|
|
mov edx, 0x01234567
|
|
cdq
|
|
ASSERT_EQ edx, 0
|
|
|
|
mov eax, -1
|
|
mov edx, 0x01234567
|
|
cdq
|
|
ASSERT_EQ edx, 0xFFFFFFFF
|
|
|
|
EXIT
|