33
Topics • assembly language. • Characteristics • Different Programming Languages. • Assemblers. • Most commonly Used Assemblers. • MASM and its installation. • Syntax and simple program in MASM 06/26/2022 1

Assembly final 2

Embed Size (px)

DESCRIPTION

A thorough study of MASM Assembler.

Citation preview

Page 1: Assembly final 2

04/12/2023 1

Topics

• assembly language.• Characteristics• Different Programming Languages.• Assemblers.• Most commonly Used Assemblers.• MASM and its installation.• Syntax and simple program in MASM

Page 2: Assembly final 2

04/12/2023 2

ASSEMBLERAssembler tutorial and its installation

Page 3: Assembly final 2

04/12/2023 3

What is Assembly language?• It is a low-level symbolic code converted by an

assembler

Characteristics of assembly language• Assembly language is a symbolic representation of

a processor's native code.• Using machine code allows the programmer to

control precisely what the processor wants to do.

Page 4: Assembly final 2

04/12/2023 4

• The resulting program is normally very fast and very compact.

• Assembly language is used to write the program using alphanumeric symbols (or mnemonic), e.g. ADD, MOV, PUSH etc.

• Mnemonics: Mnemonics are predefined assembly-language names for machine instructions, pseudo-ops, directives, and data allocation statements. Mnemonics are not case-sensitive.

Continue….

Page 5: Assembly final 2

04/12/2023 5

Different programming languages?

• 1> Basic: It is the widely used , easy to learn general purpose language.

• 2> Cobol: A standardized language used for commercial application.

• 3> Fortran: Developed for solving mathematical and scientific problems.

Page 6: Assembly final 2

04/12/2023 6

• 4> C: It is used for all purposes like,,,scientific application, commercial application,developing games etc

• 5> C++: It’s a general purpose computer programming language which is used to make different programs and application

Continue…

Page 7: Assembly final 2

04/12/2023 7

Assemblerwhat is assembler ?• A program for converting instructions

written in low-level symbolic code into machine code.

Flow of program development

Program.asm Object file.obj Executable file .exe

Page 8: Assembly final 2

04/12/2023 8

• MASM (Macro Assembler)• The Microsoft Macro Assembler (MASM) is

an 32BIT assembler that uses the Intel syntax for MS-DOS and Microsoft Windows.

• Beginning with MASM 8.0 there are two versions of the assembler -

• One for 16-bit and 32-bit assembly sources, • And another (ML64) for 64-bit sources only

Most commonly used assembler

Page 9: Assembly final 2

04/12/2023 9

• How to run MASM 8086 Software on your System

Explain • First Download Three files to proceed with the

further steps• Program - DOSBox 0.74 Installer • Program - 8086 Assembler• Program - Notepad ++

MASM Installation

Page 10: Assembly final 2

04/12/2023 10

• Now after the downloading part• next open the second file (8086 Assembler) • which is a compressed file so you have to extract the files in it to the C Drive

on your system. (Windows Driver)

Continue….

Page 11: Assembly final 2

04/12/2023 11

• For that just select the 8086 folder > right click and click Extract file .

Continue….

Page 12: Assembly final 2

04/12/2023 12

• Then select C Drive >

• Finally Click on Ok!

Continue….

Page 13: Assembly final 2

04/12/2023 13

• Extracting start

• Now GOTO the c drive (windows drive) and you can see the folder name (MASM)

Continue….

Page 14: Assembly final 2

04/12/2023 14

• Click on the folder name MASM and open the folder to conform all the files are extracted

• Now next we are going to install DOSBOX

Continue….

Page 15: Assembly final 2

04/12/2023 15

• Now here we have a file

• Click(double click) on the file DOSBOX

Continue….

Page 16: Assembly final 2

04/12/2023 16

• Click yes for administrator permission.• Click on heck box and click next

Continue….

Page 17: Assembly final 2

04/12/2023 17

• Select the drive where you want to install by click on browse select the drive and click install

Continue….

Page 18: Assembly final 2

04/12/2023 18

• (c: by default)• Installation start• Click on close Button and installation is done and

and read work

Continue….

Page 19: Assembly final 2

04/12/2023 19

• Now its done!

• Now we going to install NOTEPAD++

Continue….

Page 20: Assembly final 2

04/12/2023 20

• Click(double click) on the notepad++ file • Click yes if you got the administrator message

• click oK

Continue….

Page 21: Assembly final 2

04/12/2023 21

• Click next

• Click I agree

Continue….

Page 22: Assembly final 2

04/12/2023 22

• Again next

• Select the first and 3rd option and click install

Continue….

Page 23: Assembly final 2

04/12/2023 23

• Click finished and its done

Continue….

Page 24: Assembly final 2

04/12/2023 24

• What is the syntax ?• The structure of statements in a computer language

Basic assembly syntax• Each MASM standard source line contains a

combination of the 4 fields:

Syntax And Simple Program In MASM

Page 25: Assembly final 2

04/12/2023 25

• Notes:1. backslash (\) uses as the line continuation

character: if a line ends with backslash, the next line is considered to be a part of the backslash-ended line

2. No restrictions on white space within a line3. A colon after a label is optional

Continue….

Page 26: Assembly final 2

04/12/2023 26

• Examples:• 1. mov ax, 2 ; moves constant 2 to the register ax

Running Simple hello world program in assembly• 1.First open notepad ++• 2. Write the code on notepad++ and save the

program in .asm extension

Continue….

Page 27: Assembly final 2

04/12/2023 27

• 3. Now copy the .asm source file in to the folder of MASM which in c: drive

• 4. Then open the DOSBOX and write the command ( mount c c:\masm8086\ ) then press enter then we

see drive is mounted

Continue….

Page 28: Assembly final 2

04/12/2023 28

5. now type the next command c: press enter it will change the drive to c:\> from drive

z:\>

Continue….

Page 29: Assembly final 2

04/12/2023 29

6. Then type dir to see the contents in directory

7 .now type masm program.asm• press enter • after that obj will be created

Continue….

Page 30: Assembly final 2

04/12/2023 30

• Like this

8. now type link (program) AND press enter

Continue….

Page 31: Assembly final 2

04/12/2023 31

• After that program.exe will be created in the folder of MSAM

10. now run the last command is program.exeand your program will be executed

Continue….

Page 32: Assembly final 2

04/12/2023 32

Questions Please…

Page 33: Assembly final 2

04/12/2023 33

Thank you !