Monday, 8 August 2011


1. how to use MASM in windows

We did not have to install any executable file. We used cmd (command prompt) which works fine with us. First we needed the zipped 8086_Assembler file and unzipped it in the same folder as the other necessary files like .masm,.link , .exe and so on. We made sure that all these files where in one directory .The we opened cmd and compiled our code and linked it to the file that has a .link.exe extension.
 For editing we used notepad++ and saved it.
2)
a) An assembler is program that takes basic computer instructions and converts them into a pattern of bits that the computer's processor can use to perform its basic operations. Some people call these instructions assembler language and others use the term assembly language.
Assembler is used for basic machine operations that a computer can perform.
i) Real number constants (1 line def and 1 example):
There are two real number constants: decimal reals example 26.E5 and encoded (hexidecimal) reals. A decimal real constant contaions a sign followed by an integer, decimal point, an integer that expresses a fraction and an exponent. Encoded example is 3F80000r

ii) Character constant
a character is a character enclosed in a single  or double quote.
Example : ‘A’ , ‘d’

iii)String constants
A string is a constant string of characters enclosed either in single or double quotes
Example ‘BJUK7’, “Cars”
iv) Reserved words
Reserved words are words that have certain meaning or instruction in MASM language and only used in correct context. Directing MASM how to assemble programs. Examples MOV,ADD or MUL

v) Identifiers
It is a programmer-chosen name it might identify a variable, constant, a procedure or code label. Contains 1 to 247 characters, case sensitive. Example : open_file.

vi) Directives
Directives are a command that is recognized and acted upon by the assembler the programmer’s source code is being assembled. Example The .DATA directive identifies the area of a program that contains variables: .data

vii) Instructions
Instruction is a statement that is being executed by the processor at runtime after the program has been loaded to the memory and started examples operands, label.

viii)Mnemonic
Instruction mnemonic is a short word that identifies the operation carried out by an instruction.
These instructions have useful names. Example mov (move),add(add two values)

ix) Operands
Assembly language can have between o and 3 operands each can be register, memory operand, constant expression, or I/O port.
Example 96 is a constant (immediate value)

x) Comment
Is a way of telling how the program works, it’s a way of communicating the purpose of the program so other person who reads your code can understand it easy.
Example &This line is a comment &

xi) Label
A label is an identifier that acts as a place marker for either instructions or data. The assembler assigns a numeric address to each program statement. Examples  move ax, [0020]
Line Callout 3: Directived)


Line Callout 3: String constant


.model small
.STACK 100h
DATA SEGMENT
                MSG DB 10,"Hello World $"
DATA ENDS
CODE SEGMENT
                ASSUME CS:CODE , DS: DATA
Line Callout 3: Reserved word    START :
                MOV AX, DATA
Line Callout 3: Label                MOV DS, AX
                MOV AH, 09H
Line Callout 3: Instruction mnemonic                MOV DX, OFFSET MSG
                INT 21H
                MOV AH, 4CH
                MOV AL, 00H
                INT 21H
CODE ENDS
                END START

Operating Systems

When you turn on your computer, it's nice to think that you're in control. There's the trusty computer mouse, which you can move anywhere on the screen, summoning up your music library or Internet browser at the slightest whim. Although it's easy to feel like a director in front of your desktop or laptop, there's a lot going on inside, and the real man behind the curtain handling the necessary tasks is the operating system. Most desktop or laptop PCs come pre-loaded with Microsoft Windows. Macintosh computers come pre-loaded with Mac OS X. Many corporate servers use the Linux or UNIX operating systems. The operating system (OS) is the first thing loaded onto the computer -- without the operating system, a computer is useless.
­­­More recently, operating systems have started to pop up in smaller computers as well. If you like to tinker with electronic devices, you're probably pleased that operating systems can now be found on many of the devices we use every day, from cell phones to wireless access points. The computers used in these little devices have gotten so powerful that they can now actually run an operating system and applications. The computer in a typical modern cell phone is now more powerful than a desktop computer from 20 years ago, so this progression makes sense and is a natural development.
The purpose of an operating system is to organize and control hardware and software so that the device it lives in behaves in a flexible but predictable way. In this article, we'll tell you what a piece of software must do to be called an operating system, show you how the operating system in your desktop computer works and give you some examples of how to take control of the other operating systems around you.
At the simplest level, an operating system does two things:
  1. It manages the hardware and software resources of the system. In a desktop computer, these resources include such things as the processor, memory, disk space and more (On a cell phone, they include the keypad, the screen, the address book, the phone dialer, the battery and the network connection).
  2. It provides a stable, consistent way for applications to deal with the hardware without having to know all the details of the hardware.
The first task, managing the hardware and software resources, is very important, as various programs and input methods compete for the attention of the central processing unit (CPU) and demand memory, storage and input/output (I/O) bandwidth for their own purposes. In this capacity, the operating system plays the role of the good parent, making sure that each application gets the necessary resources while playing nicely with all the other applications, as well as husbanding the limited capacity of the system to the greatest good of all the users and applications.

­ The second task, providing a consistent application interface, is especially important if there is to be more than one of a particular type of computer using the operating system, or if the hardware making up the computer is ever open to change. A consistent application program interface (API) allows a software developer to write an application on one computer and have a high level of confidence that it will run on another computer of the same type, even if the amount of memory or the quantity of storage is different on the two machines.
Even if a particular computer is unique, an operating system can ensure that applications continue to run when hardware upgrades and updates occur. This is because the operating system -- not the application -- is charged with managing the hardware and the distribution of its resources. One of the challenges facing developers is keeping their operating systems flexible enough to run hardware from the thousands of vendors manufacturing computer equipment. Today's systems can accommodate thousands of different printers, disk drives and special peripherals in any possible combination.
Types of Operating Systems
Within the broad family of operating systems, there are generally four types, categorized based on the types of computers they control and the sort of applications they support. The categories are:
  • Real-time operating system (RTOS) - Real-time operating systems are used to control machinery, scientific instruments and industrial systems. An RTOS typically has very little user-interface capability, and no end-user utilities, since the system will be a "sealed box" when delivered for use. A very important part of an RTOS is managing the resources of the computer so that a particular operation executes in precisely the same amount of time, every time it occurs. In a complex machine, having a part move more quickly just because system resources are available may be just as catastrophic as having it not move at all because the system is busy.
  • Single-user, single task - As the name implies, this operating system is designed to manage the computer so that one user can effectively do one thing at a time. The Palm OS for Palm handheld computers is a good example of a modern single-user, single-task operating system.
  • Single-user, multi-tasking - This is the type of operating system most people use on their desktop and laptop computers today. Microsoft's Windows and Apple's MacOS platforms are both examples of operating systems that will let a single user have several programs in operation at the same time. For example, it's entirely possible for a Windows user to be writing a note in a word processor while downloading a file from the Internet while printing the text of an e-mail message.
  • Multi-user - A multi-user operating system allows many different users to take advantage of the computer's resources simultaneously. The operating system must make sure that the requirements of the various users are balanced, and that each of the programs they are using has sufficient and separate resources so that a problem with one user doesn't affect the entire community of users. Unix, VMS and mainframe operating systems, such as MVS, are examples of multi-user operating systems.
The reason we chose this topic is because as a computer science students we wanted to fully understand how computer works/functions

No comments:

Post a Comment