SlideShare a Scribd company logo
Assembler Design Options

One-pass assemblers
Multi-pass assemblers
Two-pass assembler with overlay structure




                                            1
Two-Pass Assembler with Overlay
             Structure

For small memory
» pass 1 and pass 2 are never required at the same time
» three segments
   – root: driver program and shared tables and subroutines
   – pass 1
   – pass 2
» tree structure
» overlay program




                                                              2
One-Pass Assemblers

Main problem
» forward references
    – data items
    – labels on instructions
Solution
» data items: require all such areas be defined before they are
  referenced
» labels on instructions: no good solution




                                                                  3
One-Pass Assemblers

Main Problem
» forward reference
   – data items
   – labels on instructions
Two types of one-pass assembler
» load-and-go
   – produces object code directly in memory for immediate
     execution
» the other
   – produces usual kind of object code for later execution




                                                              4
Load-and-go Assembler

Characteristics
» Useful for program development and testing
» Avoids the overhead of writing the object program out and
  reading it back
» Both one-pass and two-pass assemblers can be designed
  as load-and-go.
» However one-pass also avoids the over head of an
  additional pass over the source program
» For a load-and-go assembler, the actual address must be
  known at assembly time, we can use an absolute program




                                                              5
Forward Reference in One-pass Assembler


For any symbol that has not yet been defined
1. omit the address translation
2. insert the symbol into SYMTAB, and mark this symbol
   undefined
3. the address that refers to the undefined symbol is added to a
   list of forward references associated with the symbol table
   entry
4. when the definition for a symbol is encountered, the proper
   address for the symbol is then inserted into any instructions
   previous generated according to the forward reference list




                                                                   6
Load-and-go Assembler (Cont.)

At the end of the program
» any SYMTAB entries that are still marked with * indicate
  undefined symbols
» search SYMTAB for the symbol named in the END
  statement and jump to this location to begin execution
The actual starting address must be specified at
assembly time
Example
» Figure 2.18, 2.19




                                                             7
Producing Object Code

When external working-storage devices are not
available or too slow (for the intermediate file
between the two passes
Solution:
» When definition of a symbol is encountered, the assembler
  must generate another Tex record with the correct operand
  address
» The loader is used to complete forward references that could
  not be handled by the assembler
» The object program records must be kept in their original
  order when they are presented to the loader
Example: Figure 2.20
                                                                 8
Multi-Pass Assemblers

Restriction on EQU and ORG
» no forward reference, since symbols’ value can’t be defined
  during the first pass
Example
» Use link list to keep track of whose value depend on an
  undefined symbol
Figure 2.21




                                                                9
Implementation Examples

Microsoft MASM Assembler
Sun Sparc Assembler
IBM AIX Assembler




                               10
Microsoft MASM Assembler

SEGMENT
» a collection segments, each segment is defined as
  belonging to a particular class, CODE, DATA, CONST,
  STACK
» registers: CS (code), SS (stack), DS (data), ES, FS, GS
» similar to program blocks in SIC
ASSUME
» e.g. ASSUME      ES:DATASEG2
» e.g. MOVE        AX, DATASEG2
      MOVE         ES,AX
» similar to BASE in SIC


                                                            11
Microsoft MASM Assembler

JUMP with forward reference
»   near jump: 2 or 3 bytes
»   far jump: 5 bytes
»   e.g.      JMP     TARGET
»   Warning: JMP      FAR PTR TARGET
»   Warning: JMP      SHORT TARGET
»   Pass 1: reserves 3 bytes for jump instruction
»   phase error
PUBLIC, EXTRN
» similar to EXTDEF, EXTREF in SIC



                                                    12
Sun Sparc Assembler

Sections
» .TEXT, .DATA, .RODATA, .BSS
Symbols
» global vs. weak
» similar to the combination of EXTDEF and EXTREF in SIC
Delayed branches
» delayed slots
» annulled branch instruction




                                                           13
Sun Sparc Assembler

LOOP: .                   LOOP: .
      .                         .
      ADD %L2, %L3, %L4         .
      CMP %L0, 10               ADD %L2, %L3, %L4
      BLE LOOP                  CMP %L0, 10
      .                         BLE LOOP
     .                          NOP
     .
     CMP %L0, 10
     BLE LOOP
     ADD %L2, %L3, %L4
.
                                                    14
Sun Sparc Assembler

LOOP: ADD     %L2, %L3, %L4
      .
      .
      CMP     %L0, 10
      BLE,A   LOOP
      .                       LOOP: .
                                    .
                                    .
                                    CMP     %L0, 10
                                    BLE,A   LOOP
                                    ADD     %L2, %L3, %L4


                                                            15
AIX Assembler for PowerPC

Similar to System/370
Base relative addressing
» save instruction space, no absolute address
» base register table:
    – general purpose registers can be used as base register
» easy for program relocation
    – only data whose values are to be actual address needs to be
      modified
» e.g. USING       LENGTH, 1
»      USING       BUFFER, 4
» Similar to BASE in SIC
» DROP

                                                                    16
AIX Assembler for PowerPC

Alignment
» instruction (2)
» data: halfword operand (2), fullword operand (4)
» Slack bytes
.CSECT
» control sections: RO(read-only data), RW(read-write data),
  PR(executable instructions), BS(uninitialized read/write data)
» dummy section




                                                                   17

More Related Content

What's hot

Computer organisation -morris mano
Computer organisation  -morris manoComputer organisation  -morris mano
Computer organisation -morris mano
vishnu murthy
 
basics of compiler design
basics of compiler designbasics of compiler design
basics of compiler design
Preeti Katiyar
 
Pass Structure of Assembler
Pass Structure of AssemblerPass Structure of Assembler
Character generation techniques
Character generation techniquesCharacter generation techniques
Character generation techniques
Mani Kanth
 
15 control-computer organization and archietecture-CO-COA
15 control-computer organization and archietecture-CO-COA15 control-computer organization and archietecture-CO-COA
15 control-computer organization and archietecture-CO-COA
Jay Patel
 
System Programing Unit 1
System Programing Unit 1System Programing Unit 1
System Programing Unit 1
Manoj Patil
 
Program control
Program controlProgram control
Program control
Rahul Narang
 
System Programming- Unit I
System Programming- Unit ISystem Programming- Unit I
System Programming- Unit I
Saranya1702
 
Control Units : Microprogrammed and Hardwired:control unit
Control Units : Microprogrammed and Hardwired:control unitControl Units : Microprogrammed and Hardwired:control unit
Control Units : Microprogrammed and Hardwired:control unit
abdosaidgkv
 
Interrupts of 8086
Interrupts of 8086Interrupts of 8086
Interrupts of 8086
Albin Panakkal
 
Language processing activity
Language processing activityLanguage processing activity
Language processing activity
Dhruv Sabalpara
 
RECURSIVE DESCENT PARSING
RECURSIVE DESCENT PARSINGRECURSIVE DESCENT PARSING
RECURSIVE DESCENT PARSING
Jothi Lakshmi
 
Single pass assembler
Single pass assemblerSingle pass assembler
Single pass assembler
Bansari Shah
 
Unit 3 basic processing unit
Unit 3   basic processing unitUnit 3   basic processing unit
Unit 3 basic processing unit
chidabdu
 
Introduction to loaders
Introduction to loadersIntroduction to loaders
Introduction to loaders
Tech_MX
 
Planning in AI(Partial order planning)
Planning in AI(Partial order planning)Planning in AI(Partial order planning)
Planning in AI(Partial order planning)
Vicky Tyagi
 
Assembly language programming(unit 4)
Assembly language programming(unit 4)Assembly language programming(unit 4)
Assembly language programming(unit 4)
Ashim Saha
 
Unit 4 sp macro
Unit 4 sp macroUnit 4 sp macro
Unit 4 sp macro
Deepmala Sharma
 
Macro-processor
Macro-processorMacro-processor
Macro-processor
Temesgen Molla
 
Direct linking loader
Direct linking loaderDirect linking loader
Direct linking loader
babyparul
 

What's hot (20)

Computer organisation -morris mano
Computer organisation  -morris manoComputer organisation  -morris mano
Computer organisation -morris mano
 
basics of compiler design
basics of compiler designbasics of compiler design
basics of compiler design
 
Pass Structure of Assembler
Pass Structure of AssemblerPass Structure of Assembler
Pass Structure of Assembler
 
Character generation techniques
Character generation techniquesCharacter generation techniques
Character generation techniques
 
15 control-computer organization and archietecture-CO-COA
15 control-computer organization and archietecture-CO-COA15 control-computer organization and archietecture-CO-COA
15 control-computer organization and archietecture-CO-COA
 
System Programing Unit 1
System Programing Unit 1System Programing Unit 1
System Programing Unit 1
 
Program control
Program controlProgram control
Program control
 
System Programming- Unit I
System Programming- Unit ISystem Programming- Unit I
System Programming- Unit I
 
Control Units : Microprogrammed and Hardwired:control unit
Control Units : Microprogrammed and Hardwired:control unitControl Units : Microprogrammed and Hardwired:control unit
Control Units : Microprogrammed and Hardwired:control unit
 
Interrupts of 8086
Interrupts of 8086Interrupts of 8086
Interrupts of 8086
 
Language processing activity
Language processing activityLanguage processing activity
Language processing activity
 
RECURSIVE DESCENT PARSING
RECURSIVE DESCENT PARSINGRECURSIVE DESCENT PARSING
RECURSIVE DESCENT PARSING
 
Single pass assembler
Single pass assemblerSingle pass assembler
Single pass assembler
 
Unit 3 basic processing unit
Unit 3   basic processing unitUnit 3   basic processing unit
Unit 3 basic processing unit
 
Introduction to loaders
Introduction to loadersIntroduction to loaders
Introduction to loaders
 
Planning in AI(Partial order planning)
Planning in AI(Partial order planning)Planning in AI(Partial order planning)
Planning in AI(Partial order planning)
 
Assembly language programming(unit 4)
Assembly language programming(unit 4)Assembly language programming(unit 4)
Assembly language programming(unit 4)
 
Unit 4 sp macro
Unit 4 sp macroUnit 4 sp macro
Unit 4 sp macro
 
Macro-processor
Macro-processorMacro-processor
Macro-processor
 
Direct linking loader
Direct linking loaderDirect linking loader
Direct linking loader
 

Viewers also liked

Smqa unit ii
Smqa unit   iiSmqa unit   ii
Smqa unit ii
Manoj Patil
 
System Programming Unit III
System Programming Unit IIISystem Programming Unit III
System Programming Unit III
Manoj Patil
 
System Programming Unit IV
System Programming Unit IVSystem Programming Unit IV
System Programming Unit IV
Manoj Patil
 
Assembler
AssemblerAssembler
Assembler
Maha Lakshmi
 
System Programming Unit II
System Programming Unit IISystem Programming Unit II
System Programming Unit II
Manoj Patil
 
Introduction to systems programming
Introduction to systems programmingIntroduction to systems programming
Introduction to systems programming
Mukesh Tekwani
 

Viewers also liked (6)

Smqa unit ii
Smqa unit   iiSmqa unit   ii
Smqa unit ii
 
System Programming Unit III
System Programming Unit IIISystem Programming Unit III
System Programming Unit III
 
System Programming Unit IV
System Programming Unit IVSystem Programming Unit IV
System Programming Unit IV
 
Assembler
AssemblerAssembler
Assembler
 
System Programming Unit II
System Programming Unit IISystem Programming Unit II
System Programming Unit II
 
Introduction to systems programming
Introduction to systems programmingIntroduction to systems programming
Introduction to systems programming
 

Similar to Assembler design option

Apache Spark: What's under the hood
Apache Spark: What's under the hoodApache Spark: What's under the hood
Apache Spark: What's under the hood
Adarsh Pannu
 
(8) cpp stack automatic_memory_and_static_memory
(8) cpp stack automatic_memory_and_static_memory(8) cpp stack automatic_memory_and_static_memory
(8) cpp stack automatic_memory_and_static_memory
Nico Ludwig
 
loader.ppt
loader.pptloader.ppt
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Bilal Amjad
 
Advanced Data Science on Spark-(Reza Zadeh, Stanford)
Advanced Data Science on Spark-(Reza Zadeh, Stanford)Advanced Data Science on Spark-(Reza Zadeh, Stanford)
Advanced Data Science on Spark-(Reza Zadeh, Stanford)
Spark Summit
 
Unit 3 assembler and processor
Unit 3   assembler and processorUnit 3   assembler and processor
Unit 3 assembler and processor
Abha Damani
 
Introduction to debugging linux applications
Introduction to debugging linux applicationsIntroduction to debugging linux applications
Introduction to debugging linux applications
commiebstrd
 
Exploit techniques - a quick review
Exploit techniques - a quick reviewExploit techniques - a quick review
Exploit techniques - a quick review
Ce.Se.N.A. Security
 
EC8691-MPMC-PPT.pptx
EC8691-MPMC-PPT.pptxEC8691-MPMC-PPT.pptx
EC8691-MPMC-PPT.pptx
Manikandan813397
 
Csd01
Csd01Csd01
Introduction to Assembly Language
Introduction to Assembly Language Introduction to Assembly Language
Introduction to Assembly Language
ApekshaShinde6
 
Exploitation Crash Course
Exploitation Crash CourseExploitation Crash Course
Exploitation Crash Course
UTD Computer Security Group
 
7 compiler lab
7 compiler lab 7 compiler lab
7 compiler lab
MashaelQ
 
microprocessor
 microprocessor microprocessor
microprocessor
ATTO RATHORE
 
Workshop Assembler
Workshop AssemblerWorkshop Assembler
Workshop Assembler
Tuhin_Das
 
Quantifying Container Runtime Performance: OSCON 2017 Open Container Day
Quantifying Container Runtime Performance: OSCON 2017 Open Container DayQuantifying Container Runtime Performance: OSCON 2017 Open Container Day
Quantifying Container Runtime Performance: OSCON 2017 Open Container Day
Phil Estes
 
EEDC - Apache Pig
EEDC - Apache PigEEDC - Apache Pig
EEDC - Apache Pig
javicid
 
Hadoop Performance Optimization at Scale, Lessons Learned at Twitter
Hadoop Performance Optimization at Scale, Lessons Learned at TwitterHadoop Performance Optimization at Scale, Lessons Learned at Twitter
Hadoop Performance Optimization at Scale, Lessons Learned at Twitter
DataWorks Summit
 
Kirby, Fabro
Kirby, FabroKirby, Fabro
Kirby, Fabro
ZHYRA ROSIL
 
Simplified instructional computer
Simplified instructional computerSimplified instructional computer
Simplified instructional computer
Kirby Fabro
 

Similar to Assembler design option (20)

Apache Spark: What's under the hood
Apache Spark: What's under the hoodApache Spark: What's under the hood
Apache Spark: What's under the hood
 
(8) cpp stack automatic_memory_and_static_memory
(8) cpp stack automatic_memory_and_static_memory(8) cpp stack automatic_memory_and_static_memory
(8) cpp stack automatic_memory_and_static_memory
 
loader.ppt
loader.pptloader.ppt
loader.ppt
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
 
Advanced Data Science on Spark-(Reza Zadeh, Stanford)
Advanced Data Science on Spark-(Reza Zadeh, Stanford)Advanced Data Science on Spark-(Reza Zadeh, Stanford)
Advanced Data Science on Spark-(Reza Zadeh, Stanford)
 
Unit 3 assembler and processor
Unit 3   assembler and processorUnit 3   assembler and processor
Unit 3 assembler and processor
 
Introduction to debugging linux applications
Introduction to debugging linux applicationsIntroduction to debugging linux applications
Introduction to debugging linux applications
 
Exploit techniques - a quick review
Exploit techniques - a quick reviewExploit techniques - a quick review
Exploit techniques - a quick review
 
EC8691-MPMC-PPT.pptx
EC8691-MPMC-PPT.pptxEC8691-MPMC-PPT.pptx
EC8691-MPMC-PPT.pptx
 
Csd01
Csd01Csd01
Csd01
 
Introduction to Assembly Language
Introduction to Assembly Language Introduction to Assembly Language
Introduction to Assembly Language
 
Exploitation Crash Course
Exploitation Crash CourseExploitation Crash Course
Exploitation Crash Course
 
7 compiler lab
7 compiler lab 7 compiler lab
7 compiler lab
 
microprocessor
 microprocessor microprocessor
microprocessor
 
Workshop Assembler
Workshop AssemblerWorkshop Assembler
Workshop Assembler
 
Quantifying Container Runtime Performance: OSCON 2017 Open Container Day
Quantifying Container Runtime Performance: OSCON 2017 Open Container DayQuantifying Container Runtime Performance: OSCON 2017 Open Container Day
Quantifying Container Runtime Performance: OSCON 2017 Open Container Day
 
EEDC - Apache Pig
EEDC - Apache PigEEDC - Apache Pig
EEDC - Apache Pig
 
Hadoop Performance Optimization at Scale, Lessons Learned at Twitter
Hadoop Performance Optimization at Scale, Lessons Learned at TwitterHadoop Performance Optimization at Scale, Lessons Learned at Twitter
Hadoop Performance Optimization at Scale, Lessons Learned at Twitter
 
Kirby, Fabro
Kirby, FabroKirby, Fabro
Kirby, Fabro
 
Simplified instructional computer
Simplified instructional computerSimplified instructional computer
Simplified instructional computer
 

More from Mohd Arif

Bootp and dhcp
Bootp and dhcpBootp and dhcp
Bootp and dhcp
Mohd Arif
 
Arp and rarp
Arp and rarpArp and rarp
Arp and rarp
Mohd Arif
 
User datagram protocol
User datagram protocolUser datagram protocol
User datagram protocol
Mohd Arif
 
Project identification
Project identificationProject identification
Project identification
Mohd Arif
 
Project evalaution techniques
Project evalaution techniquesProject evalaution techniques
Project evalaution techniques
Mohd Arif
 
Presentation
PresentationPresentation
Presentation
Mohd Arif
 
Pointers in c
Pointers in cPointers in c
Pointers in c
Mohd Arif
 
Peer to-peer
Peer to-peerPeer to-peer
Peer to-peer
Mohd Arif
 
Overview of current communications systems
Overview of current communications systemsOverview of current communications systems
Overview of current communications systems
Mohd Arif
 
Overall 23 11_2007_hdp
Overall 23 11_2007_hdpOverall 23 11_2007_hdp
Overall 23 11_2007_hdp
Mohd Arif
 
Objectives of budgeting
Objectives of budgetingObjectives of budgeting
Objectives of budgeting
Mohd Arif
 
Network management
Network managementNetwork management
Network management
Mohd Arif
 
Networing basics
Networing basicsNetworing basics
Networing basics
Mohd Arif
 
Loaders
LoadersLoaders
Loaders
Mohd Arif
 
Lists
ListsLists
Lists
Mohd Arif
 
Iris ngx next generation ip based switching platform
Iris ngx next generation ip based switching platformIris ngx next generation ip based switching platform
Iris ngx next generation ip based switching platform
Mohd Arif
 
Ip sec and ssl
Ip sec and  sslIp sec and  ssl
Ip sec and ssl
Mohd Arif
 
Ip security in i psec
Ip security in i psecIp security in i psec
Ip security in i psec
Mohd Arif
 
Intro to comp. hardware
Intro to comp. hardwareIntro to comp. hardware
Intro to comp. hardware
Mohd Arif
 
Heap sort
Heap sortHeap sort
Heap sort
Mohd Arif
 

More from Mohd Arif (20)

Bootp and dhcp
Bootp and dhcpBootp and dhcp
Bootp and dhcp
 
Arp and rarp
Arp and rarpArp and rarp
Arp and rarp
 
User datagram protocol
User datagram protocolUser datagram protocol
User datagram protocol
 
Project identification
Project identificationProject identification
Project identification
 
Project evalaution techniques
Project evalaution techniquesProject evalaution techniques
Project evalaution techniques
 
Presentation
PresentationPresentation
Presentation
 
Pointers in c
Pointers in cPointers in c
Pointers in c
 
Peer to-peer
Peer to-peerPeer to-peer
Peer to-peer
 
Overview of current communications systems
Overview of current communications systemsOverview of current communications systems
Overview of current communications systems
 
Overall 23 11_2007_hdp
Overall 23 11_2007_hdpOverall 23 11_2007_hdp
Overall 23 11_2007_hdp
 
Objectives of budgeting
Objectives of budgetingObjectives of budgeting
Objectives of budgeting
 
Network management
Network managementNetwork management
Network management
 
Networing basics
Networing basicsNetworing basics
Networing basics
 
Loaders
LoadersLoaders
Loaders
 
Lists
ListsLists
Lists
 
Iris ngx next generation ip based switching platform
Iris ngx next generation ip based switching platformIris ngx next generation ip based switching platform
Iris ngx next generation ip based switching platform
 
Ip sec and ssl
Ip sec and  sslIp sec and  ssl
Ip sec and ssl
 
Ip security in i psec
Ip security in i psecIp security in i psec
Ip security in i psec
 
Intro to comp. hardware
Intro to comp. hardwareIntro to comp. hardware
Intro to comp. hardware
 
Heap sort
Heap sortHeap sort
Heap sort
 

Recently uploaded

Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
Federico Razzoli
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 

Recently uploaded (20)

Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 

Assembler design option

  • 1. Assembler Design Options One-pass assemblers Multi-pass assemblers Two-pass assembler with overlay structure 1
  • 2. Two-Pass Assembler with Overlay Structure For small memory » pass 1 and pass 2 are never required at the same time » three segments – root: driver program and shared tables and subroutines – pass 1 – pass 2 » tree structure » overlay program 2
  • 3. One-Pass Assemblers Main problem » forward references – data items – labels on instructions Solution » data items: require all such areas be defined before they are referenced » labels on instructions: no good solution 3
  • 4. One-Pass Assemblers Main Problem » forward reference – data items – labels on instructions Two types of one-pass assembler » load-and-go – produces object code directly in memory for immediate execution » the other – produces usual kind of object code for later execution 4
  • 5. Load-and-go Assembler Characteristics » Useful for program development and testing » Avoids the overhead of writing the object program out and reading it back » Both one-pass and two-pass assemblers can be designed as load-and-go. » However one-pass also avoids the over head of an additional pass over the source program » For a load-and-go assembler, the actual address must be known at assembly time, we can use an absolute program 5
  • 6. Forward Reference in One-pass Assembler For any symbol that has not yet been defined 1. omit the address translation 2. insert the symbol into SYMTAB, and mark this symbol undefined 3. the address that refers to the undefined symbol is added to a list of forward references associated with the symbol table entry 4. when the definition for a symbol is encountered, the proper address for the symbol is then inserted into any instructions previous generated according to the forward reference list 6
  • 7. Load-and-go Assembler (Cont.) At the end of the program » any SYMTAB entries that are still marked with * indicate undefined symbols » search SYMTAB for the symbol named in the END statement and jump to this location to begin execution The actual starting address must be specified at assembly time Example » Figure 2.18, 2.19 7
  • 8. Producing Object Code When external working-storage devices are not available or too slow (for the intermediate file between the two passes Solution: » When definition of a symbol is encountered, the assembler must generate another Tex record with the correct operand address » The loader is used to complete forward references that could not be handled by the assembler » The object program records must be kept in their original order when they are presented to the loader Example: Figure 2.20 8
  • 9. Multi-Pass Assemblers Restriction on EQU and ORG » no forward reference, since symbols’ value can’t be defined during the first pass Example » Use link list to keep track of whose value depend on an undefined symbol Figure 2.21 9
  • 10. Implementation Examples Microsoft MASM Assembler Sun Sparc Assembler IBM AIX Assembler 10
  • 11. Microsoft MASM Assembler SEGMENT » a collection segments, each segment is defined as belonging to a particular class, CODE, DATA, CONST, STACK » registers: CS (code), SS (stack), DS (data), ES, FS, GS » similar to program blocks in SIC ASSUME » e.g. ASSUME ES:DATASEG2 » e.g. MOVE AX, DATASEG2 MOVE ES,AX » similar to BASE in SIC 11
  • 12. Microsoft MASM Assembler JUMP with forward reference » near jump: 2 or 3 bytes » far jump: 5 bytes » e.g. JMP TARGET » Warning: JMP FAR PTR TARGET » Warning: JMP SHORT TARGET » Pass 1: reserves 3 bytes for jump instruction » phase error PUBLIC, EXTRN » similar to EXTDEF, EXTREF in SIC 12
  • 13. Sun Sparc Assembler Sections » .TEXT, .DATA, .RODATA, .BSS Symbols » global vs. weak » similar to the combination of EXTDEF and EXTREF in SIC Delayed branches » delayed slots » annulled branch instruction 13
  • 14. Sun Sparc Assembler LOOP: . LOOP: . . . ADD %L2, %L3, %L4 . CMP %L0, 10 ADD %L2, %L3, %L4 BLE LOOP CMP %L0, 10 . BLE LOOP . NOP . CMP %L0, 10 BLE LOOP ADD %L2, %L3, %L4 . 14
  • 15. Sun Sparc Assembler LOOP: ADD %L2, %L3, %L4 . . CMP %L0, 10 BLE,A LOOP . LOOP: . . . CMP %L0, 10 BLE,A LOOP ADD %L2, %L3, %L4 15
  • 16. AIX Assembler for PowerPC Similar to System/370 Base relative addressing » save instruction space, no absolute address » base register table: – general purpose registers can be used as base register » easy for program relocation – only data whose values are to be actual address needs to be modified » e.g. USING LENGTH, 1 » USING BUFFER, 4 » Similar to BASE in SIC » DROP 16
  • 17. AIX Assembler for PowerPC Alignment » instruction (2) » data: halfword operand (2), fullword operand (4) » Slack bytes .CSECT » control sections: RO(read-only data), RW(read-write data), PR(executable instructions), BS(uninitialized read/write data) » dummy section 17