Skip to content

Instantly share code, notes, and snippets.

@gitpraetorianlabs
Last active June 1, 2016 23:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gitpraetorianlabs/0b41ba8cdccb00789b1545d063819949 to your computer and use it in GitHub Desktop.
Save gitpraetorianlabs/0b41ba8cdccb00789b1545d063819949 to your computer and use it in GitHub Desktop.
#include <stdio.h>
// What if....
// This is to analyze how basic branching works on MIPS
// by b1ack0wl
int main(int argc, char **argv[]){
if (argc < 2 ){
printf("Usage: %s number", argv[0]);
return 1;
}
int a = atoi(argv[1]); // cast argv[1] as an integer
if (a < 5) {
printf("%i is less than 5", a);
}
else{
printf("%i is greater than 5", a);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment