Skip to content

Add solutions for lab10#1

Open
andreimmihai wants to merge 6 commits into
masterfrom
lab10
Open

Add solutions for lab10#1
andreimmihai wants to merge 6 commits into
masterfrom
lab10

Conversation

@andreimmihai

Copy link
Copy Markdown
Owner

No description provided.

- I defined a global variable "pos", where pos is the position of the
maximum value in the array
- I modified the assembly code to accept the additional argument of the
get_max function for the position and update it with the index of the
maximum value

Signed-off-by: Andrei-Claudiu Mihai <andreiimmihai@gmail.com>
- Added the missing "mov ebp, esp" instruction to correctly set up the
stack frame

Signed-off-by: Andrei-Claudiu Mihai <andreiimmihai@gmail.com>
- Modified get_max to return max value and postion

Signed-off-by: Andrei-Claudiu Mihai <andreiimmihai@gmail.com>
- Fix SEGAULT by preserving register around double_array call

Signed-off-by: Andrei-Claudiu Mihai <andreiimmihai@gmail.com>
- Fix compilation warning by adding puts function prototype in hello.c

Signed-off-by: Andrei-Claudiu Mihai <andreiimmihai@gmail.com>
- Fix export issues in a-func, b-var, c-var-2
- In a-func/hidden.c: Removed static from set() function to make it
globally accessible
- In b-var/plain.c: Removed static from age variable to export it
- In c-var-2: 1) hidden.c: Changed hidden_value to static to limit its
scope
	2) ops.h: Added extern declaration for age variable
	3) plain.c: Removed static from age variable to export it

Signed-off-by: Andrei-Claudiu Mihai <andreiimmihai@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant