/Assembly-Course-Task

Microprocessors & Assembly Language CSW350 course Task

Primary LanguageAssemblyCreative Commons Zero v1.0 UniversalCC0-1.0

Assembly-Course-Task

Microprocessors & Assembly Language CSW350 course Task

Assembly code uses the Irvine32 Library, the version of the library I was using is on my github account.

Questions

  • In the procedure called Q1, write assembly code that swaps two characters in a word. You should read the indices of the two characters to swap and the word, then display the word again with the characters swapped.

    Q1 mark: 2/2

  • In the procedure called Q2, write assembly code that reads a number 𝑁 and calculates the 𝑁 terms of the Fibonacci sequence.

    Q2 mark: 2/2

  • In the procedure called Q3, write assembly code that takes a start character and an end character from the user, then reads a number 𝑁 of characters. Then count the number of characters from the 𝑁 input characters that are in the range between the start and end characters. The character range is inclusive, meaning that the characters on the boundary of the range can also be counted.

    Q3 mark: 2/2

  • In the procedure called Q4, write assembly code that reads an input string from the user, then counts the number of lowercase characters in the string. Then print the lowercase characters present in the string, separated by commas.

    Q4 mark: 2/2

  • In the procedure called Q5, write assembly code that reads a string from the user and checks whether the string is a palindrome. A palindrome is a string that is read from left to right the same as from right to left. Your program should print Y if the string is a palindrome and N if it isn't.

    Q5 mark: 2/2

  • In the procedure called Q6, write assembly code that takes a number 𝑁 from the user and draws a triangle of asterisks. Note that the first row has 𝑁−1 spaces and 1 asterisk, while the last row has no spaces and 2𝑁−1 asterisks.

    Q6 mark: 2/2