diff --git a/README.md b/README.md index 24307494ff35862fbfe5acc36be35a211a4f030d..39a083b2eb0ef5afa60ba1ebb5236846f3b60fe8 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ **Deadline hard**: 9 aprilie 2025, 11:55PM -**Responsabili** +**Authors** * Robert Grancsa * Adelina Alexe @@ -27,15 +27,13 @@ The translation should be as simple as possible while covering basic arithmetic ## Conventions and Guidelines -Because we want to prevent you from having to juggle with registers and allocate memory for vectors. +Because we want to prevent you from having to juggle with registers, we'll use some simple conventions. - **Basic Register Mapping:** - `A` â `eax` - `B` â `ebx` - `C` â `ecx` - `D` â `edx` - - - When - **Data types** - We'll assume all of the data types are **4 bytes** - When you see a number, we will treat it as a int (4 bytes) @@ -105,9 +103,9 @@ Similar to MUL, DIV works with EAX as the primary operand, but it also considers | **C Code** | **ASM Code** | |------------ |---------------- | | `a = a * 3;` | `MUL 3` | -| `b = b * c;` | `MOV eax, ebx` | -| | `MUL ecx` | -| | `MOV ebx, eax` | +| `b = b * c;` | `MOV eax, ebx` | +| | `MUL ecx` | +| | `MOV ebx, eax` | | `a = a / 3;` | `MOV eax, a` | | | `DIV 3` | | | `MOV a, eax` | @@ -134,17 +132,14 @@ SHL (Shift left) and SHR (Shift right) are bitwise shift instructions. - SHL: Moves bits to the left, filling the rightmost bits with zeros. Each shift effectively **multiplies** the value by 2. - Example: `00001100` (`12` in decimal) shifted left by 1 becomes `00011000` (`24` in decimal). - - SHR: Moves bits to the right, filling the leftmost bits with zeros. Each shift effectively **divides** the value by 2. - Example: `00001100` (`12` in decimal) shifted left by 1 becomes `00000110` (`6` in decimal). - | **C Code** | **ASM Code** | |------------- |---------------- | | `a = a << 1` | `SHL eax, 1` | | `b = b >> 2` | `SHR ebx, 2` | - ### Conditional Statements #### CMP Instrunction @@ -235,7 +230,7 @@ Coding style can be run directly in the checker, by pressing `C`, or by using th - \>= 5 of `WARNING` => -5 points - \>= 1 of `ERROR` => -10 points -## Mentiuni +## Notes - The implementation can be done in any file, and the executable must be named `transpiler`, situated in the root of the folder, same as the initial makefile does