Wednesday, September 7, 2016

Introduction to Assembly Language

Overview

The low level computer programming language is the assembly language and it has direct access to the system’s hardware such as registers, flags, memory locations etc. That is why, you should have some knowledge about the computer hardware/architecture.

In this tutorial, we will be focusing on the assembly programming of x86 microprocessors compatible with the ‘Intel’ instruction architecture (IA-32) that runs on MS-Windows. We will also provide sample codes and execution results for an assembler in tutorial topics i.e. Microsoft Macro Assembler (MASM).

Background You Should Have

You should have knowledge about:

  • Any high level language (C, C++, or Java)
  • Digital logic design
  • And number representations (Binary numbers, decimal numbers, hexadecimal and their conversions).

Stuff You Need Have

You should have an editor to write Assembly Langue code. I personally will recommend ‘Microsoft Visual Studio’ (latest version). The step by step instructions are given here: How to download and configure MS Visual Studio for Assembly Language.

Execution Steps of Assembly Language

The steps that are followed by the system/assembler to create an executable file of the code is as follow:

assembly language execution

Step 1

Text-editor is used by the programmer who produces the source file as an ASCII text file.

Step 2

Source file is then used by the assembler that produces machine language translation of a program known as object file. Other than this it produces the listing file, if any error occurs it goes back to the step1.

Step 3

The linker checks the program in the object file, that whether there is a library call or not. If present, linker provides procedure from the library and combines it to object file. This results in making the execution file.

Step 4

Finally the programs begin to execute when the loader reads the executable file into the memory and pointing the CPU to programs starting address.

Programs You Will Create

You will be able to write programs in two general classes:

  • Real Address Mode (16-bit)
  • Protected Mode (32-bit)

Real Address Mode (16-bit)

Real mode programs run in Console window of the OS (Operating System).

Protected Mode (32-bit)

Protected mode programs run in windows and hence they are easy to write and understand.

You Will Learn

In this tutorial, you will learn:

  • About computer architecture
  • About Boolean logic and its implementation
  •  Management of memory in real and protected mode programs
  • Translation of high level languages like C, C++, Java, etc. to assembly languages and then to machine language.
  • Representation of different types of data like: integer, signed integer, real numbers, etc.
  • Machine level debugging of programs
  • Interaction of the application programs with the operating system, such as interrupt handlers, etc.
  • Creating assembly language programs.

No comments :

Post a Comment

Note: Only a member of this blog may post a comment.

Copyright 2017. All Rights Reserved. Privacy Policy / Terms And Conditions / Sitemap / Contact