Skip to content

Instantly share code, notes, and snippets.

@toptensoftware
Created October 15, 2016 23:40
Show Gist options
  • Select an option

  • Save toptensoftware/7c7152844183b893925a1e8988067a55 to your computer and use it in GitHub Desktop.

Select an option

Save toptensoftware/7c7152844183b893925a1e8988067a55 to your computer and use it in GitHub Desktop.
Capturing CPU instruction behaviour
ushort adc16(ushort inFlags, ushort a, ushort b, ushort* outFlags)
{
__asm
{
push word ptr[inFlags]
popf
mov ax, word ptr[a]
adc ax, word ptr[b]
pushf
mov esi, dword ptr[outFlags]
pop word ptr[esi]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment