Vous êtes sur la page 1sur 28

MODULE - I Fundamentals of Computers [T-(Theory): 215, P-(Practical): 270] Unit-I History of Computers and Fundamentals (T-40) Introduction Definition

on Type and classification Computer characteristics Functions Unit-II Computer Hardware and Software Concepts (T-40) Input devices Output devices CPU, Memory, Secondary Memory Removable Devices Concept of Environmental safety:- Pollution of environment due to e-waste like junk key board, components of computers and other office machineries. Unit-III Introduction of Personal Computer and Operating Systems (LINUX, WINDOWS-XP) (T-80, P-150) Unit-IV Basic concept of Networking / Communication (T-30, P-100) Unit-V Concept of Information and Data Processing (T-15) Unit-VI Concept Handling and Basic Level Troubleshooting (T-20, P-20) MODULE - II Basic Programming Techniques (T: 180, P: 670) Unit-I Flow Charts (T-5) Unit-II Language Concepts - Introduction to C (T-30, P-220) Unit-III Approaching ASP.NET starting with Visual Basic .NET (T-145, P-450) MODULE - III Application / Working with programming packages (T:125, P:360) Unit-I Office Automation Package (T-40, P-100) Unit-II Spread Sheet Package (T-25, P-60) Unit-III X-base packages MySQL (Open Source) Overview of VB.Net, ASP.NET (T-55, P-200) Unit-IV Awareness of IT Act 2000, its Amendments and Phenomena (T-5) 7 MODULE - I (T:215, P:270) Fundamentals of Computers Unit-I History of Computer & Fundamentals (T:40) History of Computer Abacus of ENIAC, Computer Generations, Languages, Software and application, Computers in India. Computers - An Introduction Functions of Computer: input, processing, output, Functions of ALU, control, storage, input and output devices. Application of Computers: viz. Railway Reservation, Electricity / Telephone Billing and

(include some e-governance applications according to respective States.) Networks of Computers- Homogenous, Heterogeneous Characteristics (State Wide Area Network (SWAN) concept) Clock Speed Accuracy Functions Bits, bytes characters, field record, file. Representation of data: Binary addition and subtraction, octal, hexadecimal, ASCII, EBCDIC, positive versus negative integers, floating point numbers. Higher level and Lower language. Unit-II Hardware and software concepts (T:40) Computer Hardware; electronic digital computer. Input device: on line data input devices & their importance, dumb terminals, voice recognition devices, Touch tone terminals, Mouse. Office data input: key to disk system Source data input: point of sale terminals, laser beam scanners, optical sense readers, optical characters readers (OCR), and magnetic ink character readers (MICR). Output device: Hard copy device -Dot matrix printer, ink jet printer, laser printer, plotter output. Soft copy device: VDU (monochrome color), LCD (liquid crystal display), audio response unit; CPU architecture: Overview with data flow Memory device: Classification of Primary Memory Devices and Flash Memories. Secondary memory device; Hard disk (removable/fixed), advantage and limitations of secondary storage devices & DVD Writers or Blu-ray Writers. Removable Drive like Pen drives and external storage devices. Serial, Parallel and USB Ports 8 Unit-III Introduction Computer and Operating Systems: Windows XP or Higher Version and LINUX and its flavours T-80, P-150). INTRODUCTION TO Personal/Desktop Computers, LAPTOP, PALM-TOP & Minimum hardware and software configuration of the above. WINDOWS and LINUX commands Installation of Operating Systems (Windows XP) profiling an operating system Booting sequence: operating system files and command processor file. Definition of a file; File name. Booting from HDD, CD or DVD or external removable devices.

warm and cold reboot Multitasking and Multiprocessing Client Server Architecture Using WINDOWS Start windows Using different windows simultaneously Moving through widows and mouse Maximum/Minimum windows Use of help feature Exit windows Starting an application Run and Manage multiple application Close applications Using the program Manager Create/Add Groups using Program Manager Move/Copy/Delete Program Items. Change Programmed/their properties Expand compressed directories and files Multiple Windows Using Desktop ICONS My Computer Network Neighborhood Control Panel Add Printer Create/Delete/Rename/Folder File Management through Windows Select File snag Directories Copy, Move, Delete, Files/Directories Disk Operations using File Manage Using Essential Accessories Starting and Using Text Editors Type and Edit text in a document in Text Editors 9 Save and Print a document file in Text Editors Starting and using paintbrush Printing a drawing Basic Shell Commands of LINUX Date, echo, who, is, cp, rm, mv, cd, Mkdir, rmdir, chmod, sort, grep, passwd, etc. Unit-IV Basic concepts of Networking / Communication: (T-30, P100) Internet connection setup & sharing. Protocols TCP/IP, ISP, NSP ETC. Concept of sites & pages

Introduction to BIML, DHTML,XML, Designing web-pages, Static & Dynamic. Concepts of Web Hosting, Web server, Application server, Database Server Unit-V : Concept of Information & Data - Processing (T-15) Information concepts and processing: Evolution of Information Processing, data information, language and Communication. Definition of Information: difference between Data and Information. Data concepts: symbols which describe records reality: logical and physical concepts. Logical concepts of data: Entities, Attributes and Relationship. Physical concepts: Storage and Retrieval of data; comparison of manual and computer storage and organization of data as files. Data processing: Storage, retrieval and processing of data as files. Data processing: Storage, retrieval and processing of data, provision of Information of relevance. Techniques/Methods of Data processing. Methods of Data Security like backup, online backup, restoration etc Unit-VI : Computer Handling and Basic Level Troubleshooting (T-10, P-20) Measuring Main Supply, Earth voltage & checking earthing. Precautionary measures in Handling /Operating. - VCD, CD, HDD, FDD, DVD, SCANNER - Modem, Keyboard, Mouse, Hub, Monitor Printers: Dot Matrix, Inkjet, Laser - Feeding paper - Installing the cartridge - Refilling the cartridge. Backup and Restore of DATA - Scheduling - Management Plans etc. 10 MODULE - II (T:180, P:670) Basic Programming Techniques Unit-I: Flow Charts (T-5) Illustrations with summing series, sorting, searching merging Analysis of algorithmsspace and time trade offs.Programme documentation, style in programming, program testing, low chart and Data flow Diagrams. Program testing and debugging efficient programming techniques Structured programming. Unit-II: Language Concepts (T-30, P-220) Introduction to C Overview of C Constants, Variables, and Data type Operators and Expression Managing Formatted / Unformatted Input and Output Decision making and Branching

Decision Making looping Arrays Handling of Character Strings User defined Functions Structures and Unions Pointers File management in concepts Unit-III: Approaching ASP.NET starting with Visual Basic .NET (T: 145, P: 450) Features of Visual Basic , Editions of Visual Basic, Visual Basic Terminology Visual Basic Terminology, Working in the development environment Event-Driven Programming Creating a program in Visual Basic, project and executable files Visual Basic Reference Materials Creating Simple Applications. Visual Basic.NET Fundamentals. Introduction to Objects Controlling objects Properties , Methods and Events Working with Forms Introduction to controls Basic controls Creating a Visual Basic Applications Working with Code and Forms Automatic Code completion features Interfacing with the user 11 Using the Message box Functions Using the Input box functions Working with code statements Managing forms Working with Forms Variables and Procedures Overview of variables Declaring Variables Variable scope Using Arrays User-Defined data types converting data types Using Constants Working with Procedures Working with dates and times Using the Format function Manipulating Text strings

Writing Procedures Controlling Program Execution Comparison and Logical Operators Using If.Then Statements Using selectcase statements Overview of Looping structures Using DoLoop structures ForNext Statement Exiting a Loop Controlling Program Flow While, Do While, Else If loop, SWITCH Case Debugging Types of Errors Break Mode Using the Debug Toolbar Using the Watch Window Using the Immediate Window Using the locals window Tracing Program Flow with the call stack Using visual Basic debugging tools Working with Controls Types of controls Overview of Standard Controls o Using combo box and list Box controls Using option button and Frame Control 12 working with selected text Advanced Standard Controls Activex controls Insertable Objects Working with controls Login, Validation & Navigation Control Data Access using the ADO.NET data Control Overview of Activex Data objects Visual Basic data Access Features Relational Database concepts Using the ADO Data control to access data Structured Query Language (SQL) SQL connection Manipulated Data Using the Data Form Wizard Accessing Databases Back up & Restore Procedure

Input Validation (and Testing of software) Field Level Validation Using Text Box Properties to Restrict Data Entry Using the Masked Edit Control Form-Level Validation Form Events Used When Validating Data Error Trapping Overview of Run-Time Errors Overview of the Error -0 Handling Process The Err Object Errors and the Calling Chain Errors in an Error-Handling Routine Exception Handling Inline Error Handling Error Handling Styles General Error Trapping Options in Visual Basic.NET Error Trapping - Exception Handling Enhancing the User Interface Menus Status Bars Toolbars Adding Menus - Hyperlink Drag-and-Drop Operations 13 Overview of Drag-and-Drop Features Mouse Events Drag-and-Drop Editing Basics Adding Drag and Drop More About Controls Collections Using Control Arrays Finishing Touches User Interface Design Principles Distributing and Application Creating a Default Project Review: Steps to Creating a Visual Basic Program Development Resources Using the Package and Development Wizard - Web Services 14 Module- III (T:125, P:360) Application/Working with Programming Language Unit-I Office Automation package (T-40, P-100) (MS Office or Open Office: Word, Excel etc (Include regional language INDIC keyboard selection topic)

WORD PROCESSING PACKAGE Basics of Word processing Text selection Opening Documents and Creating Documents Saving Documents/Quitting Documents Cursor control Printing Documents Using the interface(Menu, toolbars) Editing Text (Copy, delete, Move etc.) Finding and replacing Text Practicing in Regional Language. Document Enhancement Adding borders and shading, Headers and Footers Setting Up Multiple columns, Sorting blocks, margins and hyphenating documents Creating Master Document, Data source Merging Documents Using mail merge Feature for Labels and envelopes Graphics and using Templates and Wizards Hands-on experience in word processing under DOS Familiarity in Word processing under Windows, Unit-II SPREADSHEET PACKAGE (T-25, P-60) Usage of Ms-Excel Worksheet Basics Data Entry in cells, entry of numbers, text and Formulae Moving data in a Worksheet Moving around in a Worksheet Selecting Data range Using the interface(Toolbars, Minus) Editing basics Working with workbooks Saving and quitting Cell Referencing Formatting and calculations Calculations and Worksheets-Using Auto fill 15 Working with formulae Efficient Data Display with Data formatting number formatting etc./ Working with ranges Worksheets printing Working with Graphs and Charts Adding/Formatting Text data with Auto format Changing chart types Creating separate, chat sheet Adding titles, legends and gridlines

Printing charts. Data base management Finding Records With Data form Adding/Deleting records. Filtering records in a worksheet Unit-III X-base package (T-55, P-200) - using MySQL and MS-Access What is Database Management System (RDBMS) and Relational Database Management System (RDBMS) Introduction to SQL o What is SQL? o Data Definition Language (DDL) and Data Manipulation Language (DML) o Introduction to Atomic Concurrent Integrated Durable (ACID) Properties. Expression o Select commands o Using Numeric, Concatenation operator, Date, Dual Table, null values Where Clause (Select Statement) o Where clause o Comparison operators, Expression Table, Rules for writing numericals, characters, date and variable names o Logical operators, Truth Tables SQL Operators o SQL Operator, BETWEEN, AND IN, LIKE, IS NULL SQL Functions o Number, Character, Date, Conversion o Group Functions, Group by & Having Clause. o Joins and operators o SQL Queries o Reports Unit-IV Awareness of IT Act 2000, its Amendments and Phenomena (T-5) Provisions of act Types of offences, fines, imprisonment Cyber Crime, Cyber Law E-Commerce Basics (Overview of B2B, B2C, C2C), Online transactions 16 HARDWARE EQUIREMENT FOR COMPUTER ORERATOR & PROGRAMMING ASSISTANT 1. Laptop: With i770 Intel Processor, 8 GB RAM, 1 TB HDD, WI-FI with license Operating System and Antivirus - 01 Nos. 2. File server for LAN - 01 No. Xeon Latest 64 bit processor or Higher with PCI Express Video Card 4GB VRAM 8 GB RAM 22" TFT

Keyboard, Mouse, DVD OR BLU-RAY WRITER with latest license of OS - Server Edition Internet, Antivirus - Server Edition & UPS for Power Back up. 3. WORKSTATION/NODES - 10 NODES i700 (i7) PROCESSOR or Higher 8 GB RAM 1 Terabyte HDD 22" TFT Monitor101 DVD OR BLU-RAY WRITER KEYBORD/INTERNET USB Optical Mouse, USB Keyboard with latest license of OS and Antivirus Professional/Ultimate Edition 4. WORKSTATION FOR MULTIMEDIA - 01 Nos. i700 (i7) PROCESSOR or Quadcore or Higher 8 GB RAM 1 Terabyte HDD 22" TFT Monitor101 DVD OR BLU-RAY WRITER KEYBORD/INTERNET USB Optical Mouse, USB Keyboard with latest license of OS with Antivirus Professional/Ultimate Edition 5. 24 PORT SWITCH WITH WIRELESS CONNECTIVITY -As required 6. LAB should have Structured cabling -As required 7. Internet or Intranet Connectivity -As required 8. RJ 45 CONNECTORS -As required 9. CAT-6 CABLE FOR LAN -As required 10. 2 KVA ON- LINE UPS FOR SERVER - 1 no 11. 500 VA or higher off line UPS FOR NODES - 10 Nos 12. COLOUR LASER PRINTER - 1 No 13. Network MONOCHROME LASER PRINTER - 1 No 14. OPTICAL SCANNER (DESK TOP TYPE) - 1 No 15. WEB CAM (DIGITAL CAMERA) - 2 Nos 16. DVD OR BLU-RAY WRITER - 2 Nos 17. PEN-DRIVE - 5 Nos 18. Standalone HARDDISKS - 4 Nos 19. LCD PROJECTOR - 1 No 17 20. Network Rack - 2 Nos 21. LAN Setup -As required 22. Data Recovery Software -As required 23. DSL Wireless Router - 01 No 24. Wireless Router - 01 No 25. Wireless LAN Card - 05 Nos 26. USB Floppy Drive - 2 Nos SOFTWARES Front Page, Silver light , Flash Software

SQL SERVER, VISUAL STUDIO, MICROSOFT OFFICE, OPEN Office, MySQL AND OTHER SOFTWARES, Linux or any Open Source Software. Antivirus - Server Edition for Servers and clients / workstations in profile with validity of an year or more that can be procured on expiry. NOTE- LATEST VERSION OF HARDWARE AND SOFTWARE should be provided LIST OF OTHER ITEMS/ FURNITURE 1. Vacuum cleaner 01 No 2. Pigeon hole cabinet : 20 compartments -01 No 3. Chair and table for the instructor - 01 each (for class room & laboratory) 4. Dual Desk or Chair and Tables for Trainees (For the batch of 16+4=20 Trainees) 5. Computer table sunmica top 150X650X750 mm with sliding tray for key board and one shelf of storage -10 Nos 6. Operators chair (without arms mounted on castor wheels, adjustable height 20 Nos 7. Door mat -02 Nos 8. Wall clock -01 No 9. Printer table 650X500X750mm can be varied as per local specifications03 Nos 10. Window or Split type air conditioners 1.5 tons 03 Nos 11. Storage cabinet 60X700X450mm -01 No

Introduction to 8086 Assembly Language Programming, Joe Carthy, UCD 1

Introduction to 8086 Programming

(The 8086 microprocessor is one of the family of 8086,80286,80386,80486,Pentium,PentiumI,II,I II . also referred to as the X86 family.) Learning any imperative programming language involves mastering a number of common concepts: Variables: declaration/definition Assignment: assigning values to variables Input/Output: Displaying messages Displaying variable values Control flow: if-then Loops Subprograms: Definition and Usage Programming in assembly language involves mastering the same concepts and a few other issues. Variables For the moment we will skip details of variable declaration and simply use the 8086 registers as the variables in our programs. Registers have predefined names and do not need to be declared.

Introduction to 8086 Assembly Language Programming, Joe Carthy, UCD 2

The 8086 has 14 registers. Each of these is a 16-bit register. Initially, we will use four of them the so called the general purpose registers: ax, bx, cx, dx These four 16-bit registers can also be treated as eight 8-bit registers: ah, al, bh, bl, ch, cl, dh, dl

Assignment

In Java, assignment takes the form: x = 42 ; y = 24; z = x + y; In assembly language we carry out the same operation but we use an instruction to denote the assignment operator (= in Java). The above assignments would be carried out in 8086 assembly langauge as follows mov x, 42 mov y, 24 add z, x add z, y The mov instruction carries out assignment.
Introduction to 8086 Assembly Language Programming, Joe Carthy, UCD 3

It which allows us place a number in a register or in a memory location (a variable) i.e. it assigns a value to a register or variable. Example: Store the ASCII code for the letter A in register bx. mov bx, A The mov instruction also allows you to copy the contents of one register into another register. Example: mov bx, 2 mov cx, bx The first instruction loads the value 2 into bx where it is stored as a binary number. [a number such as 2 is called an integer constant] The Mov instruction takes two operands, representing the destination where data is to be placed and the source of that data. General Form of Mov Instruction mov destination, source
Introduction to 8086 Assembly Language Programming, Joe Carthy, UCD 4

where destination must be either a register or memory location

and source may be a constant, another register or a memory location. Note: The comma is essential. It is used to separate the two operands. A missing comma is a common syntax error.

Comments
Anything that follows semi-colon (;) is ignored by the assembler. It is called a comment. Comments are used to make your programs readable. You use them to explain what you are doing in English.

More 8086 Instructions

add, inc, dec and sub instructions The 8086 provides a variety of arithmetic instructions. For the moment, we only consider a few of them. To carry out arithmetic such as addition or subtraction, you use the appropriate instruction. In assembly language you can only carry out a single arithmetic operation at a time. This means that if you wish to

evaluate an expression such as :


Introduction to 8086 Assembly Language Programming, Joe Carthy, UCD 5

z=x+y+wv You will have to use 3 assembly language instructions one for each arithmetic operation. These instructions combine assignment with the arithmetic operation. Example: mov ax, 5 ; load 5 into ax add ax, 3 ; add 3 to the contents of ax, ; ax now contains 8 inc ax ; add 1 to ax ; ax now contains 9 dec ax ; subtract 1 from ax ; ax now contains 8 sub ax, 6 ; subtract 4 from ax ; ax now contains 2 The add instruction adds the source operand to the destination operand, leaving the result in the destination operand. The destination operand is always the first operand in 8086 assembly language.
Introduction to 8086 Assembly Language Programming, Joe Carthy, UCD 6

The inc instruction takes one operand and adds 1 to it. It is

provided because of the frequency of adding 1 to an operand in programming. The dec instruction like inc takes one operand and subtracts 1 from it. This is also a frequent operation in programming. The sub instruction subtracts the source operand from the destination operand leaving the result in the destination operand. Exercises: 1) Write instructions to: Load character ? into register bx Load space character into register cx Load 26 (decimal) into register cx Copy contents of ax to bx and dx 2) What errors are present in the following : mov ax 3d mov 23, ax mov cx, ch move ax, 1h add 2, cx add 3, 6 inc ax, 2 3) Write instructions to evaluate the arithmetic expression 5 + (6-2) leaving the result in ax using (a) 1 register, (b) 2 registers,

(c) 3 registers
Introduction to 8086 Assembly Language Programming, Joe Carthy, UCD 7

4) Write instructions to evaluate the expressions: a = b + c d z = x + y + w v +u 5) Rewrite the expression in 4) above but using the registers ah, al, bh, bl and so on to represent the variables: a, b, c, z, x, y, w, u, and v. Implementing a loop: The jmp instruction Label_X: add ax, 2 add bx, 3 jmp Label_X The jmp instruction causes the program to start executing from the position in the program indicated by the label Label_X. This is an example of an endless loop. We could implement a while loop using a conditional jump instruction such as JL which means jumi-if-lessthan. It is used in combination with a comparision instruction cmp. mov ax, 0 Label_X: add ax, 2 add bx, 3 cmp ax, 10

jl Label_X
Introduction to 8086 Assembly Language Programming, Joe Carthy, UCD 8

The above loop continues while the value of ax is less than 10. The cmp instruction compares ax to 0 and records the result. The jl instruction uses this result to determine whether to jump to the point indicated by Label_X.

Input/Output

Each microprocessor provides instructions for I/O with the devices that are attached to it, e.g. the keyboard and screen. The 8086 provides the instructions in for input and out for output. These instructions are quite complicated to use, so we usually use the operating system to do I/O for us instead. In assembly language we must have a mechanism to call the operating system to carry out I/O. In addition we must be able to tell the operating system what kind of I/O operation we wish to carry out, e.g. to read a character from the keyboard, to display a character or string on the screen or to do disk I/O.

In 8086 assembly language, we do not call operating system subprograms by name, instead, we use a software interrupt mechanism An interrupt signals the processor to suspend its current activity (i.e. running your program) and to pass control to an interrupt service program (i.e. part of the operating system).
Introduction to 8086 Assembly Language Programming, Joe Carthy, UCD 9

A software interrupt is one generated by a program (as opposed to one generated by hardware). The 8086 int instruction generates a software interrupt. It uses a single operand which is a number indicating which MS-DOS subprogram is to be invoked. For I/O and some other operations, the number used is 21h. Thus, the instruction int 21h transfers control to the operating system, to a subprogram that handles I/O operations. This subprogram handles a variety of I/O operations by calling appropriate subprograms.

This means that you must also specify which I/O operation (e.g. read a character, display a character) you wish to carry out. This is done by placing a specific number in a register. The ah register is used to pass this information. For example, the subprogram to display a character is subprogram number 2h. This number must be stored in the ah register. We are now in a position to describe character output. When the I/O operation is finished, the interrupt service program terminates and our program will be resumed at the instruction following int.
Introduction to 8086 Assembly Language Programming, Joe Carthy, UCD 10

3.3.1 Character Output The task here is to display a single character on the screen. There are three elements involved in carrying out this operation using the int instruction: 1. We specify the character to be displayed. This is done by storing the characters ASCII code in a specific 8086 register.

In this case we use the dl register, i.e. we use dl to pass a parameter to the output subprogram. 2. We specify which of MS-DOSs I/O subprograms we wish to use. The subprogram to display a character is subprogram number 2h. This number is stored in the ah register. 3. We request MS-DOS to carry out the I/O operation using the int instruction. This means that we interrupt our program and transfer control to the MS-DOS subprogram that we have specified using the ah register. Example 1: Write a code fragment to display the character a on the screen: mov dl, a ; dl = a mov ah, 2h ; character output subprogram int 21h ; call ms-dos output character As you can see, this simple task is quite complicated in assembly language.
Introduction to 8086 Assembly Language Programming, Joe Carthy, UCD 11

3.3.2 Character Input The task here is to read a single character from the keyboard.

There are also three elements involved in performing character input: 1. As for character output, we specify which of MS-DOSs I/O subprograms we wish to use, i.e. the character input from the keyboard subprogram. This is MS-DOS subprogram number 1h. This number must be stored in the ah register. 2. We call MS-DOS to carry out the I/O operation using the int instruction as for character output. 3. The MS-DOS subprogram uses the al register to store the character it reads from the keyboard. Example 2: Write a code fragment to read a character from the keyboard: mov ah, 1h ; keyboard input subprogram int 21h ; character input ; character is stored in al The following example combines the two previous ones, by reading a character from the keyboard and displaying it.
Introduction to 8086 Assembly Language Programming, Joe Carthy, UCD 12

Example 3: Reading and displaying a character:

mov ah, 1h ; keyboard input subprogram int 21h ; read character into al mov dl, al ; copy character to dl mov ah, 2h ; character output subprogram int 21h ; display character in dl A Complete Program We are now in a position to write a complete 8086 program. You must use an editor to enter the program into a file. The process of using the editor (editing) is a basic form of word processing. This skill has no relevance to programming. We use Microsofts MASM and LINK programs for assembling and linking 8086 assembly language programs. MASM program files should have names with the extension (3 characters after period) asm. We will call our first program prog1.asm, it displays the letter a on the screen. (You may use any name you wish. It is a good idea to choose a meaningful file name). Having entered and saved the program using an editor, you must then use the

MASM and LINK commands to translate it to machine code so that it may be executed as follows: C> masm prog1
Introduction to 8086 Assembly Language Programming, Joe Carthy, UCD 13

If you have syntax errors, you will get error messages at this point. You then have to edit your program, correct them and repeat the above command, otherwise proceed to the link command, pressing Return in response to prompts for file names from masm or link. H:\> link prog1 To execute the program, simply enter the program name and press the Return key: H:\> prog1 a H:\>
Introduction to 8086 Assembly Language Programming, Joe Carthy, UCD 14

Example 4: A complete program to display the letter a on the screen: ; prog1.asm: displays the character a on the screen ; Author: Joe Carthy ; Date: March 1994 .model small

.stack 100h .code start: mov dl, a ; store ascii code of a in dl mov ah, 2h ; ms-dos character output function int 21h ; displays character in dl register mov ax, 4c00h ; return to ms-dos int 21h end start The first three lines of the program are comments to give the name of the file containing the program, explain its purpose, give the name of the author and the date the program was written. The first two are directives, .model and .stack. They are concerned with how your program will be stored in memory and how large a stack it requires. The third directive, .code, indicates where the program instructions (i.e. the program code) begin.
Introduction to 8086 Assembly Language Programming, Joe Carthy, UCD 15

For the moment, suffice it to say that you need to start all assembly languages programs in a particular format (not

necessarily that given above. Your program must also finish in a particular format, the end directive indicates where your program finishes. In the middle comes the code that you write yourself. You must also specify where your program starts, i.e. which is the first instruction to be executed. This is the purpose of the label, start. (Note: We could use any label, e.g. begin in place of start). This same label is also used by the end directive. When a program has finished, we return to the operating system. Like carrying out an I/O operation, this is also accomplished by using the int instruction. This time MS-DOS subprogram number 4c00h is used. It is the subprogram to terminate a program and return to MSDOS. Hence, the instructions: mov ax, 4c00h ; Code for return to MS-DOS int 21H ; Terminates program terminate a program and return you to MSDOS.

Introduction to 8086 Assembly Language Programming, Joe Carthy, UCD 16

Time-saving Tip Since your programs will start and finish using the same format, you can save yourself time entering this code for each program. You create a template program called for example, template.asm, which contains the standard code to start and finish your assembly language programs. Then, when you wish to write a new program, you copy this template program to a new file, say for example, prog2.asm, as follows (e.g. using the MS-DOS copy command): H:\> copy template.asm prog2.asm You then edit prog2.asm and enter your code in the appropriate place.

Vous aimerez peut-être aussi