Wednesday , December 19 2018

Assembly #05 – Input/Ouput and Arithmetic operations

Share on WhatsApp
Share via email Share

In this tutorial we will learn:

  1. How to take input?
  2. How to print results as output in different formats?
  3. Making a small application of Arithmetic operations.

Taking inputs:

Every application must take some inputs otherwise its useless. Taking Inputs form users in Assembly language is quite easy. Simply call the read— procedure from the Kip Irvine’s library.

For reading integer inputs:

This will read an integer as input and store it in eax register temporarily. You can later manipulate this value i.e move it in some other register using the mov instruction or store it in memory variable.

Showing outputs:

For output, type writeint writedec or any other write— procedure from the Kip Irvine’s library.

Small arithmetic operation application:

For making a small application that performs 4 basic arithmetic operations, we used this code:

Watch this video for explanation of above code and everything:

Share on WhatsApp
Share via email Share

About Waleed Baig

Waleed Baig
I am doing BS Computer Science. I have a passion to learn new technology and spread it. I am more enthusiastic about learning complex algorithm and making creative and efficient solution to a problem.

Check Also

general purpose register

Assembly #2 – What are Registers?

In this tutorial we will learn What are registers? Size of registers and their subdivisions Related

Leave a Reply

Your email address will not be published.