Done C part

This commit is contained in:
Claudio Maggioni 2023-09-22 20:44:41 +02:00
parent 20bcf7bea0
commit fc776ca9e6
6 changed files with 14 additions and 9 deletions

View file

@ -22,11 +22,11 @@ Please complete this checklist (turn [ ] into [X]) before you submit:
- [x] I completed java/compile.sh - [x] I completed java/compile.sh
- [x] I completed java/run.sh - [x] I completed java/run.sh
- [x] I completed java/disassemble.sh - [x] I completed java/disassemble.sh
- [ ] I solved the C part: - [x] I solved the C part:
- [ ] I implemented the C code - [x] I implemented the C code
- [ ] I completed c/compile.sh - [x] I completed c/compile.sh
- [ ] I completed c/run.sh - [x] I completed c/run.sh
- [ ] I completed c/disassemble.sh - [x] I completed c/disassemble.sh
- [ ] I wrote the source code myself and did not look at the source code of my classmates - [ ] I wrote the source code myself and did not look at the source code of my classmates
- [ ] I ran test/test.sh and verified that it produces the expected output - [ ] I ran test/test.sh and verified that it produces the expected output
- [ ] I verified that the disassembled instructions appear (not just the function names) - [ ] I verified that the disassembled instructions appear (not just the function names)

View file

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
# TODO Command to compile main.c with gcc gcc -o main ./main.c

View file

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
# TODO Command to disassemble the compiled C program with otool otool -xv ./main

BIN
c/main Executable file

Binary file not shown.

View file

@ -1 +1,6 @@
// TODO Write C code #include <stdio.h>
#include <stdlib.h>
int main() {
puts(getenv("USER"));
}

View file

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
# TODO Command to run the compiled C program ./main