Title: Assembly Language
1Assembly Language High-Level Language
Materials Prepared by Dhimas Ruswanto, BMm
2Lecture Overview
- Assembly Code
- Assembler
- Format of Assembly Code
- Advantages Assembly Code
- Disadvantages Assembly Code
- High-Level Language
- Types of High-Level Languages
- Advantages Disadvantages High-Level Language
3Assembly codeorAssembly language
4What is an Assembly Code?
- Symbolic instruction what humans can understand
- Form of alphanumeric symbols known as mnemonic
codes. - Can have maximum up to 5 letter combination
- E.g.
- ADD for addition
- SUB for subtraction
5Why Assembly Code?
- Maps directly into machine language
- Designed for a family of microprocessors
MOV AX, BXADD AX, 5A INC BX JMP 100
01010011110 11010110110 10011101010 01010101010
Compile
6What is an Assembler?
- A program that converts assembly code into
machine code - Takes basic computer instructions and converts
into a pattern of bits - Most popular assemblers
- 1. MASM (Microsoft assembler program)
- 2. TASM (Borland turbo assembler program)
7What is an Assembler?
8Instruction Format of Assembler
- An assembly program consists of set of statements
- Format
- LABEL COMMENT are optional
- OPCODE OPERAND(s) are mandatory
LABEL OPCODE OPERAND (s) COMMENT
AGAIN ADD R3,R3,R2 It will contain the product
9Instruction Format of Assembler
- OPCODE the thing the instruction is to do
- OPERAND the thing it is supposed to do it to
- LABEL a symbolic name which used to identify
memory locations that are referred to explicitly
in the program - COMMENT message intended only for human
10Working
- Programmer write a program using a sequence of
assemble instructions. - This sequence of assembler instructions, known as
the source code/source program, then specified to
the assembler program when that program is
started. - It translates a source code into machine
language. - The output of the assembler program is called the
object code or object program.
11Assembler Instruction Sample
12Advantages of Assembly Code
- It is easier to understand and use as compared to
machine language. - It is easy to locate and correct errors.
- It is modified easily
13Disadvantages of Assembly Code
- Machine dependent
- Since it is machine dependent therefore
programmer should have knowledge of the hardware
also
14High-level language
15What is High-Level Language?
- High-Level language is basically symbolic
languages that use English words and/or
mathematical symbols rather than mnemonic codes. - Each instruction in the high-level language is
translated into many machine language
instructions.
16Purpose of High-Level Language
- To enable people (programmer) to write program
easily and in their own native language
environment (English). - Examples
- C, C, Java, VB, HTML
17Types of High-Level Languages
- Languages have been developed for general purpose
and specific purpose - Types of High-Level Languages
- Algebraic Formula-Type Processing
- Business Data Processing
- String and List Processing
- Object Oriented Programming Language (OOP)
- Visual Programming Language
18Algebraic Formula-Type Processing
- Oriented towards the computational procedures for
solving mathematical and statistical problem. - Examples
- BASIC (Beginners All Purpose Symbolic
Instruction Code) - FORTRAN (Formula Translation)
- PL/I (Programming Language, Version 1)
- ALGOL (Algorithmic Language)
- APL (A Programming Language)
19Business Data Processing
- Emphasize their capabilities for maintaining data
processing procedures and files handling
problems. - Examples
- COBOL (Common Business Oriented Language)
- RPG (Report Program Generator)
20String and List Processing
- Used for string manipulation including search for
patterns, inserting and deleting characters. - Examples
- LISP (List Processing)
- Prolog (Program in Logic)
21Object Oriented Programming Language
- In OOP, the computer program is divided into
objects. - Examples
- C
- Java
- HTML5
22Visual Programming Language
- Designed for building Windows-based applications.
- Examples
- Visual Basic
- Visual C
23Instruction Format
- Simple English
- printf(My name is Dhimas Ruswanto)
- Algebraic Format
- a2, b3
- sumab
- sum23
- sum5
24Advantages of High-Level Language
- User-friendly
- Similar to English with vocabulary of words and
symbols - Easier to learn
- Less time to write
- Easier to maintain
- Problem oriented rather than machine based
- Can run on any computer for which there exists an
appropriate translator
25Disadvantages of High-Level Language
- Need to be translated into the machine language
by a translator, thus a price in computer time is
paid. - The object code generated by a translator might
be inefficient Compared to an equivalent assembly
language program.
26Summary
- Assembly Code symbolic instruction that humans
can understand - Assembly Code
- LABEL OPCODE OPERANDS COMMENTS
- Assembler A program that converts assembly code
into machine code - High-Level language is basically symbolic
languages that use English words and/or
mathematical symbols rather than mnemonic codes. - Types of High-Level Languages
- Algebraic Formula-Type Processing
- Business Data Processing
- String and List Processing
- Object Oriented Programming Language (OOP)
- Visual Programming Language