SlideShare uma empresa Scribd logo
1 de 17
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

Mais conteúdo relacionado

Mais procurados

System software - macro expansion,nested macro calls
System software - macro expansion,nested macro callsSystem software - macro expansion,nested macro calls
System software - macro expansion,nested macro callsSARASWATHI S
 
Assemblers: Ch03
Assemblers: Ch03Assemblers: Ch03
Assemblers: Ch03desta_gebre
 
RECURSIVE DESCENT PARSING
RECURSIVE DESCENT PARSINGRECURSIVE DESCENT PARSING
RECURSIVE DESCENT PARSINGJothi Lakshmi
 
Direct linking loader
Direct linking loaderDirect linking loader
Direct linking loaderbabyparul
 
Intermediate code generation in Compiler Design
Intermediate code generation in Compiler DesignIntermediate code generation in Compiler Design
Intermediate code generation in Compiler DesignKuppusamy P
 
COMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONSCOMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONSsonalikharade3
 
Introduction to loaders
Introduction to loadersIntroduction to loaders
Introduction to loadersTech_MX
 
Fundamentals of Language Processing
Fundamentals of Language ProcessingFundamentals of Language Processing
Fundamentals of Language ProcessingHemant Sharma
 
Lecture 14 run time environment
Lecture 14 run time environmentLecture 14 run time environment
Lecture 14 run time environmentIffat Anjum
 
System Programming- Unit I
System Programming- Unit ISystem Programming- Unit I
System Programming- Unit ISaranya1702
 
Code optimization in compiler design
Code optimization in compiler designCode optimization in compiler design
Code optimization in compiler designKuppusamy P
 

Mais procurados (20)

Interrupt
InterruptInterrupt
Interrupt
 
System software - macro expansion,nested macro calls
System software - macro expansion,nested macro callsSystem software - macro expansion,nested macro calls
System software - macro expansion,nested macro calls
 
Type Checking(Compiler Design) #ShareThisIfYouLike
Type Checking(Compiler Design) #ShareThisIfYouLikeType Checking(Compiler Design) #ShareThisIfYouLike
Type Checking(Compiler Design) #ShareThisIfYouLike
 
Assemblers: Ch03
Assemblers: Ch03Assemblers: Ch03
Assemblers: Ch03
 
RECURSIVE DESCENT PARSING
RECURSIVE DESCENT PARSINGRECURSIVE DESCENT PARSING
RECURSIVE DESCENT PARSING
 
P code
P codeP code
P code
 
Compilers Design
Compilers DesignCompilers Design
Compilers Design
 
Direct linking loader
Direct linking loaderDirect linking loader
Direct linking loader
 
Code generation
Code generationCode generation
Code generation
 
Intermediate code generation in Compiler Design
Intermediate code generation in Compiler DesignIntermediate code generation in Compiler Design
Intermediate code generation in Compiler Design
 
Microprogrammed Control Unit
Microprogrammed Control UnitMicroprogrammed Control Unit
Microprogrammed Control Unit
 
COMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONSCOMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONS
 
Introduction to loaders
Introduction to loadersIntroduction to loaders
Introduction to loaders
 
Unit 4 sp macro
Unit 4 sp macroUnit 4 sp macro
Unit 4 sp macro
 
Fundamentals of Language Processing
Fundamentals of Language ProcessingFundamentals of Language Processing
Fundamentals of Language Processing
 
Linker and Loader
Linker and Loader Linker and Loader
Linker and Loader
 
Assembler
AssemblerAssembler
Assembler
 
Lecture 14 run time environment
Lecture 14 run time environmentLecture 14 run time environment
Lecture 14 run time environment
 
System Programming- Unit I
System Programming- Unit ISystem Programming- Unit I
System Programming- Unit I
 
Code optimization in compiler design
Code optimization in compiler designCode optimization in compiler design
Code optimization in compiler design
 

Destaque

System Programming Unit III
System Programming Unit IIISystem Programming Unit III
System Programming Unit IIIManoj Patil
 
System Programming Unit IV
System Programming Unit IVSystem Programming Unit IV
System Programming Unit IVManoj Patil
 
System Programing Unit 1
System Programing Unit 1System Programing Unit 1
System Programing Unit 1Manoj Patil
 
System Programming Unit II
System Programming Unit IISystem Programming Unit II
System Programming Unit IIManoj Patil
 
Introduction to systems programming
Introduction to systems programmingIntroduction to systems programming
Introduction to systems programmingMukesh Tekwani
 

Destaque (7)

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
 
System Programing Unit 1
System Programing Unit 1System Programing Unit 1
System Programing Unit 1
 
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
 

Semelhante a 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 hoodAdarsh 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_memoryNico Ludwig
 
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 processorAbha Damani
 
Introduction to debugging linux applications
Introduction to debugging linux applicationsIntroduction to debugging linux applications
Introduction to debugging linux applicationscommiebstrd
 
Exploit techniques - a quick review
Exploit techniques - a quick reviewExploit techniques - a quick review
Exploit techniques - a quick reviewCe.Se.N.A. Security
 
Introduction to Assembly Language
Introduction to Assembly Language Introduction to Assembly Language
Introduction to Assembly Language ApekshaShinde6
 
7 compiler lab
7 compiler lab 7 compiler lab
7 compiler lab MashaelQ
 
Workshop Assembler
Workshop AssemblerWorkshop Assembler
Workshop AssemblerTuhin_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 DayPhil Estes
 
EEDC - Apache Pig
EEDC - Apache PigEEDC - Apache Pig
EEDC - Apache Pigjavicid
 
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 TwitterDataWorks Summit
 
Simplified instructional computer
Simplified instructional computerSimplified instructional computer
Simplified instructional computerKirby Fabro
 

Semelhante a 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
 

Mais de Mohd Arif

Bootp and dhcp
Bootp and dhcpBootp and dhcp
Bootp and dhcpMohd Arif
 
Arp and rarp
Arp and rarpArp and rarp
Arp and rarpMohd Arif
 
User datagram protocol
User datagram protocolUser datagram protocol
User datagram protocolMohd Arif
 
Project identification
Project identificationProject identification
Project identificationMohd Arif
 
Project evalaution techniques
Project evalaution techniquesProject evalaution techniques
Project evalaution techniquesMohd Arif
 
Presentation
PresentationPresentation
PresentationMohd Arif
 
Pointers in c
Pointers in cPointers in c
Pointers in cMohd Arif
 
Peer to-peer
Peer to-peerPeer to-peer
Peer to-peerMohd Arif
 
Overview of current communications systems
Overview of current communications systemsOverview of current communications systems
Overview of current communications systemsMohd Arif
 
Overall 23 11_2007_hdp
Overall 23 11_2007_hdpOverall 23 11_2007_hdp
Overall 23 11_2007_hdpMohd Arif
 
Objectives of budgeting
Objectives of budgetingObjectives of budgeting
Objectives of budgetingMohd Arif
 
Network management
Network managementNetwork management
Network managementMohd Arif
 
Networing basics
Networing basicsNetworing basics
Networing basicsMohd 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 platformMohd Arif
 
Ip sec and ssl
Ip sec and  sslIp sec and  ssl
Ip sec and sslMohd Arif
 
Ip security in i psec
Ip security in i psecIp security in i psec
Ip security in i psecMohd Arif
 
Intro to comp. hardware
Intro to comp. hardwareIntro to comp. hardware
Intro to comp. hardwareMohd Arif
 

Mais de 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
 

Último

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 

Último (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 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