TalMizrahii / Assembly-Pstrings

An Assembly Pstrings program and library, as part of the third assignment in Computer Systems course, Bar Ilan University.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


pStringMem

This gitHub repository is for the Third assignment given in Computer Systems course, Bar Ilan University.

DescriptionInstalling And ExecutingAuthor

Description

This is my second assembly project for the Computer Systems course at Bar Ilan university.

The project's purpose is to practice more advanced assembly concepts. It focuses on the pstrings manipulations and information.

pstring is a struct that contains a string and its length,

ps

Which will be stored in the memory as follow:

pStringMem

The program is made of 3 files:

  • The run_main file.s - In charge of receiving two pstrings and a choice.
  • The func_select.s file - In charge of the control flow of the program, executing the user request by the selected choice.
  • The pstring.s file - A pstring library made for the func_select.s to use for the pstrings operations.

The func_select.s file is a switch case, which receives 5 cases:

  • Case 31: Prints the two pstrings length.

31

  • Case 32: Ask the user for two chars - old char and new char, replace them in both pstrings, and print the result.

3233

  • Case 35: Ask the user for two numbers (i and j), copy from the second pstring the [i:j] chars to the first pstring, and print the result.

35

  • Case 36: Replace all upper case letters with lower case letters and lower case letters with upper case letters.

36

  • Case 37: Ask the user for two numbers (i and j) and implement strijcmp on the first and second pstrings. If pstring1[i:j] is larger lexicography than pstring2[i:j], print 1. If they are equal, print 0. Otherwise, print -1.

37

If any other choice of case was made, the program will print "invalid option!"

Installing And Executing

To clone and run this application, you'll need to use Git and the gcc compiler. From your command line:

# Clone this repository.
$ git clone https://github.com/TalMizrahii/Assembly-Pstrings

# Go into the repository.
$ cd Assembly-Pstrings

# Compile the program.
$ gcc run_main.s func_select.s pstring.s

# Run the program (Linux).
$ ./a.out

Author

About

An Assembly Pstrings program and library, as part of the third assignment in Computer Systems course, Bar Ilan University.


Languages

Language:Assembly 100.0%