SlideShare a Scribd company logo
1 of 35
3.1.1DefineInstructionset,machineandassemblylanguage
 INSTRUCTION SET :
 The complete collection of instructions that are understood
by a CPU
• Known also as Machine Code/Machine Instruction
• Binary representation
• Usually represented by assembly codes
Machinelanguage:
 a binary program (or binary code).
 a sequence of instruction and operand in
binary that list the exact representation
instruction as they appear in computer
memory.
 Natural language of a particular computer
system.
 Strings of numbers or binary codes (0 or 1).
Machinelanguage:
 Machine-dependent (differ from one µP to
other µP.
 Program written in any other language must
be translated to binary representation of
instruction before they can be executed by
computer.
 Programmers need to know specifically the
architecture of CPU.
 Assembly language is a symbolic representation of
a machine language of specific processor.
Assembly language is a form that is very
dependent on the underlying architecture.
 Using english -like abbreviations (MUL), ( ADD),
(SUB)
 Assembler as translator.
 Assembler - Translate ordinary mnemonics such as
MOVE Data, Acc, into their corresponding machine
language (the only form of instruction that
computer can executed)
Easy to make compilers, debuggers and other
device tools.
Allow accessing information that is not
accessible (restricted) from high level
languages.
More function library that can be used in
programming development.
Possibility to make library function that
compatible with different compiler and
 (Development) Requires longer development time
 (Reliability & Security) Easy to makes error
 (Debug) More possibility for errors
 (Maintain) Difficult to modify because it allows
unstructured code.
 (Portability) Difficult to porting to different platforms.
platforms.
 Using everyday English and common
mathematical notation. (x = I + j)
 Overcome problems : assembly language
require many instruction to accomplish a
simple task.
 Single instruction in HLL = several AL
instructions.
 Compiler as translator.
H
HH
HH HH
HH HH HH HH
9/19/2019
32 24|23 16 | 15 8|7 4|3 0
DATA SIZE BIT
(n)
RANGE
(0-2n)
Byte 8 bit 0 - 255
Word 16 bit 0 - 65535
Long word 32 bit 0 - 4294967295
9/19/2019
DATA SIZE BIT
(n)
NEGATIVE
RANGE
(-2n-1)
POSITIVE RANGE
(0 to 2n-1-1)
byte 8 bit -2 8-1 28-1 -1
Word 16 bit -2 16-1 216-1 -1
Long word 32 bit -2 32-1 232-1 -1
9/19/2019
Data transfer Group
 Arithmetic Group
Logical Group
 These instructions transfer or move data between
its internal registers, between an internal register
and a storage location in memory, or between two
locations in memory.
 - memory to register
 - register to memory
 - register to register
 - memory to memory
MNEMONIC MOVE
CHARACTERISTICS REGISTER REGISTER
OPERATION MOVE.W D0, D1
BEFORE D0 D1
AFTER D0 D1
78 56 34 12
78 56 56 7812 34 56 78
9/19/2019
12 34 56 78
01000 42 51
01002 55 13
9/19/2019
MNEMONIC MOVE
CHARACTERISTICS MEMORY REGISTER
OPERATION MOVE.W $1000, D1
BEFORE D1
AFTER D1
FE ED 42 51
EFBEEDFE
135501002
514201000
MNEMONIC MOVE
CHARACTERISTICS REGSITER MEMORY
OPERATION MOVE.W D1, $1000
BEFORE D1
AFTER D1
9/19/2019
EFBEEDFE
135501000
EFBE01000
EFBEEDFE
135501002
514201000
9/19/2019
MNEMONIC MOVE
CHARACTERISTICS MEMORY MEMORY
OPERATION MOVE.W $1000, $1002
BEFORE D1
AFTER D1 EFBEEDFE
514201002
514201000
EFBEEDFE
135501002
514201000
9/19/2019
MNEMONIC MOVEQ (move quick)
CHARACTERISTICS • The value is moved as integer 8 bit (range-128 to +127)
• Data size = 8 bit (1 byte)
• 8 bit is extended to fulfill 32bit data register
OPERATION MOVEQ #$F1,D1
BEFORE D1
AFTER D1
FF FF FF F1
12 34 56 78
9/19/2019
ARAHAN ARITMETIK
MNEMONIC ADD
CHARACTERISTICS •To add the value at destination= destination +source
•Data size = B.W.L
OPERATION ADD.W D1, D3
BEFORE D1 D3
AFTER D1 D3
9/19/2019
FD CC 01 23
FD CC 57 9B12 34 56 78
12 34 56 78
9/19/2019
MNEMONIC ADDQ (add quick)
CHARACTERISTICS • Data size for source operand = 1…..8
• Data size for destination operand = any value
• Data size = B.W.L
OPERATION ADDQ.W #3,D6
BEFORE D6
AFTER D6
12 34 57 02
12 34 56 FF
9/19/2019
MNEMONIC SUB
CHARACTERISTICS •Data size for source operand = 1…..8
• Data size for destination operand = any value
• Data size = B.W.L
OPERATION SUB.W D1,D0
BEFORE D0 D1
AFTER D0 D1
00 00 00 0200 00 30 40
00 00 00 0200 00 30 3E
9/19/2019
MNEMONIC SUBQ (Sub quick)
CHARACTERISTICS • Data size for source operand = 1…..8
• Data size for destination operand = any value
• Data size = B.W.L
OPERATION SUBQ.B #7,D6
BEFORE D6
AFTER D6
12 34 56 78
12 34 56 71
9/19/2019
MNEMONIC MULU
CHARACTERISTICS •Unsigned Multiplication
• Source operand = 16 bit, any addressing mode
• Destination operand = 16 bit, data register
• Multiplication outcome= 32 bit, saved in destination operand
OPERATION MULU.W #2,D3
BEFORE D3
AFTER D3
FD CC 01 00
00 00 02 00
MNEMONIC MULS
CHARACTERISTICS • Signed Multiplication
• Source operand = 16 bit, any addressing mode
• Destination operand = 16 bit, data register
• Multiplication outcome= 32 bit, saved in destination operand
OPERATION MULS.W #3,D3
BEFORE D3
AFTER D3
9/19/2019
FD CC FF 00
FF FF FD 00
MNEMONIC DIVU
CHARACTERISTICS • Unsigned Division
• Data size for source operand= 16 bit divider, and addressing
modes.
• Data size for destination operand = the value is divided with 342
bit, data register
•Division outcome= low of destination register. Balance =high of
destination register
OPERATION DIVU.W D0,D3
BEFORE D0 D3
AFTER D0 D3
9/19/2019
00 00 03 0800 00 00 12
00 02 00 2B00 00 00 12
Baki Hasil Bahagi
MNEMONIC DIVS
CHARACTERISTICS • Signed division
• source operand= 16 bit data
• destination operand = 32 bit data
• Division outcome= low of destination operand. Balance = high of
destination operand (16 bit)
OPERATION DIVS.W D0,D3
BEFORE D0 D3
AFTER D0 D3
9/19/2019
FF FF FE 0000 00 00 12
FF F8 FF E4
00 00 00 12
Baki Hasil Bahagi
9/19/2019
ARAHAN LOGIK
9/19/2019
MNEMONIC AND.B #$3E, D3
CHARACTERISTICS
[D3(B) AND $3E  D3 (B) ]
(8 bit data in D3 ‘AND’ with 8 bit data and the output in
D3)
OPERATION
BEFORE D3
AFTER D3
9/19/2019
74 0 1 1 1 0 1 0 0
AND 3E 0 0 1 1 1 1 1 0
34 0 0 1 1 0 1 0 0
12345674
12343634
MNEMONIC OR.B D0, D1
CHARACTERISTICS [D1 (B) or D0 (B)  D1(B) ]
(8 bit data in D1 ‘OR’ with 8 bit data in D0, and the output in D1)
OPERATION
BEFORE D0 D1
AFTER D0 D1
9/19/2019
3E 0 0 1 1 1 1 1 0
OR 74 0 1 1 1 0 1 0 0
7E 0 1 1 1 1 1 1 0
1234563E98765474
1234367E98765474
MNEMONIC NOT.B D1
CHARACTERISTICS
[D1(B) NOT  D1 ]
(The content of D1 is NOT, and the
output in D1)
OPERATION AA  1010 1010
55  0101 0101
BEFORE
AFTER
9/19/2019
12345655
123436AA
D1

More Related Content

What's hot

Computer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organizationComputer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organizationAmrutaMehata
 
COMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational Circuits
COMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational CircuitsCOMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational Circuits
COMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational CircuitsVanitha Chandru
 
Code generator
Code generatorCode generator
Code generatorTech_MX
 
flag register of 8086
flag register of 8086flag register of 8086
flag register of 8086asrithak
 
Computer architecture addressing modes and formats
Computer architecture addressing modes and formatsComputer architecture addressing modes and formats
Computer architecture addressing modes and formatsMazin Alwaaly
 
Using Timers in PIC18F Microcontrollers
Using Timers in PIC18F MicrocontrollersUsing Timers in PIC18F Microcontrollers
Using Timers in PIC18F MicrocontrollersCorrado Santoro
 
Instruction Set Architecture
Instruction Set ArchitectureInstruction Set Architecture
Instruction Set ArchitectureDilum Bandara
 
Logical micro-operations
Logical micro-operationsLogical micro-operations
Logical micro-operationsVATSAL TRIVEDI
 
PAI Unit 3 Paging in 80386 Microporcessor
PAI Unit 3 Paging in 80386 MicroporcessorPAI Unit 3 Paging in 80386 Microporcessor
PAI Unit 3 Paging in 80386 MicroporcessorKanchanPatil34
 
CS304PC:Computer Organization and Architecture Session 11 general register or...
CS304PC:Computer Organization and Architecture Session 11 general register or...CS304PC:Computer Organization and Architecture Session 11 general register or...
CS304PC:Computer Organization and Architecture Session 11 general register or...Asst.prof M.Gokilavani
 
Computer organization memory hierarchy
Computer organization memory hierarchyComputer organization memory hierarchy
Computer organization memory hierarchyAJAL A J
 
Branching instructions in 8086 microprocessor
Branching instructions in 8086 microprocessorBranching instructions in 8086 microprocessor
Branching instructions in 8086 microprocessorRabin BK
 

What's hot (20)

Computer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organizationComputer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organization
 
COMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational Circuits
COMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational CircuitsCOMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational Circuits
COMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational Circuits
 
Microprocessor
MicroprocessorMicroprocessor
Microprocessor
 
Conditional branches
Conditional branchesConditional branches
Conditional branches
 
Boolean algebra & logic gates
Boolean algebra & logic gatesBoolean algebra & logic gates
Boolean algebra & logic gates
 
Code generator
Code generatorCode generator
Code generator
 
flag register of 8086
flag register of 8086flag register of 8086
flag register of 8086
 
Computer architecture addressing modes and formats
Computer architecture addressing modes and formatsComputer architecture addressing modes and formats
Computer architecture addressing modes and formats
 
Using Timers in PIC18F Microcontrollers
Using Timers in PIC18F MicrocontrollersUsing Timers in PIC18F Microcontrollers
Using Timers in PIC18F Microcontrollers
 
Instruction Set Architecture
Instruction Set ArchitectureInstruction Set Architecture
Instruction Set Architecture
 
mano.ppt
mano.pptmano.ppt
mano.ppt
 
Logical micro-operations
Logical micro-operationsLogical micro-operations
Logical micro-operations
 
16 control unit
16 control unit16 control unit
16 control unit
 
Lecture 3 instruction set
Lecture 3  instruction setLecture 3  instruction set
Lecture 3 instruction set
 
Math coprocessor 8087
Math coprocessor 8087Math coprocessor 8087
Math coprocessor 8087
 
PAI Unit 3 Paging in 80386 Microporcessor
PAI Unit 3 Paging in 80386 MicroporcessorPAI Unit 3 Paging in 80386 Microporcessor
PAI Unit 3 Paging in 80386 Microporcessor
 
CS304PC:Computer Organization and Architecture Session 11 general register or...
CS304PC:Computer Organization and Architecture Session 11 general register or...CS304PC:Computer Organization and Architecture Session 11 general register or...
CS304PC:Computer Organization and Architecture Session 11 general register or...
 
Computer organization memory hierarchy
Computer organization memory hierarchyComputer organization memory hierarchy
Computer organization memory hierarchy
 
Branching instructions in 8086 microprocessor
Branching instructions in 8086 microprocessorBranching instructions in 8086 microprocessor
Branching instructions in 8086 microprocessor
 
Basic Computer Organization and Design
Basic  Computer  Organization  and  DesignBasic  Computer  Organization  and  Design
Basic Computer Organization and Design
 

Similar to Instruction Set and Assembly Language Programming

siudhai ki marks sheih shuuu kvms jiiiiv
siudhai ki marks sheih shuuu kvms jiiiivsiudhai ki marks sheih shuuu kvms jiiiiv
siudhai ki marks sheih shuuu kvms jiiiivwonderboystarpope
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAAiman Hud
 
Computer architecture 3
Computer architecture 3Computer architecture 3
Computer architecture 3Dr.Umadevi V
 
Chapter 1SyllabusCatalog Description Computer structu
Chapter 1SyllabusCatalog Description Computer structuChapter 1SyllabusCatalog Description Computer structu
Chapter 1SyllabusCatalog Description Computer structuEstelaJeffery653
 
Assembly Language In Electronics
Assembly Language In ElectronicsAssembly Language In Electronics
Assembly Language In ElectronicsAsaduzzaman Kanok
 
Assembly chapter One.pptx
Assembly chapter One.pptxAssembly chapter One.pptx
Assembly chapter One.pptxssuserb78e291
 
Combinational logic circuits
Combinational logic circuitsCombinational logic circuits
Combinational logic circuitsAswiniT3
 
Abstract presentation on feature engineering on streaming data for pycon
Abstract presentation on feature engineering on streaming data for pyconAbstract presentation on feature engineering on streaming data for pycon
Abstract presentation on feature engineering on streaming data for pyconMayankPrasoon2
 
Digital Signal processor ADSP 21XX family
Digital Signal processor ADSP 21XX familyDigital Signal processor ADSP 21XX family
Digital Signal processor ADSP 21XX familySaloni Rane
 
Emergency Service Provide by Mobile
Emergency Service Provide by MobileEmergency Service Provide by Mobile
Emergency Service Provide by MobileSamiul Hoque
 
8051 microcontroller
8051 microcontroller 8051 microcontroller
8051 microcontroller nitugatkal
 
How to Store and Visualize CAN Bus Telematic Data with InfluxDB Cloud and Gra...
How to Store and Visualize CAN Bus Telematic Data with InfluxDB Cloud and Gra...How to Store and Visualize CAN Bus Telematic Data with InfluxDB Cloud and Gra...
How to Store and Visualize CAN Bus Telematic Data with InfluxDB Cloud and Gra...InfluxData
 
2. ALU and MIPS Arcitecture introduction.pdf
2. ALU and MIPS Arcitecture introduction.pdf2. ALU and MIPS Arcitecture introduction.pdf
2. ALU and MIPS Arcitecture introduction.pdfbsse20142018
 
A very simple hexagonal architecture.pdf
A very simple hexagonal architecture.pdfA very simple hexagonal architecture.pdf
A very simple hexagonal architecture.pdfDan MAGIER
 
Bca 2nd sem-u-3.1-basic computer programming and micro programmed control
Bca 2nd sem-u-3.1-basic computer programming and micro programmed controlBca 2nd sem-u-3.1-basic computer programming and micro programmed control
Bca 2nd sem-u-3.1-basic computer programming and micro programmed controlRai University
 
B.sc cs-ii-u-3.1-basic computer programming and micro programmed control
B.sc cs-ii-u-3.1-basic computer programming and micro programmed controlB.sc cs-ii-u-3.1-basic computer programming and micro programmed control
B.sc cs-ii-u-3.1-basic computer programming and micro programmed controlRai University
 
Part III: Assembly Language
Part III: Assembly LanguagePart III: Assembly Language
Part III: Assembly LanguageAhmed M. Abed
 
basic computer programming and micro programmed control
basic computer programming and micro programmed controlbasic computer programming and micro programmed control
basic computer programming and micro programmed controlRai University
 

Similar to Instruction Set and Assembly Language Programming (20)

siudhai ki marks sheih shuuu kvms jiiiiv
siudhai ki marks sheih shuuu kvms jiiiivsiudhai ki marks sheih shuuu kvms jiiiiv
siudhai ki marks sheih shuuu kvms jiiiiv
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
Computer architecture 3
Computer architecture 3Computer architecture 3
Computer architecture 3
 
Introduction to Blackfin BF532 DSP
Introduction to Blackfin BF532 DSPIntroduction to Blackfin BF532 DSP
Introduction to Blackfin BF532 DSP
 
Chapter 1SyllabusCatalog Description Computer structu
Chapter 1SyllabusCatalog Description Computer structuChapter 1SyllabusCatalog Description Computer structu
Chapter 1SyllabusCatalog Description Computer structu
 
Assembly Language In Electronics
Assembly Language In ElectronicsAssembly Language In Electronics
Assembly Language In Electronics
 
Assembly chapter One.pptx
Assembly chapter One.pptxAssembly chapter One.pptx
Assembly chapter One.pptx
 
Combinational logic circuits
Combinational logic circuitsCombinational logic circuits
Combinational logic circuits
 
Abstract presentation on feature engineering on streaming data for pycon
Abstract presentation on feature engineering on streaming data for pyconAbstract presentation on feature engineering on streaming data for pycon
Abstract presentation on feature engineering on streaming data for pycon
 
Digital Signal processor ADSP 21XX family
Digital Signal processor ADSP 21XX familyDigital Signal processor ADSP 21XX family
Digital Signal processor ADSP 21XX family
 
Emergency Service Provide by Mobile
Emergency Service Provide by MobileEmergency Service Provide by Mobile
Emergency Service Provide by Mobile
 
8051 microcontroller
8051 microcontroller 8051 microcontroller
8051 microcontroller
 
How to Store and Visualize CAN Bus Telematic Data with InfluxDB Cloud and Gra...
How to Store and Visualize CAN Bus Telematic Data with InfluxDB Cloud and Gra...How to Store and Visualize CAN Bus Telematic Data with InfluxDB Cloud and Gra...
How to Store and Visualize CAN Bus Telematic Data with InfluxDB Cloud and Gra...
 
Mobile CDS LTE Simulation Demo
Mobile CDS LTE Simulation Demo Mobile CDS LTE Simulation Demo
Mobile CDS LTE Simulation Demo
 
2. ALU and MIPS Arcitecture introduction.pdf
2. ALU and MIPS Arcitecture introduction.pdf2. ALU and MIPS Arcitecture introduction.pdf
2. ALU and MIPS Arcitecture introduction.pdf
 
A very simple hexagonal architecture.pdf
A very simple hexagonal architecture.pdfA very simple hexagonal architecture.pdf
A very simple hexagonal architecture.pdf
 
Bca 2nd sem-u-3.1-basic computer programming and micro programmed control
Bca 2nd sem-u-3.1-basic computer programming and micro programmed controlBca 2nd sem-u-3.1-basic computer programming and micro programmed control
Bca 2nd sem-u-3.1-basic computer programming and micro programmed control
 
B.sc cs-ii-u-3.1-basic computer programming and micro programmed control
B.sc cs-ii-u-3.1-basic computer programming and micro programmed controlB.sc cs-ii-u-3.1-basic computer programming and micro programmed control
B.sc cs-ii-u-3.1-basic computer programming and micro programmed control
 
Part III: Assembly Language
Part III: Assembly LanguagePart III: Assembly Language
Part III: Assembly Language
 
basic computer programming and micro programmed control
basic computer programming and micro programmed controlbasic computer programming and micro programmed control
basic computer programming and micro programmed control
 

More from Brenda Debra

Central Processing Unit
Central Processing UnitCentral Processing Unit
Central Processing UnitBrenda Debra
 
Describe the register
Describe the registerDescribe the register
Describe the registerBrenda Debra
 
Sequential circuit
Sequential circuitSequential circuit
Sequential circuitBrenda Debra
 
perform operation with boolean algebra
perform operation with boolean algebraperform operation with boolean algebra
perform operation with boolean algebraBrenda Debra
 
Understand data representation on CPU 1
Understand data representation on CPU 1Understand data representation on CPU 1
Understand data representation on CPU 1Brenda Debra
 
Computer System Architecture
Computer System ArchitectureComputer System Architecture
Computer System ArchitectureBrenda Debra
 

More from Brenda Debra (6)

Central Processing Unit
Central Processing UnitCentral Processing Unit
Central Processing Unit
 
Describe the register
Describe the registerDescribe the register
Describe the register
 
Sequential circuit
Sequential circuitSequential circuit
Sequential circuit
 
perform operation with boolean algebra
perform operation with boolean algebraperform operation with boolean algebra
perform operation with boolean algebra
 
Understand data representation on CPU 1
Understand data representation on CPU 1Understand data representation on CPU 1
Understand data representation on CPU 1
 
Computer System Architecture
Computer System ArchitectureComputer System Architecture
Computer System Architecture
 

Recently uploaded

Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 

Recently uploaded (20)

Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 

Instruction Set and Assembly Language Programming

  • 1.
  • 2. 3.1.1DefineInstructionset,machineandassemblylanguage  INSTRUCTION SET :  The complete collection of instructions that are understood by a CPU • Known also as Machine Code/Machine Instruction • Binary representation • Usually represented by assembly codes
  • 3. Machinelanguage:  a binary program (or binary code).  a sequence of instruction and operand in binary that list the exact representation instruction as they appear in computer memory.  Natural language of a particular computer system.  Strings of numbers or binary codes (0 or 1).
  • 4. Machinelanguage:  Machine-dependent (differ from one µP to other µP.  Program written in any other language must be translated to binary representation of instruction before they can be executed by computer.  Programmers need to know specifically the architecture of CPU.
  • 5.
  • 6.  Assembly language is a symbolic representation of a machine language of specific processor. Assembly language is a form that is very dependent on the underlying architecture.  Using english -like abbreviations (MUL), ( ADD), (SUB)  Assembler as translator.  Assembler - Translate ordinary mnemonics such as MOVE Data, Acc, into their corresponding machine language (the only form of instruction that computer can executed)
  • 7. Easy to make compilers, debuggers and other device tools. Allow accessing information that is not accessible (restricted) from high level languages. More function library that can be used in programming development. Possibility to make library function that compatible with different compiler and
  • 8.  (Development) Requires longer development time  (Reliability & Security) Easy to makes error  (Debug) More possibility for errors  (Maintain) Difficult to modify because it allows unstructured code.  (Portability) Difficult to porting to different platforms. platforms.
  • 9.  Using everyday English and common mathematical notation. (x = I + j)  Overcome problems : assembly language require many instruction to accomplish a simple task.  Single instruction in HLL = several AL instructions.  Compiler as translator.
  • 10.
  • 11.
  • 12. H HH HH HH HH HH HH HH 9/19/2019 32 24|23 16 | 15 8|7 4|3 0
  • 13. DATA SIZE BIT (n) RANGE (0-2n) Byte 8 bit 0 - 255 Word 16 bit 0 - 65535 Long word 32 bit 0 - 4294967295 9/19/2019
  • 14. DATA SIZE BIT (n) NEGATIVE RANGE (-2n-1) POSITIVE RANGE (0 to 2n-1-1) byte 8 bit -2 8-1 28-1 -1 Word 16 bit -2 16-1 216-1 -1 Long word 32 bit -2 32-1 232-1 -1 9/19/2019
  • 15. Data transfer Group  Arithmetic Group Logical Group
  • 16.  These instructions transfer or move data between its internal registers, between an internal register and a storage location in memory, or between two locations in memory.  - memory to register  - register to memory  - register to register  - memory to memory
  • 17. MNEMONIC MOVE CHARACTERISTICS REGISTER REGISTER OPERATION MOVE.W D0, D1 BEFORE D0 D1 AFTER D0 D1 78 56 34 12 78 56 56 7812 34 56 78 9/19/2019 12 34 56 78
  • 18. 01000 42 51 01002 55 13 9/19/2019 MNEMONIC MOVE CHARACTERISTICS MEMORY REGISTER OPERATION MOVE.W $1000, D1 BEFORE D1 AFTER D1 FE ED 42 51 EFBEEDFE 135501002 514201000
  • 19. MNEMONIC MOVE CHARACTERISTICS REGSITER MEMORY OPERATION MOVE.W D1, $1000 BEFORE D1 AFTER D1 9/19/2019 EFBEEDFE 135501000 EFBE01000 EFBEEDFE 135501002 514201000
  • 20. 9/19/2019 MNEMONIC MOVE CHARACTERISTICS MEMORY MEMORY OPERATION MOVE.W $1000, $1002 BEFORE D1 AFTER D1 EFBEEDFE 514201002 514201000 EFBEEDFE 135501002 514201000
  • 21. 9/19/2019 MNEMONIC MOVEQ (move quick) CHARACTERISTICS • The value is moved as integer 8 bit (range-128 to +127) • Data size = 8 bit (1 byte) • 8 bit is extended to fulfill 32bit data register OPERATION MOVEQ #$F1,D1 BEFORE D1 AFTER D1 FF FF FF F1 12 34 56 78
  • 23. MNEMONIC ADD CHARACTERISTICS •To add the value at destination= destination +source •Data size = B.W.L OPERATION ADD.W D1, D3 BEFORE D1 D3 AFTER D1 D3 9/19/2019 FD CC 01 23 FD CC 57 9B12 34 56 78 12 34 56 78
  • 24. 9/19/2019 MNEMONIC ADDQ (add quick) CHARACTERISTICS • Data size for source operand = 1…..8 • Data size for destination operand = any value • Data size = B.W.L OPERATION ADDQ.W #3,D6 BEFORE D6 AFTER D6 12 34 57 02 12 34 56 FF
  • 25. 9/19/2019 MNEMONIC SUB CHARACTERISTICS •Data size for source operand = 1…..8 • Data size for destination operand = any value • Data size = B.W.L OPERATION SUB.W D1,D0 BEFORE D0 D1 AFTER D0 D1 00 00 00 0200 00 30 40 00 00 00 0200 00 30 3E
  • 26. 9/19/2019 MNEMONIC SUBQ (Sub quick) CHARACTERISTICS • Data size for source operand = 1…..8 • Data size for destination operand = any value • Data size = B.W.L OPERATION SUBQ.B #7,D6 BEFORE D6 AFTER D6 12 34 56 78 12 34 56 71
  • 27. 9/19/2019 MNEMONIC MULU CHARACTERISTICS •Unsigned Multiplication • Source operand = 16 bit, any addressing mode • Destination operand = 16 bit, data register • Multiplication outcome= 32 bit, saved in destination operand OPERATION MULU.W #2,D3 BEFORE D3 AFTER D3 FD CC 01 00 00 00 02 00
  • 28. MNEMONIC MULS CHARACTERISTICS • Signed Multiplication • Source operand = 16 bit, any addressing mode • Destination operand = 16 bit, data register • Multiplication outcome= 32 bit, saved in destination operand OPERATION MULS.W #3,D3 BEFORE D3 AFTER D3 9/19/2019 FD CC FF 00 FF FF FD 00
  • 29. MNEMONIC DIVU CHARACTERISTICS • Unsigned Division • Data size for source operand= 16 bit divider, and addressing modes. • Data size for destination operand = the value is divided with 342 bit, data register •Division outcome= low of destination register. Balance =high of destination register OPERATION DIVU.W D0,D3 BEFORE D0 D3 AFTER D0 D3 9/19/2019 00 00 03 0800 00 00 12 00 02 00 2B00 00 00 12 Baki Hasil Bahagi
  • 30. MNEMONIC DIVS CHARACTERISTICS • Signed division • source operand= 16 bit data • destination operand = 32 bit data • Division outcome= low of destination operand. Balance = high of destination operand (16 bit) OPERATION DIVS.W D0,D3 BEFORE D0 D3 AFTER D0 D3 9/19/2019 FF FF FE 0000 00 00 12 FF F8 FF E4 00 00 00 12 Baki Hasil Bahagi
  • 33. MNEMONIC AND.B #$3E, D3 CHARACTERISTICS [D3(B) AND $3E  D3 (B) ] (8 bit data in D3 ‘AND’ with 8 bit data and the output in D3) OPERATION BEFORE D3 AFTER D3 9/19/2019 74 0 1 1 1 0 1 0 0 AND 3E 0 0 1 1 1 1 1 0 34 0 0 1 1 0 1 0 0 12345674 12343634
  • 34. MNEMONIC OR.B D0, D1 CHARACTERISTICS [D1 (B) or D0 (B)  D1(B) ] (8 bit data in D1 ‘OR’ with 8 bit data in D0, and the output in D1) OPERATION BEFORE D0 D1 AFTER D0 D1 9/19/2019 3E 0 0 1 1 1 1 1 0 OR 74 0 1 1 1 0 1 0 0 7E 0 1 1 1 1 1 1 0 1234563E98765474 1234367E98765474
  • 35. MNEMONIC NOT.B D1 CHARACTERISTICS [D1(B) NOT  D1 ] (The content of D1 is NOT, and the output in D1) OPERATION AA  1010 1010 55  0101 0101 BEFORE AFTER 9/19/2019 12345655 123436AA D1