Assembly Language

Add to Favourites
Post to:

ASSEMBLY LANGUAGEDefinition of TermsProgram - a set of instructions that tells the computer to perform a particular task. Programming – refers to the process of designing and creating computer programs. Programming Language - a software tool that facilitates the translation of human instructions to a form that computers can understand.  Programmer - a person who can design, create, and maintain computer programs. Algorithm - a step by step solution of a problem.Levels of Programming LanguagesHigh-level Languages - these are languages that are easy to learn and understand because of their english-like instructions or commands. Examples of languages that are under this category are COBOL, Visual BASIC, FoxPro, and HTML.2. Middle-level Languages - these are languages that have the basic features of a high-level language and the functionalism of symbolic language like Assembly language. Example of language that is under this category is C++.Symbolic Languages - these are languages that uses mnemonic codes in representing instructions or commands. Example of a language under this category is Assembly language. Machine Language - a language more understandable to machine than to human. It uses a pattern of 0 and 1 to represent instructions.Steps in Program DevelopmentUnderstand the problem.Determine the input, output, and processing requirements of the program.Create a solution that might solve the problem.Solution can be represented in a form of a flowchart, pseudocode, or narrative statement.Translate the solution into a computer program using a programming language that you are very familiar with.Encode the program.5. Test and debug the program.Document your program for future references. Must include:Source CodeData Structures usedSample OutputWhat is Assembly Language?  Assembly Language is the fastest and most efficient programming language in any computer. It allows programmers to unravel and make use of the hardware’s features than any existing languages.Advantages of Using Assembly LanguageThe executable code is smaller than those created in other programming languages.Naturally, if the executable program is small, the program can be loaded in the computer memory faster.Assembly language have a better control of the peripheral than other programming languages.The executable code is more efficient than those created in other programming languages.When To Use Assembly LanguageTo do something that is impossible or awkward with High-level language.To speed-up a slow program.To design a program to be as small as possible.To control peripheral devices in a more efficient mannerFor enjoyment.The Assembly Language ProgrammerMust have good organizational skills.Must have that sort of personality that enjoys attending to details.Must be able to read and understand reference manuals.Needs good arithmetic skills, especially with other numbering systems like hexadecimal numbers.Must be familiar with computer’s basic architecture.Must have patience and persistence.Must be obsessive.Processing Assembly Language ProgramsSoftwares to be used:Editors – refer to programs that can be used to create or edit assembly language programs. Programs like EDIT or NOTEPAD can be used for this purpose. Example: EDIT myprog.asm NOTEPAD myprog.asm Assemblers – refers to programs that translate an assembly language program into its equivalent machine language program. Borland’s Turbo Assembler or Microsoft’s Micro Assembler can be used for this purpose. Example: TASM myprog MASM myprog 3. Linkers – refer to programs that produce executable program from a compiled assembly language program. Borland’s TLINK and Microsoft’s LINK can be used for this purpose. Example: TLINK myprog or LINK myprog Creating a Batch Program for Compiling and RunningAssembly Language ProgramsSteps:1. Run Edit.com or Notepad.exe.2. from editor window, type: c:\tasm\bin\tasm %1c:\tasm\bin\tlink %1%1 3. Save as T.Bat Processing Assembly Language ProgramsProgram StructureStructure of an Assembly Language ProgramWhere:.PROCESSOR is a keyword that tells the compiler to apply instruction set of the specified processor. Typical entries are: .286, .386, .and 486..STACK is a compiler-related command used when preparing the size of the stack in bytes..MODEL is a compiler-related instructions which specifies the size of the application. Typical sizes are: TINY, SMALL, LARGE, and HUGE.DATA is a compiler-related instruction used to indicate the start of the DATA section..CODE is a compiler-related instruction used to indicate the start of the main program.; is a symbol used when specifying program remarks or comments Mov, Int , and End are examples of assembly language instructionsExample:I/O InstructionsPrinting Text Mov AH, 9 Lea DX, Int 21h where: Mov is an instruction that assigns value to a variable or register. Leais an instruction that loads actual address of a variable to a register or another variable. Int is an instruction that calls a particular program. Such program maybe an OS program or program from ROM’s BIOS ( Basic I/O System )Typical entries are:10h and 21h is a variable previously declared from the program’s data section that contains the text to beprinted. AH & DXare register names for accumulator and data register. When printing text AH must be set to 9.Example: Mov AH, 9 Lea DX, txt Int 21h Accepting Character Inputs Mov AH, 1 Int 21h where: Mov is an instruction that assigns value to a variable or register. Int is an instruction that calls a particular program.Such program maybe an OS program or programfrom ROM’s BIOS ( Basic I/O System ) is a variable previously declared from the program’s data section that will receive the inputted character.AH & ALare register names for accumulator. When accepting character inputs AH must be set to 1 or 7. Example: a.Mov AH, 1 Int 21h b.Mov AH, 7 Int 21h Mov answer, ALMiscellaneous InstructionsClearing the screen Mov AH, 6Mov AL, 0 Mov BH, Mov CH, Mov CL, Mov DH, Mov DL, Int 10h where: is an integer value representing the background color and foreground color to be applied for the section of screen to be erased.AH, AL,BH, CH,CL,DH,DLare register names for accumulator., count, data, and base registers. and screen coordinate that specifies the upper left corner of the section to be erased. and screen coordinate that specifies the lower right corner of the section to be erased.Int 10his the interrupt number to call a BIOS video proram that clears the screen. Example: Mov AH, 6 Mov AL, 0 Mov BH, 15 Mov CH, 0 Mov CL, 0 Mov DH, 50 Mov DL, 79 Int 10h Cursor PositioningMov AH, 2Mov BL, Mov DH, Mov DL, Int 10h where: is an integer value representing the page to be used. AH, AL,BL, DH,DLare register names for accumulator. data, and base registers. and screen coordinate that specifies the new position of the cursor.Int 10h is the interrupt number to call a BIOS video proram that clears the screen. Example: Mov AH, 2Mov BH, 0Mov DH, 10 Mov DL, 25 Int 10h Mov AH, 9 Lea DX , txt Int 21h

Description
What is Assembly Language?
Assembly Language is the fastest and most efficient programming language in any computer. It allows programmers to unravel and make use of the hardware’s features than any existing languages.

Program - a set of instructions that tells the computer to perform a particular task.

Programming – refers to the process of designing and creating computer programs.

Programming Language - a software tool that facilitates the translation of human instructions to a form that computers can understand.

Programmer - a person who can design, create, and maintain computer programs.

Algorithm - a step by step solution of a problem.

Comments

Want to learn?

Sign up and browse through relevant courses.

Name:
Your Email:
Password:
Country:
Contact no:


Area code Number
Subjects you are interested in:
Word verification: (Enter the text as in image)


Sign Up Already a member? Sign In
I agree to WizIQ's User Agreement & Privacy Policy
2 Followers

Your Facebook Friends on WizIQ

Explore Similar Courses

Give live classes, create & sell online courses

Try it free Plans & Pricing

Connect