/NASM-and-MIPS

Nasm and Mips programs

Primary LanguageAssembly

NASM

This repository contains solutions to practice questions given in HARDWARE_LAB - CSE -2021 , NIT CALICUT .


ARRAY AND NUMBERS .

  1. Program to find number of even and number of odd numbers in an array of length n.
  2. Program to identify numbers in an array that are divisible by 7.
  3. Program to Calculate Sum & Average of an Array
  4. Enter two digit numbers to an array of length 'n',
    a) identify the number which is having highest occurrence
    b) identify the number which is having lowest occurrence
  5. program to search for a number in an array of numbers using Linear Search
  6. program to accept 10 numbers into an array and find the largest and smallest number
  7. program to find common elements between two arrays

STRING-HANDLING

  1. program to check whether a string is a palindrome or not
  2. program to read a string and reverse it
  3. program to read 2 strings and concatenate them
  4. program to read 2 strings and compare them
  5. program to read a string and count the number of spaces present in it
  6. program to Count number of vowels in a given string

STRING-HANDLING-PRO

  1. program to read a sentence with n words, interchange 1st and nth words, 2nd and n-1th word etc
  2. Find the Length of the Longest Repeating Sequence in a String
  3. NASM program to read a sentence and print the sentence with words sorted in lexicographic (i.e., dictionary) order.
  4. Program to Find the Largest and Smallest Words in a String
  5. Program to Search a Word in a string & Replace it with another Specified Word

Additional-Questions

  1. Remove the given substring in the given string
    Example :

     No pain , No gain .... substring to be removed - 'in'
     Output :  No pa , No ga
    

    Source-code

  2. Q: Given a string, that contains special characters together with alphabets (‘a’ to ‘z’ and ‘A’ to ‘Z’), reverse the string in a way that special characters are not affected. Treat all letters other than numbers (1-9) and characters (A-Z & a-z) as special characters. Example 1:

    Input: str = "a,b$c"
    Output: str = "c,b$a"
    Note that $ and , are not moved anywhere.
    Only subsequence "abc" is reversed
    

    Example 2:

    Input: str = "Ab,c,de!$"
    Output: str = "ed,c,bA!$"
    

Source-code


MIPS ::

  1. program to print first n Fibonacci numbers. Where n is the input.
  2. Read two number and check whether they are twin prime or not. A twin prime is a prime number that is either 2 less or 2 more than another prime number - for example (41, 43).
  3. program to read 2 strings and concatenate them
  4. Program to Find the Largest and Smallest Word in a String.
  5. Program to Search a Word in a string & Replace it with another Specified Word