Assembly Introduction
Assembly Introduction
CHAPTER 1
OVERVIEW OF COMPUTER SYSTEMS
• A user’s view of a computer system depends on the
degree of abstraction provided by the underlying software.
• At the level 4, problem solving is done in one of the high-level languages such as C
and Java
• System hardware, which consists of digital logic circuits and the associated
support electronics execute the machine language instructions.
EXPLANATION
• CISC processors were helpful in simplifying the code and making it shorter in
order to reduce the memory requirement.
CISC PROCESSOR
• Advantages:
• The code size is comparatively shorter which minimizes the memory requirement.
• Execution of a single instruction accomplishes several low-level tasks.
• Complex addressing mode makes the memory access flexible.
• CISC instruction can directly access memory locations.
CISC PROCESSOR
• Disadvantages:
• Though the code size is minimized but it requires several clock cycles to
execute a single instruction. Thereby reduce the overall performance of
the computer.
• Implementing pipelining for CISC instruction is a bit complicated.
• The hardware structure needs to be more complex to simplify software
implementation.
• Designed to minimize the memory requirement when memory was smaller
and costlier. But today the scenario has changed nowadays memory is
inexpensive and mostly all computers have a large amount of memory.
CISC VS RISC
CISC RISC
Emphasis on hardware Emphasis on software Single-clock,
Includes multi-clock complex instructions reduced instruction only
Small code sizes, high cycles per second Low cycles per second, large code sizes
Transistors used for storing complex instructions Spends more transistors on memory registers
The machine language instructions of CISC RISC processors use fixed-length machine
processors vary in length language instructions
• Transistor – a semi conductor device , a building block of modern electronics
RISC PROCESSOR
• Assembler is the program that translates assembly language code into the
machine language.
WHAT IS ASSEMBLY LANGUAGE?
• The first instruction increments the variable result. This assembly language
instruction is equivalent to result++;
• mov class_size, 45
• The third instruction performs the bitwise and operation on mask1 and can be
expressed in C as
mask1 = mask1 & 128;
• add marks, 10 ---The last instruction updates marks by adding 10. This is equivalent to
• The operands in these instructions are in processor registers. The processor registers t1, t2,
and t3 are identified by $.
• The andi instruction performs bitwise and of t1 contents with 15 and writes the result in t2.
• The second instruction adds contents of t1 and t2 and stores the result in t3.
ADVANTAGES OF HIGH-LEVEL LANGUAGES
• It takes a lot of time and effort to write the code for the same.
• The syntax is difficult to remember
• It has a lack of portability between different computers
WHY PROGRAM IN THE ASSEMBLY LANGUAGE?
• However, there are two main reasons why programming is still done in the
assembly language: (1) efficiency, and (2) accessibility to system hardware
• Space efficiency refers to the memory requirements of a program, i.e., the size
of the executable code
• Time efficiency refers to the time taken to execute a program. Obviously a
program that runs faster is said to be better from the time-efficiency point of
view
• Assembly language programs have direct control over system hardware. For
example, writing a device driver to a new scanner on the market almost
certainly requires programming in the assembly language
TYPICAL APPLICATIONS
• Time efficiency: Applications for which the execution speed is important fall
under two categories:
• 1. Time convenience (to improve performance)
• 2. Time-critical (to satisfy functionality)
1. Applications in the first category benefit from time-efficient programs
because it is convenient or desirable. For example, a graphics package that
scales an object instantaneously is more pleasant
TYPICAL APPLICATIONS
• Text book
• https://en.wikipedia.org/wiki/Complex_instruction_set_computer
• https://en.wikipedia.org/wiki/Reduced_instruction_set_computer
• https://cs.stanford.edu/people/eroberts/courses/soco/projects/risc/risccisc/