/assembly-x86-64

Trying out writing arithmetic, conditional, looping components, procedure calls, conditional jumps and stacks in x86-64. For CSO course, Spring 2021.

Primary LanguageAssembly

forthebadge

This assignment uses x86-64 instruction set. You can find a cheatsheet here.

This was done as a part of the Computer System Organisation course, Spring 2021


Problem 1

Check if a given integer (64-bit) number, N, contains an odd number of 1s in its bit representation.

Input/Output Format

  • INPUT: You will be given an integer N.
  • OUTPUT: TRUE, if the given number contains odd number of 1(s), FALSE otherwise.

Sample Test Case

Input: N = 153
Output: FALSE
Note: Bit-wise representation of 153 = 010011001


Problem 2

Given a matrix A of dimension N x M. Find the transpose of the matrix A.

Input/Output Format

  • INPUT : N, M, and A.
  • OUTPUT: Transpose of matrix A

Sample Test Case

Input :
2 3
1 2 9
0 4 7
Output:
1 0
2 4
9 7


Problem 3

Given integers N and M. Find modulo of sum of the prime numbers less than N with M.

Input/Output Format

  • INPUT : N, M.
  • OUTPUT: (Sum of prime number less than N)% M.

Sample Test Case

Input : 10 999
Output: 17