1 Number Form User
1 Number Form User
Experiments No:01
Name of Student……………………………………………….. Roll No.:…… Batch:…….
4 4 4 4 4 20
Problem Statement: Write an X86/64 ALP to accept five 64 bit Hexadecimal numbers from user
and store them in an array and display the accepted numbers.
Objective:
● To understand assembly language programming instruction set
To understand different assembler directives with example
● To apply instruction set for implementing X86/64 bit assembly language programs
Hardware Requirement: NA
Software Requirement: OS:Ubuntu Assembler: NASM version 2.10.07 Linker: ld
Theory Contents :
Introduction to Assembly Language Programming:
Each personal computer has a microprocessor that manages the computer's arithmetical, logical
and control activities. Each family of processors has its own set of instructions for handling
various operations like getting input from the keyboard, displaying information on screen and
performing various other jobs. These set of instructions are called 'machine language instruction'.
Processor understands only machine language instructions which are strings of 1s and 0s.
However machine language is too obscure and complex for using in software development. So the
low level assembly language is designed for a specific family of processors that represents various
instructions in symbolic code and a more understandable form. Assembly language is a low-level
programming language for a computer, or other programmable device specific to particular
computer architecture in contrast to most high-level programming languages, which are generally
portable across multiple systems. Assembly language is converted into executable machine code
by a utility program referred to as an assembler like NASM, MASM etc.
The order in which these sections fall in your program really isn’t important, but by convention
the.data section comes first, followed by the .bss section, and then the .text section.
The actual machine instructions that make up your program go into the .text section. Ordinarily,
no data items are defined in .text. The .text section contains symbols called labels that identify
locations in the program code for jumps and calls, but beyond your instruction mnemonics, that’s
about it.
All global labels must be declared in the .text section, or the labels cannot be ‘‘seen’’ outside your
program by the Linux linker or the Linux loader. Let’s look at the labels issue a little more closely.
Labels
A label is a sort of bookmark, describing a place in the program code and giving it a name that’s
easier to remember than a naked memory address. Labels are used to indicate the places where
jump instructions should jump to, and they give names to callable assembly language procedures.
Here are the most important things to know about labels:
Labels must begin with a letter, or else with an underscore, period, or question mark. These
last
three have special meanings to the assembler, so don’t use them until you know how NASM
interprets them.
Labels must be followed by a colon when they are defined. This is basically what tells NASM
that the identifier being defined is a label. NASM will punt if no colon is there and will not flag
an error, but the colon nails it, and prevents a mistyped instruction mnemonic from being
mistaken for a label. Use the colon!
Labels are case sensitive. So yikes:, Yikes:, and YIKES: are three completely different labels.
ALGORITHM:
INPUT: ARRAY
OUTPUT: ARRAY
STEP 1: Start.
FLOWCHART:
Assignment Questions:
Conclusion:
2 2
Explain the difference between 32bit and 64bit
processors?
3 1 Explain steps of running an ALP program?
Sign of Student