Skip to content

elisaarghir/ASM_tasks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ASM_tasks

TASK 1

  • Subtask 1 - Odd numbers : Posts with odd IDs are considered brainrot, so in this subtask, you need to remove the odd numbers from a list of numbers provided as a parameter. The numbers in the list represent the IDs of certain Instagram posts.

  • Subtask 2 - Power-numbers : Once the odd numbers have been removed, Alex asks us to also eliminate the numbers in the list that are powers of 2. As a result, the posts with those IDs will disappear after removing the numbers from the list, making it easier for Alex to implement his algorithm.

  • source array is traversed with ecx, while ebx stores the number of elements in target.

  • Each element is loaded into edx, then checked if it is even (bit 0 in eax) and if it is a power of two (n & (n-1) == 0). Numbers that are not powers of two are added to target.

TASK 2 - Check valid dates

  • Event validation: The structure fields (year, month, day) are extracted and validated against their limits. Invalid events are marked with valid = 0.
  • Sorting: A bubble sort is implemented: first by valid, then chronologically (year, month, day), and finally by name (strcmp). Events are swapped byte by byte.

TASK 3 - BASE64 Encryption

  • Base64 implementation: Data is processed in groups of 3 bytes (24 bits) loaded into eax. These are split into 4 groups of 6 bits using shifts and converted into characters, with the result stored in dest.

TASK 4 - SUDOKU

  • Check_row: For each row (offset row * 9), values are verified to be within [1–9] and without duplicates.
  • Check_column: Same approach, but index is computed as row * 9 + col.
  • Check_box: The offset of each 3×3 box is computed as (box/3) * 27 + (box%3) * 3. The 9 elements are traversed, adjusting the offset when moving to the next row.

About

homework in Assembly language, with various exercices

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors