SlideShare ist ein Scribd-Unternehmen logo
1 von 35
Downloaden Sie, um offline zu lesen
ASSEMBLY LANGUAGE BSCS/BSSE
Computing Machines
• General purpose: servers, desktops, laptops, PDAs,
etc.
• Special purpose: cash registers, ATMs, games, Mobile
Phones, etc.
• Embedded: cars, door locks, printers, digital players,
industrial machinery, medical equipment, etc.
Distinguishing Characteristics
• Speed
• Cost
• Ease of use, software support & interface
• Scalability
Inside the Computer
• Application software
• Written in high-level language
• System software
• Compiler: translates HLL code to machine code
• Operating System: service code
• Handling input/output
• Managing memory and storage
• Scheduling tasks & sharing resources
• Hardware
• Processor, memory, I/O controllers
A Programmer’s View of a Computer
Application Programs
High-Level Languages
Assembly Language
Machine Language
Micro program Control
Hardware
High-Level Languages
Low-Level Language
Machine-independent
Machine-Specific
Levels of Program Code
• High-level language
• Level of abstraction closer to
problem domain
• Provides productivity and
portability
• Assembly language
• Textual representation of
instructions
• Hardware representation
• Binary digits (bits)
• Encoded instructions and data
Detailed Anatomy of a Computer
Memory
Program
Storage
Data Storage
Output
Units
Input Units
Control Unit
Datapath
Arithmetic
Logic Unit
(ALU)
Registers
Common Bus (address, data & control)
Processor (CPU)
Anatomy of a Computer: CPU
Control Unit
Datapath
Arithmetic
Logic Unit
(ALU)
Registers
Processor (CPU)
•Decodes and monitors the execution of instructions.
•Controls flow of information in CPU, memory, I/O
devices:
•System clock (Intel® Core™ I7-720QM Processor
(1.6GHz, turbo up to 2.8GHz, 6MB L3 Cache))
•Maintains a register called program counter(PC)
•ALU: performs all arithmetic computations & logic
evaluations.
•Registers: storage location in CPU, used to hold data or
a memory address during the execution of an
instruction..
The brain of a Computer System
Anatomy of a Computer: Common Bus
A group of conducting wires that allow signals to travel from one
point to another:
• Address bus: the location of data in memory or I/O devices
• Data bus: carry data in & out from CPU
• Control bus: control the operation of the CPU
Common Bus (address, data & control)
A Hierarchy of Languages
Application Programs
High-Level Languages
Assembly Language
Machine Language
Microprogram Control
Hardware
High-Level Languages
Low-Level Language
Machine-independent
Machine-Specific
Assembly and Machine Language
• Machine language
• Native to a processor: executed directly by hardware
• Instructions consist of binary code: 1s and 0s
• Assembly language
• A programming language that uses symbolic names to represent
operations, registers and memory locations.
• Slightly higher-level language
• Readability of instructions is better than machine language
• One-to-one correspondence with machine language instructions
• Assemblers translate assembly to machine code
• Compilers translate high-level programs to machine code
• Either directly, or
• Indirectly via an assembler
Compiler and Assembler
Instructions and Machine Language
• Each command of a program is called an instruction (it
instructs the computer what to do).
• Computers only deal with binary data; hence the
instructions must be in binary format (0s and 1s) .
• The set of all instructions (in binary form) makes up the
computer's machine language. This is also referred to as
the instruction set.
Instruction Fields
• Machine language instructions usually are made up of
several fields. Each field specifies different information for
the computer. The major two fields are:
• Opcode field which stands for operation code and it
specifies the particular operation that is to be performed.
• Each operation has its unique opcode.
• Operands fields which specify where to get the source and
destination operands for the operation specified by the
opcode.
• The source/destination of operands can be a constant,
the memory or one of the general-purpose registers.
Translating Languages
English: D is assigned the sum of A times B plus 10.
High-Level Language: D = A * B + 10
Intel Assembly Language:
mov eax, A
mul B
add eax, 10
mov D, eax
Intel Machine Language:
A1 00404000
F7 25 00404004
83 C0 0A
A3 00404008
A statement in a high-level language is translated
typically into several machine-level instructions
Mapping Between Assembly Language and HLL
• Translating HLL programs to machine language
programs is not a one-to-one mapping
• A HLL instruction (usually called a statement) will be
translated to one or more machine language instructions
Advantages of High-Level Languages
• Program development is faster
• High-level statements: fewer instructions to code
• Program maintenance is easier
• For the same above reasons
• Programs are portable
• Contain few machine-dependent details
• Can be used with little or no modifications on different
machines
• Compiler translates to the target machine language
• However, Assembly language programs are not portable
What is Assembly Language?
Developed by David John Wheeler
(to interact with machine language easier to perform
task).
•1. Computer Programming Language
•2. Low level Programming Language
•It uses Mnemonics/keywords
•Closer to Hardware
•Time waste in compilation can reduced
Why should we learn
Assembly Language?
1. Better/deep
understanding of
software and
hardware interaction??
2. Optimization of
processing time
3. Embedded
Programming
1. High level language program(C,C++, etc.,), Compiler(language translator) is used to convert
high level code into Assembly.
2. Assembly code is then converted into object file by Assembler.
3. Then object file convert into machine code. Object file is linked by linker with library file.
Every system has different system properties(how is it made, attributes, etc.). This library file
present in system and object file link together change into machine code which run the hardware.
•Code in C, filename.c (.c extension language format)
•Compile in Assembly language, extension changes to filename.asm
•Assembler convert it into object file, extension changes into
filename.obj
•Linker link it with library file extension changes into .exe, hardware
run it.
Why Learn Assembly Language?
• Accessibility to system hardware
• Assembly Language is useful for implementing system software
• Also useful for small embedded system applications
• Space and Time efficiency
• Understanding sources of program inefficiency
• Tuning program performance
• Writing compact code
• Writing assembly programs gives the computer designer
the needed deep understanding of the instruction set and
how to design one
• To be able to write compilers for HLLs, we need to be
expert with the machine language. Assembly
programming provides this experience
Assembly vs. High-Level Languages
• HLL programs are machine independent. They are easy to learn and
easy to use.
• Assembly language programs are machine specific. It is the
language that the processor directly understands.
Tools for Assembly Language: Assembler
• Software tools are needed for editing, assembling, linking, and
debugging assembly language programs
• An assembler is a program that converts source-code programs
written in assembly language into object files in machine language
• Popular assemblers have emerged over the years for the Intel family
of processors. These include …
• TASM (Turbo Assembler from Borland)
• NASM (Netwide Assembler for both Windows and Linux), and
• GNU assembler distributed by the free software foundation
• MASM (Macro Assembler from Microsoft)
Tools for Assembly Language: Linker & Libraries
• You need a linker program to produce executable files
• It combines your program's object file created by the
assembler with other object files and link libraries, and
produces a single executable program
Assemble and Link Process
• A project may consist of multiple source files
• Assembler translates each source file separately into an object file
• Linker links all object files together with link libraries
Source
File
Source
File
Source
File
Assembler
Object
File
Assembler
Object
File
Assembler
Object
File
Linker
Executable
File
Link
Libraries
REASON
Reason was to combine machine parts to perform specific task (like switches and other
components which assemble to perform task), name Assembly
FETCH-EXECUTE-CYCLE
CPU executes the instruction with fetch-execute-cycle as;
Fetch
1. Fetch an instruction from memory.
2. Decode the instruction to determine the operation.
3. ·Fetch data from memory if necessary.
Execute
1. Perform the operation on the data.
2. Store the result in memory if needed.
REGISTERS
❑Records or collection of information
❑Storage area inside CPU, CPU take info, process and store it.
❑Fastest area present inside CPU
❑ Helps in Optimization of Processing time (HD file internally run on
register and CPU process it)
❑Understanding of Hardware and Software interaction
Processor operations mostly involve processing data. This data can be stored in
memory and accessed from thereon. However, reading data from and storing data
into memory slows down the processor, as it involves complicated processes of sending
the data request across the control bus and into the memory storage unit and getting
the data through the same channel.
To speed up the processor operations, the processor includes some internal memory
storage locations, called registers.
The registers store data elements for processing without having to access the memory.
A limited number of registers are built into the processor chip.
Registers are a type of computer memory used to quickly accept, store, and transfer
data and instructions that are being used immediately by the CPU. The registers used
by the CPU are often termed as Processor registers.
A processor register may hold an instruction, a storage address, or any data (such as
bit sequence or individual characters).
CPU
HD – Main storage- we run files present in HD.
HD file Run – RAM – Cache – Register
Register built in inside CPU, CPU quickly access information from register, program
work processing time optimize.
Direct access register , time is saved , info save directly into Register because CPU
extract info from here (CPU need space where it keep data to hold or remove).
CPU extract info from register through Assembly language programming.
•Registers are the fastest memory locations built into
microprocessor. Fast means CPU quickly access it close to
CPU.
•Chip by Intel 4004 in 1971, launched registered are used
first time, by Federico Faggin
•Following are the 14 types of registers

Weitere ähnliche Inhalte

Ähnlich wie a1.pptx.pdf

Week 08_Basics of Compiler Construction.pdf
Week 08_Basics of Compiler Construction.pdfWeek 08_Basics of Compiler Construction.pdf
Week 08_Basics of Compiler Construction.pdfAnonymousQ3EMYoWNS
 
Computer languages
Computer languagesComputer languages
Computer languagesAqdasNoor
 
microprocesser-140306112352-phpapp01.pdf
microprocesser-140306112352-phpapp01.pdfmicroprocesser-140306112352-phpapp01.pdf
microprocesser-140306112352-phpapp01.pdfPriyankaRana171346
 
Assembly and Machine Code
Assembly and Machine CodeAssembly and Machine Code
Assembly and Machine CodeProject Student
 
4 computer languages
4 computer languages4 computer languages
4 computer languagesBaliThorat1
 
Types of Programming Languages
Types of Programming LanguagesTypes of Programming Languages
Types of Programming LanguagesJuhi Bhoyar
 
Python-unit -I.pptx
Python-unit -I.pptxPython-unit -I.pptx
Python-unit -I.pptxcrAmth
 
Lec 01 basic concepts
Lec 01 basic conceptsLec 01 basic concepts
Lec 01 basic conceptsAbdul Khan
 
Embedded firmware
Embedded firmwareEmbedded firmware
Embedded firmwareJoel P
 
Computer-charecteristics,types of languages,translators
Computer-charecteristics,types of languages,translatorsComputer-charecteristics,types of languages,translators
Computer-charecteristics,types of languages,translatorsVarshaSivashanker
 
D turner power_pointpres
D turner power_pointpresD turner power_pointpres
D turner power_pointpresdavid114811
 
Embedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterEmbedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterHossam Hassan
 
Evolution of programming languages-migara presentation.pptx
Evolution of programming languages-migara presentation.pptxEvolution of programming languages-migara presentation.pptx
Evolution of programming languages-migara presentation.pptxDinithiGunarathna
 
Python-L1.pptx
Python-L1.pptxPython-L1.pptx
Python-L1.pptxDukeCalvin
 
Introduction to Computer Softwares
Introduction to Computer SoftwaresIntroduction to Computer Softwares
Introduction to Computer SoftwaresNaresh Dubey
 

Ähnlich wie a1.pptx.pdf (20)

Week 08_Basics of Compiler Construction.pdf
Week 08_Basics of Compiler Construction.pdfWeek 08_Basics of Compiler Construction.pdf
Week 08_Basics of Compiler Construction.pdf
 
Computer languages
Computer languagesComputer languages
Computer languages
 
microprocesser-140306112352-phpapp01.pdf
microprocesser-140306112352-phpapp01.pdfmicroprocesser-140306112352-phpapp01.pdf
microprocesser-140306112352-phpapp01.pdf
 
Assembly Language
Assembly LanguageAssembly Language
Assembly Language
 
Computer languages
Computer languagesComputer languages
Computer languages
 
Assembly and Machine Code
Assembly and Machine CodeAssembly and Machine Code
Assembly and Machine Code
 
4 computer languages
4 computer languages4 computer languages
4 computer languages
 
Types of Programming Languages
Types of Programming LanguagesTypes of Programming Languages
Types of Programming Languages
 
Language processors
Language processorsLanguage processors
Language processors
 
Python-unit -I.pptx
Python-unit -I.pptxPython-unit -I.pptx
Python-unit -I.pptx
 
Lec 01 basic concepts
Lec 01 basic conceptsLec 01 basic concepts
Lec 01 basic concepts
 
Embedded firmware
Embedded firmwareEmbedded firmware
Embedded firmware
 
Computer-charecteristics,types of languages,translators
Computer-charecteristics,types of languages,translatorsComputer-charecteristics,types of languages,translators
Computer-charecteristics,types of languages,translators
 
D turner power_pointpres
D turner power_pointpresD turner power_pointpres
D turner power_pointpres
 
Embedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterEmbedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals master
 
Evolution of programming languages-migara presentation.pptx
Evolution of programming languages-migara presentation.pptxEvolution of programming languages-migara presentation.pptx
Evolution of programming languages-migara presentation.pptx
 
Python-L1.pptx
Python-L1.pptxPython-L1.pptx
Python-L1.pptx
 
Computer languages
Computer languagesComputer languages
Computer languages
 
chapt_01.pdf
chapt_01.pdfchapt_01.pdf
chapt_01.pdf
 
Introduction to Computer Softwares
Introduction to Computer SoftwaresIntroduction to Computer Softwares
Introduction to Computer Softwares
 

Kürzlich hochgeladen

Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogueitservices996
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingShane Coughlan
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingShane Coughlan
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
1C_PNS.pdf Philippines National standard
1C_PNS.pdf Philippines National standard1C_PNS.pdf Philippines National standard
1C_PNS.pdf Philippines National standardraffietividad53
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencessuser9e7c64
 

Kürzlich hochgeladen (20)

Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
1C_PNS.pdf Philippines National standard
1C_PNS.pdf Philippines National standard1C_PNS.pdf Philippines National standard
1C_PNS.pdf Philippines National standard
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conference
 

a1.pptx.pdf

  • 2. Computing Machines • General purpose: servers, desktops, laptops, PDAs, etc. • Special purpose: cash registers, ATMs, games, Mobile Phones, etc. • Embedded: cars, door locks, printers, digital players, industrial machinery, medical equipment, etc. Distinguishing Characteristics • Speed • Cost • Ease of use, software support & interface • Scalability
  • 3. Inside the Computer • Application software • Written in high-level language • System software • Compiler: translates HLL code to machine code • Operating System: service code • Handling input/output • Managing memory and storage • Scheduling tasks & sharing resources • Hardware • Processor, memory, I/O controllers
  • 4. A Programmer’s View of a Computer Application Programs High-Level Languages Assembly Language Machine Language Micro program Control Hardware High-Level Languages Low-Level Language Machine-independent Machine-Specific
  • 5. Levels of Program Code • High-level language • Level of abstraction closer to problem domain • Provides productivity and portability • Assembly language • Textual representation of instructions • Hardware representation • Binary digits (bits) • Encoded instructions and data
  • 6. Detailed Anatomy of a Computer Memory Program Storage Data Storage Output Units Input Units Control Unit Datapath Arithmetic Logic Unit (ALU) Registers Common Bus (address, data & control) Processor (CPU)
  • 7. Anatomy of a Computer: CPU Control Unit Datapath Arithmetic Logic Unit (ALU) Registers Processor (CPU) •Decodes and monitors the execution of instructions. •Controls flow of information in CPU, memory, I/O devices: •System clock (Intel® Core™ I7-720QM Processor (1.6GHz, turbo up to 2.8GHz, 6MB L3 Cache)) •Maintains a register called program counter(PC) •ALU: performs all arithmetic computations & logic evaluations. •Registers: storage location in CPU, used to hold data or a memory address during the execution of an instruction.. The brain of a Computer System
  • 8. Anatomy of a Computer: Common Bus A group of conducting wires that allow signals to travel from one point to another: • Address bus: the location of data in memory or I/O devices • Data bus: carry data in & out from CPU • Control bus: control the operation of the CPU Common Bus (address, data & control)
  • 9. A Hierarchy of Languages Application Programs High-Level Languages Assembly Language Machine Language Microprogram Control Hardware High-Level Languages Low-Level Language Machine-independent Machine-Specific
  • 10. Assembly and Machine Language • Machine language • Native to a processor: executed directly by hardware • Instructions consist of binary code: 1s and 0s • Assembly language • A programming language that uses symbolic names to represent operations, registers and memory locations. • Slightly higher-level language • Readability of instructions is better than machine language • One-to-one correspondence with machine language instructions • Assemblers translate assembly to machine code • Compilers translate high-level programs to machine code • Either directly, or • Indirectly via an assembler
  • 12. Instructions and Machine Language • Each command of a program is called an instruction (it instructs the computer what to do). • Computers only deal with binary data; hence the instructions must be in binary format (0s and 1s) . • The set of all instructions (in binary form) makes up the computer's machine language. This is also referred to as the instruction set.
  • 13. Instruction Fields • Machine language instructions usually are made up of several fields. Each field specifies different information for the computer. The major two fields are: • Opcode field which stands for operation code and it specifies the particular operation that is to be performed. • Each operation has its unique opcode. • Operands fields which specify where to get the source and destination operands for the operation specified by the opcode. • The source/destination of operands can be a constant, the memory or one of the general-purpose registers.
  • 14. Translating Languages English: D is assigned the sum of A times B plus 10. High-Level Language: D = A * B + 10 Intel Assembly Language: mov eax, A mul B add eax, 10 mov D, eax Intel Machine Language: A1 00404000 F7 25 00404004 83 C0 0A A3 00404008 A statement in a high-level language is translated typically into several machine-level instructions
  • 15. Mapping Between Assembly Language and HLL • Translating HLL programs to machine language programs is not a one-to-one mapping • A HLL instruction (usually called a statement) will be translated to one or more machine language instructions
  • 16. Advantages of High-Level Languages • Program development is faster • High-level statements: fewer instructions to code • Program maintenance is easier • For the same above reasons • Programs are portable • Contain few machine-dependent details • Can be used with little or no modifications on different machines • Compiler translates to the target machine language • However, Assembly language programs are not portable
  • 17. What is Assembly Language? Developed by David John Wheeler (to interact with machine language easier to perform task). •1. Computer Programming Language •2. Low level Programming Language •It uses Mnemonics/keywords •Closer to Hardware •Time waste in compilation can reduced
  • 18. Why should we learn Assembly Language? 1. Better/deep understanding of software and hardware interaction?? 2. Optimization of processing time 3. Embedded Programming
  • 19.
  • 20. 1. High level language program(C,C++, etc.,), Compiler(language translator) is used to convert high level code into Assembly. 2. Assembly code is then converted into object file by Assembler. 3. Then object file convert into machine code. Object file is linked by linker with library file. Every system has different system properties(how is it made, attributes, etc.). This library file present in system and object file link together change into machine code which run the hardware.
  • 21. •Code in C, filename.c (.c extension language format) •Compile in Assembly language, extension changes to filename.asm •Assembler convert it into object file, extension changes into filename.obj •Linker link it with library file extension changes into .exe, hardware run it.
  • 22. Why Learn Assembly Language? • Accessibility to system hardware • Assembly Language is useful for implementing system software • Also useful for small embedded system applications • Space and Time efficiency • Understanding sources of program inefficiency • Tuning program performance • Writing compact code • Writing assembly programs gives the computer designer the needed deep understanding of the instruction set and how to design one • To be able to write compilers for HLLs, we need to be expert with the machine language. Assembly programming provides this experience
  • 23. Assembly vs. High-Level Languages • HLL programs are machine independent. They are easy to learn and easy to use. • Assembly language programs are machine specific. It is the language that the processor directly understands.
  • 24. Tools for Assembly Language: Assembler • Software tools are needed for editing, assembling, linking, and debugging assembly language programs • An assembler is a program that converts source-code programs written in assembly language into object files in machine language • Popular assemblers have emerged over the years for the Intel family of processors. These include … • TASM (Turbo Assembler from Borland) • NASM (Netwide Assembler for both Windows and Linux), and • GNU assembler distributed by the free software foundation • MASM (Macro Assembler from Microsoft)
  • 25. Tools for Assembly Language: Linker & Libraries • You need a linker program to produce executable files • It combines your program's object file created by the assembler with other object files and link libraries, and produces a single executable program
  • 26. Assemble and Link Process • A project may consist of multiple source files • Assembler translates each source file separately into an object file • Linker links all object files together with link libraries Source File Source File Source File Assembler Object File Assembler Object File Assembler Object File Linker Executable File Link Libraries
  • 27. REASON Reason was to combine machine parts to perform specific task (like switches and other components which assemble to perform task), name Assembly
  • 28.
  • 29.
  • 30. FETCH-EXECUTE-CYCLE CPU executes the instruction with fetch-execute-cycle as; Fetch 1. Fetch an instruction from memory. 2. Decode the instruction to determine the operation. 3. ·Fetch data from memory if necessary. Execute 1. Perform the operation on the data. 2. Store the result in memory if needed.
  • 31. REGISTERS ❑Records or collection of information ❑Storage area inside CPU, CPU take info, process and store it. ❑Fastest area present inside CPU ❑ Helps in Optimization of Processing time (HD file internally run on register and CPU process it) ❑Understanding of Hardware and Software interaction
  • 32. Processor operations mostly involve processing data. This data can be stored in memory and accessed from thereon. However, reading data from and storing data into memory slows down the processor, as it involves complicated processes of sending the data request across the control bus and into the memory storage unit and getting the data through the same channel. To speed up the processor operations, the processor includes some internal memory storage locations, called registers. The registers store data elements for processing without having to access the memory. A limited number of registers are built into the processor chip. Registers are a type of computer memory used to quickly accept, store, and transfer data and instructions that are being used immediately by the CPU. The registers used by the CPU are often termed as Processor registers. A processor register may hold an instruction, a storage address, or any data (such as bit sequence or individual characters).
  • 33. CPU
  • 34. HD – Main storage- we run files present in HD. HD file Run – RAM – Cache – Register Register built in inside CPU, CPU quickly access information from register, program work processing time optimize. Direct access register , time is saved , info save directly into Register because CPU extract info from here (CPU need space where it keep data to hold or remove). CPU extract info from register through Assembly language programming.
  • 35. •Registers are the fastest memory locations built into microprocessor. Fast means CPU quickly access it close to CPU. •Chip by Intel 4004 in 1971, launched registered are used first time, by Federico Faggin •Following are the 14 types of registers