Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tema-1-2025
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Albert-Mark STAN
tema-1-2025
Commits
cf1d6243
Commit
cf1d6243
authored
3 weeks ago
by
Robert Grancsa
Browse files
Options
Downloads
Patches
Plain Diff
Final readme changes
Signed-off-by:
Robert Grancsa
<
robert.grancsa2002@gmail.com
>
parent
3ad67b5d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+6
-11
6 additions, 11 deletions
README.md
with
6 additions
and
11 deletions
README.md
+
6
−
11
View file @
cf1d6243
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
**Deadline hard**
: 9 aprilie 2025, 11:55PM
**Deadline hard**
: 9 aprilie 2025, 11:55PM
**
Responsabili
**
**
Authors
**
*
Robert Grancsa
*
Robert Grancsa
*
Adelina Alexe
*
Adelina Alexe
...
@@ -27,15 +27,13 @@ The translation should be as simple as possible while covering basic arithmetic
...
@@ -27,15 +27,13 @@ The translation should be as simple as possible while covering basic arithmetic
## Conventions and Guidelines
## Conventions and Guidelines
Because we want to prevent you from having to juggle with registers
and allocate memory for vector
s.
Because we want to prevent you from having to juggle with registers
, we'll use some simple convention
s.
-
**Basic Register Mapping:**
-
**Basic Register Mapping:**
-
`A`
→
`eax`
-
`A`
→
`eax`
-
`B`
→
`ebx`
-
`B`
→
`ebx`
-
`C`
→
`ecx`
-
`C`
→
`ecx`
-
`D`
→
`edx`
-
`D`
→
`edx`
-
When
-
**Data types**
-
**Data types**
-
We'll assume all of the data types are
**4 bytes**
-
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)
-
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
...
@@ -105,9 +103,9 @@ Similar to MUL, DIV works with EAX as the primary operand, but it also considers
|
**C Code**
|
**ASM Code**
|
|
**C Code**
|
**ASM Code**
|
|------------ |---------------- |
|------------ |---------------- |
|
`a = a * 3;`
|
`MUL 3`
|
|
`a = a * 3;`
|
`MUL 3`
|
|
`b = b * c;`
|
`MOV eax, ebx`
|
|
`b = b * c;`
|
`MOV eax, ebx`
|
|
|
`MUL ecx`
|
| |
`MUL ecx`
|
|
|
`MOV ebx, eax`
|
| |
`MOV ebx, eax`
|
|
`a = a / 3;`
|
`MOV eax, a`
|
|
`a = a / 3;`
|
`MOV eax, a`
|
| |
`DIV 3`
|
| |
`DIV 3`
|
| |
`MOV a, eax`
|
| |
`MOV a, eax`
|
...
@@ -134,17 +132,14 @@ SHL (Shift left) and SHR (Shift right) are bitwise shift instructions.
...
@@ -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.
-
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).
-
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.
-
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).
-
Example:
`00001100`
(
`12`
in decimal) shifted left by 1 becomes
`00000110`
(
`6`
in decimal).
|
**C Code**
|
**ASM Code**
|
|
**C Code**
|
**ASM Code**
|
|------------- |---------------- |
|------------- |---------------- |
|
`a = a << 1`
|
`SHL eax, 1`
|
|
`a = a << 1`
|
`SHL eax, 1`
|
|
`b = b >> 2`
|
`SHR ebx, 2`
|
|
`b = b >> 2`
|
`SHR ebx, 2`
|
### Conditional Statements
### Conditional Statements
#### CMP Instrunction
#### CMP Instrunction
...
@@ -235,7 +230,7 @@ Coding style can be run directly in the checker, by pressing `C`, or by using th
...
@@ -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
-
\>
= 5 of
`WARNING`
=> -5 points
-
\>
= 1 of
`ERROR`
=> -10 points
-
\>
= 1 of
`ERROR`
=> -10 points
##
Mentiuni
##
Notes
-
The implementation can be done in any file, and the executable must be named
-
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
`transpiler`
, situated in the root of the folder, same as the initial makefile does
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment