Skip to content

Instantly share code, notes, and snippets.

@scottshuffler
Created February 4, 2015 20:24
Show Gist options
  • Save scottshuffler/e623c52f469b4e056d50 to your computer and use it in GitHub Desktop.
Save scottshuffler/e623c52f469b4e056d50 to your computer and use it in GitHub Desktop.
alu (int x, int y, int *flags, int op)
{
int result = 0;
switch (op)
{
CASE ADDL:
result = x+y;
result = (unsigned)x + (unsigned)y;
if (result < x)
{
flags |= 0x1;
}
if (result == 0)
{
flags |= 0x2;
}
//something about signed numbers
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment