[-] final submission & operation counter
by guydan - Saturday, 21 May 2016 00:25:07
1. are the deliverables "calc.s" and the makefile, like always in a zip file named id1_id2.zip?

2. also, how can I see what my program returned? for the example given i can see while debugging that my counter is indeed 11, but gdb prints "[Inferior 1 (process ...) exited with code 013]". generally, it seems like in every execution the exit code is greater than the counter by 2. is the exit code really the value in eax?
Re: final submission & operation counter
by achiadg - Saturday, 21 May 2016 09:28:57
צריך להגיש makefile? 
או שהקובץ עם הקוד מספיק? אין הוראות הגשה בעבודה
Re: final submission & operation counter
by guydan - Tuesday, 24 May 2016 00:01:45
if you run your program like this:

calc.bin; echo$?

the return value will be printed on the screen (for anyone who waits for the answer).
Re: final submission & operation counter
by ofirhau - Wednesday, 25 May 2016 20:07:49
2. We also need to return the number of operations from main? That wasn't mentioned in the assignment...
"The "main" program (that you also need to write in assembly language) calls my_calc that is your primary procedure, and prints out the number of operations performed by my_calc. (Note that my_calc should count and return that number)."

From here, I can see that only my_calc return the number of operations- but it returns is to main.
I don't see that main needs to return the number of operations at the end of the program, it only needs to print it...

Am I right?


[-] Re: final submission & operation counter
by shimony - Thursday, 26 May 2016 11:08:40
The exit code can be set via:
1. The argument to the exit( status) system call (C lib interface),
2. Argument to the actual system exit system call (eax = 1, ebx=status)
3. Returned value from main( ), in which case the value in eax is the status.
  (then init.o presumably activates exit( status)).

To see this exit code, either use the echo, or run in backgound and get a notification
"[job number] exit status-number  program-name" (or "Done" which means status 0).


[-] Re: final submission & operation counter
by ofirhau - Thursday, 26 May 2016 13:20:07
As I asked above, why we even need to do that?
It wasn't written in the description that we need to exit the program with status=num of operations, it was  written that we just need to print the num of operations.

Also, can you update what files we need to submit?
[-] Re: final submission & operation counter
by shaera - Monday, 30 May 2016 09:18:35
אופן ההגשה עודכן בדף העבודות

https://www.cs.bgu.ac.il/~caspl162/Assignments

לגבי החזרת הערך ביציאה, אנו נקבל הדפסה של הערך כפי שהופיע בדוגמא של העבודה.
[-] Re: final submission & operation counter
by tzchory - Monday, 30 May 2016 10:22:53
זה משנה אם הדפסתי כך:מספר הפעולות המוצלחות הוא 7 במקום פשוטלהדפיס 7?
Re: final submission & operation counter
by shaera - Monday, 30 May 2016 12:38:42
פשוט להדפיס את המספר ללא טקסט נוסף. כמו בדוגמא