Skill Area 311 Part B
Lecture 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
ASSEMBLY CODE OR ASSEMBLY LANGUAGE
What 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
Why “Assembly Code”? Maps directly into machine language Designed for a family of microprocessors MOV AX, BX ADD AX, 5A INC BX JMP Compile
What 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)
What is an Assembler?
Instruction Format of Assembler An assembly program consists of set of statements Format: LABEL & COMMENT are optional OPCODE & OPERAND(s) are mandatory LABELOPCODEOPERAND (s);COMMENT AGAINADDR3,R3,R2; It will contain the product
Instruction 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
Working 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.
Assembler Instruction Sample
Advantages 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
Disadvantages of Assembly Code Machine dependent Since it is machine dependent therefore programmer should have knowledge of the hardware also
HIGH-LEVEL LANGUAGE
What 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.
Purpose 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
Types 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
Algebraic 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 )
Business Data Processing Emphasize their capabilities for maintaining data processing procedures and files handling problems. Examples: –COBOL (Common Business Oriented Language) –RPG (Report Program Generator)
String and List Processing Used for string manipulation including search for patterns, inserting and deleting characters. Examples: –LISP (List Processing) –Prolog (Program in Logic)
Object Oriented Programming Language In OOP, the computer program is divided into objects. Examples: –C++ –Java –HTML5
Visual Programming Language Designed for building Windows- based applications. Examples: –Visual Basic –Visual C
Instruction Format Simple English: –printf(“My name is Dhimas Ruswanto”); Algebraic Format: a=2, b=3 sum=a+b sum=2+3 sum=5
Advantages 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
Disadvantages 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.
Summary 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