![]() |
|
#5
|
|||
|
|||
|
IIUC, you want to express something like this in assembly:
Code:
int result = n ? -1 : 0; Code:
mov eax, [val] neg eax sbb eax, eax Example: eax contains a non-zero value, say x. neg eax turns this into -x and sets the CF. sbb eax, eax computes eax = eax - eax - cf <-> eax = 0 - CF. Same drill when eax is zero initially. |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Hex-Rays and negative structure offsets | jonwil | General Discussion | 3 | 02-20-2019 10:37 |