Giter Site home page Giter Site logo

talmizrahii / assembly-pstrings Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 26 KB

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

Assembly 100.00%
assembly computer-architecture computer-systems pstring function-library

assembly-pstrings's Introduction


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

assembly-pstrings's People

Contributors

talmizrahii avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.