Free Essay

Assembly Language Program

In:

Submitted By usama93
Words 281
Pages 2
UET Peshawar Abbottabad Campud

13
Micro Processor
Assignment # 02
Submitted by Usama Sheikh (46)
Usman Ali Khan (38)
Atiq-ur-Rehman(14)
Wahab Akbar(20)
Submitted to Engr. Munazza Razzaq

Q1: Write a program the counts no of zeros in a 16bit word.
Program Code:-
.MODEL SMALL
.STACK 64
.DATA
HWRD DW 9E46 ORG 0600 ZERO DB ?
.CODE
MAIN PROC FAR MOV AX,@DATA MOV DX,AX SUB BL,BL MOV DL,16 MOV AX,HWRD
BACK: ROL AX,1 JC NEXT INC BL
NEXT: DEC DL JNZ BACK MOV ZERO,BL MOV AH,4CH INT 21H MAIN ENDP
END MAIN
Q2: write a program that finds the smallest no among list of following no’s, 12,100,01,8,0
Program Code:-
.MODEL SMALL
.STACK 64
.DATA
NUMBERS DB 12,100,01,8,0 ORG 008 SMALLEST DB ?
.CODE
MAIN PROC FAR MOV AX,@DATA MOV DS,AX MOV CX,5 MOV BX,OFFSET NUMBERS MOV AL,[BX]
BACK: CMP AL,[BX] JC NEXT MOV AL,[BX]
NEXT: INC BX LOOP BACK MOV SMALLEST,AL MOV AH,4CH INT 21H MAIN ENDP
END MAIN
Q3: write a program to copy following hex no’s from 0200 memory location to 0400 location in reverse order. 12H,25H,35H,45H
Program Code:-
.MODEL SMALL
.STACK 64
.DATA
ORG 0200H hex_nos DB 12H,25H,35H,45H ORG 0400H COPY-data DB 4 DUP(?)
.CODE
MAIN PROC FAR MOV AX,@DATA MOV DS,AX MOV SI,OFFSET hex_nos INC SI INC SI INC SI MOV DI,OFFSET COPY-data MOV CX,04H
AGAIN: MOV AL,[SI] MOV [DI],AL DEC SI INC DI DEC CX JNZ AGAIN MOV AH,4CH INT 21H MAIN ENDP
END MAIN

Similar Documents

Free Essay

S.Comp

...1.1 Definition Program : Programming Language: 8.1 Introduction to Programming Prepared by : Pn. Marzita Ismail (SC Unit) a series of instructions that directs a computer to perform tasks. A set of words, abbreviations, and symbol that enables a programmer to communicate instructions to a computer Eg: Java, C++, Fortran, Cobol, C 8.1.2 Types of Programming Language: 1) Low Level Programming Language • • Why Low Level? : Because it is designed closer to the hardware Machine Language (1st Generation) Assembly Language (2nd Generation) Made up of instructions written in binary code (0 and 1). • Written in mnemonics, more English-like code; codes shorter than The only language that is directly understood by the machine languages computer. Does not need any translator program. • Need to be translated by assembler into machine language before it can be executed by the computer. Machine dependent (written for particular • Machine dependent (written for particular computer and has computer and has to be changed for using on a Describe/what is/ explain/characteristic • different computer). Example of coding to be changed for using on a different computer). Advantages • • Execution speed is very fast. (It does not require any translation because machine language is directly understood by CPU) Translation free (Computer understands only the machine language) Program written in machine language are very lengthy Machine dependent (program is written for...

Words: 1038 - Pages: 5

Premium Essay

Related Literature

...as a program or set of instruction that tells the computer what to do. TWO CLASSES OF SOFTWARE: 1. SYSTEM SOFTWARE – these programs are used to manipulate the basic operations of a computer system. Examples of these basic operations are: ▪ System software tells the computer to accept the input from the keyboard and output the character to the monitor. ▪ System software locates free disk space in a hard disk when a file needs to be saved. ▪ System software sends the document to the printer when it needs to be printed. ▪ System software locates a program in the hard disk, loads it in the main memory, and executes it. SOME OF THE BENEFITS OF SYSTEM SOFTWARE ARE: ▪ They hide the “ugly” details of computer operations from the user. ▪ Computer programmer can write programs without knowing the details on how the computer hardware works. ▪ System software such as an operating system controls the execution of programs. System software supports all application programs. For example, a user using an application program such as Microsoft Word clicks on the save icon to tell Word to save a document. In this process, Word does not communicate with the printer, but rather request the operating system to print the document. A block diagram of this process is illustrated in the figure. Examples of system software: operating systems, communication control programs, interpreters...

Words: 1565 - Pages: 7

Premium Essay

Essay

...For Exercises 1- 10 , match the activity with the phase of the object-oriented methodology. A. Brainstorming B. Filtering C. Scenarios D. Responsibility algorithms |1. |Reviewing a list of possible classes, looking for duplicates or missing classes. | | |B | |2. |Asking "what if" questions. | | |C | |3. |Assigning responsibilities to classes. | | |C | |4. |Generating first approximation to the list of classes in a problem. | | |A | |5. |Assigning collaborators to a responsibility. | | |C ...

Words: 2569 - Pages: 11

Premium Essay

Asas

...Computer Organization and Architecture CHAPTER 01: Basic Concepts of Architecture and Assembly Language CONTENTS: CHAPTER 1.1: Basic Concepts of Computer Architecture Computer Organization and Architecture CHAPTER 1.2: Basic Hardware Components of a Computer System John Vee MI P. Martinez, CSIT Instructor College of Information and Computing Sciences KING’S COLLEGE OF THE PHILIPPINES CHAPTER 1.3: Assembly Language CHAPTER 1.4: Programmer's View of a Computer System Computer Organization and Architecture CHAPTER 1.1: Basic Concepts of Computer Architecture Instructor: John Vee MI P. Martinez CHAPTER 1.1: Basic Concepts of Computer Architecture ASSIGNMENT #01: LEARNING OUTCOME #01: Next Learning Outcome: After engaging in each topic, students should have: 1) Differentiate Computer Organization and Computer Architecture?  ¼ Yellow Paper, to be submitted next meeting. LO-01: Distinguished the difference between Computer Architecture and Computer Organization, and discussed the different types of architecture. 1) 2) Computer Organization and Architecture Instructor: John Vee MI P. Martinez Computer Architecture vs. Computer Organization Types of Architecture Computer Organization and Architecture Instructor: John Vee MI P. Martinez LO 1.1 – Computer Architecture vs. Computer Organization LO 1.1 – Computer Architecture vs. Computer Organization COMPUTER ARCHITECTURE: COMPUTER ARCHITECTURE: ...

Words: 4567 - Pages: 19

Premium Essay

Problems

...Usually programmers write computer programs to provide solutions for others. First, the programmer must understand the problem he/she is trying to solve. All aspects of the problem description must be clarified and completely understood at this stage. Planning the Logic: Once the programmer understands the problem, it is time to plan the logic of the program. During this time of the process, the programmer uses tools to layout the program’s logical steps from beginning to end. The programmer decides the variables needed in the program. Also, the programmer uses planning tools like, Flowcharts, and Pseudocode to show the steps involved in his/her programming solution. Coding the Program: Coding is converting the design into an actual program, written in some form of programming language. This is the step where you actually have to sit down at the computer and type. Coding is a little bit like writing an essay. In most cases you write your program using something like a word processor. And, like essays, there are certain things that you always need to include in your program, like titles, contents pages etc.. When you've finished translating your design into a program you need to submit it to the computer to see what it makes of it. Using Software to Translate the Program into Machine Language: The lowest-level programming language (except for computers that utilize programmable microcode) Machine languages are the only languages understood by computers. While easily...

Words: 511 - Pages: 3

Premium Essay

Computer T

...Advantages of high-level languages ∗ Why program in assembly language? • Memory ∗ Basic memory operations ∗ Design issues • Architect’s view • Implementer’s view 2003 • • • • Input/Output Interconnection: The glue Historical Perspective Technological Advances Chapter 1: Page 2 © S. Dandamudi To be used with S. Dandamudi, “Fundamentals of Computer Organization and Design,” Springer-Verlag, 2003. Introduction • Some basic terms ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ 2003 Computer architecture Computer organization Computer design Computer programming User’s view Programmer’s view Architect’s view Implementer’s view © S. Dandamudi Chapter 1: Page 3 • Various views of computer systems To be used with S. Dandamudi, “Fundamentals of Computer Organization and Design,” Springer-Verlag, 2003. Introduction (cont’d) Term K (kilo) M (mega) G (giga) T (tera) P (peta) 2003 Decimal 103 106 109 1012 1015 © S. Dandamudi Binary 210 220 230 240 250 Chapter 1: Page 4 To be used with S. Dandamudi, “Fundamentals of Computer Organization and Design,” Springer-Verlag, 2003. A User’s View of Computer Systems 2003 © S. Dandamudi Chapter 1: Page 5 To be used with S. Dandamudi, “Fundamentals of Computer Organization and Design,” Springer-Verlag, 2003. A Programmer’s View • Depends on the type and level of language used • A hierarchy of languages ∗ ∗ ∗ ∗ Machine language Assembly language High-level language Application programs increasing level of abstraction ...

Words: 2516 - Pages: 11

Free Essay

Computer

...Assembly Language Programming Lecture Notes Delivered by Belal Hashmi Compiled by Junaid Haroon Preface Assembly language programming develops a very basic and low level understanding of the computer. In higher level languages there is a distance between the computer and the programmer. This is because higher level languages are designed to be closer and friendlier to the programmer, thereby creating distance with the machine. This distance is covered by translators called compilers and interpreters. The aim of programming in assembly language is to bypass these intermediates and talk directly with the computer. There is a general impression that assembly language programming is a difficult chore and not everyone is capable enough to understand it. The reality is in contrast, as assembly language is a very simple subject. The wrong impression is created because it is very difficult to realize that the real computer can be so simple. Assembly language programming gives a freehand exposure to the computer and lets the programmer talk with it in its language. The only translator that remains between the programmer and the computer is there to symbolize the computer’s numeric world for the ease of remembering. To cover the practical aspects of assembly language programming, IBM PC based on Intel architecture will be used as an example. However this course will not be tied to a particular architecture as it is often done. In our view such an approach...

Words: 85913 - Pages: 344

Premium Essay

Networking

...them what to do like the average teenager to make the computer do something useful you must give the instruction in either of the following two ways. Write a program, Buy a program. * Machine code is the only form of program instructions that the computer hardware can understand and execute directly. All other forms of computer language must be translated into machine code in order to be executed by the hardware. Machine code consists of many strings of binary digits that are easy for the computer to interpret, but tedious for human beings to interpret. Machine code is different for each type of computer. A program in machine code for an Intel x86-based PC will not run on an IBM mainframe computer, and vice versa. * Assembly language is a symbolic representation of machine code, which allows programmers to write programs in machine code without having to deal with the long binary strings. For example, the machine code for an instruction that adds two numbers might be 01101110, but in assembly language, this can be represented by the symbol ADD. A simple assembler program translates this symbolic language directly into machine code. Because machine code is specific to each type of computer hardware, assembly languages are also specific to each type of computer. However, all machine languages and assembly languages look very similar, even though...

Words: 736 - Pages: 3

Premium Essay

Certification a++

...computer follows to perform a task. program  The physical devices that a computer is made of are referred to as __________. hardware  The part of a computer that runs programs is called __________. the CPU  Today, CPUs are small chips known as __________. microprocessors  The computer stores a program while the program is running, as well as the data that the program is working with, in __________. main memory  This is a volatile type of memory that is used only for temporary storage while a program is running. RAM  A type of memory that can hold data for long periods of time, even when there is no power to the computer, is called __________. secondary storage  A component that collects data from people or other devices and sends it to the computer is called __________. an input device  A video display is a(n) __________ device. output device  A __________ is enough memory to store a letter of the alphabet or a small number. byte  A byte is made up of eight __________. bits  In the __________ numbering system, all numeric values are written as sequences of 0s and 1s. binary  A bit that is turned off represents the following value: __________. 0  A set of 128 numeric codes that represent the English letters, various punctuation marks, and other characters is __________. ASCII  An extensive encoding scheme that can represent characters for many languages in the world is __________. unicode ...

Words: 713 - Pages: 3

Premium Essay

Information Technology

...Computer programs have been developed and evolved over the years. They are classified according to the following generations: First Generation (1GL) Low-level The 1GL called machine languages is written using 1s and 0s (binary) Characteristics 1. Fastest to execute because it is already in the language the computer can understand. 2. Difficult to decipher. 3. Easy to make mistakes in the sequence of 1s and Os. 4. Time consuming/Tedious to write Second Generation (2GL) Low-Level 2GL is also called Assembly Language. Assembly Language is written using mnemonic codes, short codes that suggest their meaning and are therefore easier to remember. Characteristics 1. Easier to write than machine language. 2. As with machine language, assembly language is machine. 3. Can be easily converted to machine code by a program called an assembler. 4. Still difficult to understand. Third Generation (3GL) High-Level This generation of languages was designed so that it is even easier for humans to understand. Characteristics 1. It uses English type words and symbols to write program code, making it easier to create. 2. Programs also have to be converted to machine language. 3. Machine independent Fourth Generation (4GLs) High-language Characteristics 1. Designed for the development of commercial business software. 2. Uses English-like statements that are very user friendly, hence programs are easier to write this reduces the...

Words: 308 - Pages: 2

Premium Essay

Java

...day we're continuing our Java security research series by analyzing other plug-ins, browser extensions and rich internet applications that are commonly exploited. Our previous research indicated that the current state of Java affairs isn't pretty. At that time, ninety-three percent of enterprises were vulnerable to known Java exploits. Nearly 50 percent of enterprise traffic used a Java version that was more than two years out of date. Through Websense ThreatSeeker Intelligence Cloud analysis we now discover: Only 19 percent of enterprise Windows-based computers ran the latest version of Java (7u25) between August 1-29, 2013. More than 40 percent of enterprise Java requests are from browsers still using outdated Java 6. As a result, more than 80 percent of Java requests are susceptible to two popular new Java exploits: CVE-2013-2473 and CVE-2013-2463. 83.86 percent of enterprise browsers have Java enabled. Nearly 40 percent of users are not running the most up-to-date versions of Flash. In fact, nearly 25 percent of Flash installations are more than six months old, close to 20 percent are outdated by a year and nearly 11 percent are two years old. Our in-depth analysis ran for one month, across multiple verticals and industries. We surveyed millions of real-world web requests for Java usage through our global Websense ThreatSeeker Intelligence Cloud. New Java Exploits and the Neutrino Exploit Kit New Java exploits CVE-2013-2473...

Words: 1745 - Pages: 7

Free Essay

Reverse Engineering

...About the Tutorial Assembly language is a low-level programming language for a computer or other programmable device specific to a particular computer architecture in contrast to most high-level programming languages, which are generally portable across multiple systems. Assembly language is converted into executable machine code by a utility program referred to as an assembler like NASM, MASM, etc. Audience This tutorial has been designed for those who want to learn the basics of assembly programming from scratch. This tutorial will give you enough understanding on assembly programming from where you can take yourself to higher levels of expertise. Prerequisites Before proceeding with this tutorial, you should have a basic understanding of Computer Programming terminologies. A basic understanding of any of the programming languages will help you in understanding the Assembly programming concepts and move fast on the learning track. Copyright & Disclaimer  Copyright 2014 by Tutorials Point (I) Pvt. Ltd. All the content and graphics published in this e-book are the property of Tutorials Point (I) Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or republish any contents or a part of contents of this e-book in any manner without written consent of the publisher. We strive to update the contents of our website and tutorials as timely and as precisely as possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt...

Words: 16458 - Pages: 66

Premium Essay

Programming Notes

...1. A program is a set of instructions that a computer follows to perform a task 2. The physical devices that the computer is made up of are referred to as the computer’s hardware 3. The CPU is the part of the computer that actually runs the programs 4. CPU’s are small hips known as microprocessors 5. Main memory is where the computer stores a program while the program is running, as well as the data the program is working with. 6. RAM is usually volatile type of memory that is used only for temporary storage while a program is running. 7. Secondary storage is a type of memory that can hold data for long periods of time, even when there is no power to the computer. 8. The component that collects data and sends it to the computer is called an input device 9. Common output devices are video displays and printers 10. One byte is enough memory to store a letter of the alphabet or a small number 11. A byte is made up of 8 bits 12. In the binary numbering system all numeric values are written as sequences of 0s and 1s 13. When all of the bits in a byte are set to 0 (turned off) then the value of the byte is 0 14. ASCII is set of 128 numeric codes that represent the English letters , various punctuation marks, and other characters 15. Unicode is an extensive encoding scheme that is compatible with ASCII, and can also represent the characters of many of the world’s languages 16. Negative numbers are encoded using a technique...

Words: 565 - Pages: 3

Premium Essay

Week 1 Homework

...on the computer. 2. What number does a bit that is turned on represent? What number does a bit that is turned off represent? A. The number a bit that is turned on represents the number 1. The number a bit that is turned off represents the number 0. 3. What would you call a device that works with binary data? A. The device that works with binary data is called Digital device. 4. What are the words that make up a high-level programming language called? A. The word that make up a high-level programming language are called Keywords or reserved words. 5. What are the short words that are used in assembly language called? A. The short words that are used in assembly language is called Mnemonics. 6. What is the difference between a compiler and an interpreter? A. A complier is a program that translates a high-level language program into a separate machine language. An interpreter is a program that both translate and executes the instructions in a high-level language program. 7. What type of software controls the internal operations of the computer’s hardware? A. The Operating systems is the software that controls the internal operations of the computer’s...

Words: 253 - Pages: 2

Premium Essay

Intro to Programming

...ASCII is the American Standard Code for Information Interchange which is a set of 128 numeric codes that represent the English letters, various punctuation marks, and other characters 5. What is machine language? Machine language is written in 1s and 0s and known as binary. 6. How does a computer execute instructions? The computer uses the fetch-decode-execute cycle. 7. What is assembly language? Assembly language uses short words that are known as mnemonics instead of binary. 8. What is syntax? Syntax is a set of rules that must be strictly followed when writing a program. 9. What is an interpreter? An interpreter is a program that both translates and executes the instructions in a high level language program 10. What is a logic error? A logic error is a mistake that does not prevent the program from running, but causes it to produce incorrect results. 11. What is an algorithm? An algorithm is a set of well defined logical steps that must be taken to perform a task. 12. What is Pseudocode? Pseudocode is fake code. 13. What are the symbols used in a flowchart? The Ovals which are called terminal symbols that start and stop something, The parallelograms which are used for Input and Output, The rectangle which are used as processing symbols which represent a step in the program. 14. What is a sequence structure? A sequence structure is a set of statements that execute in the order that they appear. 15. What is a control structure? A control structure is a logical design that...

Words: 771 - Pages: 4