Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b1e772d
teme: remove last year homework
RaduNico Mar 31, 2022
ea434b0
teme: publish tema-1
RaduNico Apr 1, 2022
503a2ef
Upload fixed checker for me boys
flpostolache Apr 2, 2022
1ea2af5
Fixed test6 wrong minus
tudorhodo Apr 2, 2022
73e10d3
fuck my life de test 6
tudorhodo Apr 3, 2022
ea82688
Stergere spatiu test 5
tudorhodo Apr 5, 2022
75636d3
Add 2022 homework number 2
razvanvirtan Apr 21, 2022
6a06faf
Add 2022 homework number 2
razvanvirtan Apr 21, 2022
a7fbe9d
Merge pull request #110 from systems-cs-pub-ro/2022-tema2
razvanvirtan Apr 22, 2022
74eaf8f
Add 2022 homework number 2
razvanvirtan Apr 21, 2022
9e9ddc6
Merge branch 'master' into 2022-tema2
razvanvirtan Apr 22, 2022
4687545
Merge pull request #111 from systems-cs-pub-ro/2022-tema2
razvanvirtan Apr 22, 2022
9c94a62
Update checker
razvanvirtan Apr 22, 2022
780361a
Merge pull request #112 from systems-cs-pub-ro/2022-tema2
razvanvirtan Apr 22, 2022
8d160b1
Lab-stiva: text ex0
RaduNichita May 1, 2022
6728cbb
Merge pull request #114 from systems-cs-pub-ro/rnichita/lab08-update
darius-m May 1, 2022
eaf2722
Update task.md
grecubogdan13 May 3, 2022
42b2192
Update task_64bit.md
grecubogdan13 May 3, 2022
e7fe6ea
Update points_distance
ilinca-strutu May 5, 2022
bf7b95c
Update points_distance
ilinca-strutu May 5, 2022
c52f1ef
Lab09: functii - schimbare link bonus (#116)
RaduNichita May 6, 2022
662fc41
Replace inline tasks
CristiBM May 1, 2022
89e1218
Merge pull request #117 from systems-cs-pub-ro/cristibm/lab-10-update
darius-m May 8, 2022
519fbff
lab10
May 19, 2022
ce82da7
lab11
May 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion laborator/content/apel-functii/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ Implementați funcția `toupper` astfel încât translatarea să aibă loc doar

### Bonus: rot13

Realizați și folosiți o funcție care face translatarea [rot13](http://www.decode.org/) a unui șir.
Realizați și folosiți o funcție care face translatarea [rot13](https://rot13.com/) a unui șir.

### Bonus: rot13++

Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ main:

; Initialize local variable.
mov dword [ebp-4], 0xCAFEBABE


; Fill data in buffer: buffer[i] = i+1
; Use ebx as buffer base address, ecx as index and dl as value.
Expand All @@ -46,7 +47,7 @@ fill_byte:
inc ecx
cmp ecx, 64
jl fill_byte

mov dword [ebx+ecx], 0xDEADBEEF
; Print data in buffer.
push buffer_intro_message
call printf
Expand All @@ -67,7 +68,9 @@ print_byte:

pop ecx ; restore ecx
inc ecx
cmp ecx, 64
;cmp ecx, 64
;je change_variable
cmp ecx, 68
jl print_byte

; Print new line. C equivalent instruction is puts("").
Expand All @@ -81,6 +84,12 @@ print_byte:
push var_message_and_format
call printf
add esp, 8

; change_variable:
; push eax
; xor eax,eax
; mov al,
; mov byte [ebx+ecx],eax

leave
ret
1 change: 1 addition & 0 deletions laborator/content/buffer-overflow/5-6-read-stdin/payload
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFLOW
Binary file not shown.
15 changes: 15 additions & 0 deletions laborator/content/interactiune-c-assembly/1-2-max-c-calls/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include <stdio.h>

unsigned int get_max(unsigned int *arr, unsigned int len, unsigned int *pos);

int main(void)
{
unsigned int arr[] = { 19, 7, 129, 87, 54, 218, 67, 12, 19, 99 };
unsigned int max, pos;

max = get_max(arr, 10, &pos);

printf("max: %u at position %u\n", max, pos);

return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,28 @@ get_max:

; save ebx in callee
push ebx

push edx
; [ebp+8] is array pointer
; [ebp+12] is array length

; [ebp+16] maximum position
mov ebx, [ebp+8]
mov ecx, [ebp+12]
mov edx, [ebp+16]
xor eax, eax

compare:
cmp eax, [ebx+ecx*4-4]
jge check_end
mov eax, [ebx+ecx*4-4]
mov [edx], ecx

check_end:
loopnz compare

mov ecx, [edx]
dec ecx
mov [edx], ecx
pop edx
pop ebx

leave
ret
ret

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
PROGNAME := inline_for
PROGNAME := stack-frame
include ../../utils/Makefile.generic

18 changes: 18 additions & 0 deletions laborator/content/interactiune-c-assembly/3-stack-frame/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <stdio.h>

void print_hello(void);

void asm_call_wrapper(void)
{
print_hello();
printf(" world");
}


int main(void)
{
asm_call_wrapper();
printf("!\n");

return 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
extern printf

section .data
message db "Hello", 0

section .text

global print_hello

; TODO: Adăugați instrucțiunea lipsă
print_hello:
push ebp
mov ebp, esp
push message
call printf
add esp, 4

leave
ret
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ extern get_max
section .data
arr: dd 19, 7, 129, 87, 54, 218, 67, 12, 19, 99
len: equ $-arr

print_format: db "max: %u", 13, 10, 0

pos: dd 0
print_format: db "max: %u at position:%u", 13, 10, 0
section .text

global main
Expand All @@ -20,17 +19,18 @@ main:
; using shr 2 (shift right with 2 bits).
mov eax, len
shr eax, 2

push pos
push eax
push arr
call get_max
add esp, 8
add esp, 12

; Print max.
push dword[pos]
push eax
push print_format
call printf
add esp, 8

leave
ret
re
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include <stdio.h>

unsigned int get_max(unsigned int *arr, unsigned int len, unsigned int *pos)
{
unsigned int max = 0;
size_t i;

for (i = 0; i < len; i++)
if (max < arr[i]) {
max = arr[i];
*pos = i;
}

return max;
}
15 changes: 0 additions & 15 deletions laborator/content/interactiune-c-assembly/4-5-max-c-calls/main.c

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
PROGNAME := inline_rotate
PROGNAME := regs-preserve
include ../../utils/Makefile.generic

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <stdio.h>

void double_array(unsigned int *array, unsigned int len)
{
size_t i;

for (i = 0; i < len; i++)
*(array + i) *= 2;
}
Loading