Created
June 29, 2021 23:16
-
-
Save scolton99/34a910cd5ce3d3a9b3d255a980f4866c to your computer and use it in GitHub Desktop.
C file used to generate assembly for the first midterm review of NU COMP_SCI 213-0 (Spring 2021).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| long sus(long l, long m) { | |
| /* do nothing useful */ | |
| if (!m) | |
| return 0; | |
| else | |
| return l + sus(l - 1, m - 1); | |
| } | |
| int amogus(unsigned char z) { | |
| long y = 0; | |
| if (z) { | |
| while (z) { | |
| y += sus(z, z); | |
| z--; | |
| } | |
| return y; | |
| } else { | |
| return 0; | |
| } | |
| } | |
| int main() { | |
| volatile unsigned char y; | |
| return (int) amogus(y); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment