lect7_برمجة نظم

  • Upload
    lua

  • View
    225

  • Download
    0

Embed Size (px)

Citation preview

  • 8/7/2019 lect7_

    1/12

    1

    ()

    /

    Algorithm

    :Two passesAlgorithm

    PASS 1:

    diagram- Pass 1)4.1(:

  • 8/7/2019 lect7_

    2/12

    2

    (1)

    (2)

    (3)

    (4)

    (5)

    (6)

    (7)

    (8)

    (9)

    (10)

    (12)

    (11)

  • 8/7/2019 lect7_

    3/12

    3

    MACRO CALLS and EXPANSION

    )Macro Expansion(

    MACRO CALL

    bodyMDT.

    PASS 2:

    diagram Pass 2)4.1(:

    -source card)Pass 1.(

    -MNToperation code.

    -MACRO.

    - (MDTIndex

    MDT Index MNT(Index

    MDT)(MDTP.

  • 8/7/2019 lect7_

    4/12

    4

    Index Name MDT Index

    .

    .

    .

    3

    .

    .

    .

    .

    .

    .

    INCR

    .

    .

    .

    .

    .

    .

    15

    .

    .

    .

    (MNT)

    Index Card

    .

    1516

    17

    18

    19

    .

    .

    ..

    MACRO BODY.

    .

    .

    (MDT) )(

  • 8/7/2019 lect7_

    5/12

    5

    (1)

    (2)

    (3)

    (4)

    (5)

    (6)

    (7)

    (8)

    (9)(10)

    (11)

    (12)

  • 8/7/2019 lect7_

    6/12

    6

    : Macro Processor

    Macro

    source program

    source program Assembler

    object program:

    -object programvalues

    ()RAMaddresses

    .

    -three operationsobject program:

    -Loading.

    -Relocation, or Movement.

    -Linking.

    :object program.

    Sourceprogram

    MacroProcessor

    Source

    program

    After

    Macro

    Expansion

    Assembler Objectprogram

  • 8/7/2019 lect7_

    7/12

    7

    :object programaddress.

    :

    :

    Loader

    ))LoadingObject program

    .

    Object program Memory

    Address 0

    Move to

    Object program Memory at specified address

    Move to

    (a)

    (b)

    Program 1

    (c)

    Program 2 Program n

  • 8/7/2019 lect7_

    8/12

    8

    Loaders Types

    :

    Absolute LoadersDirect-Linking Loaders.

    :Loader

    :-

    -Allocation:

    .

    address 0000

    address

    2100 bytes)a(:

    )(

    .

    .

    A

    .

    .

    A

    .

    .

    .

    .

    .

    0000

    21003000

    5100A

    (a) (b)

  • 8/7/2019 lect7_

    9/12

    9

    -)Relocation:(.

    address 3000

    5100

    )b.(

    address

    2100

    :

    Assembler Loader

    3000

    .

    -Linking:. A, B

    :

  • 8/7/2019 lect7_

    10/12

    10

    )(

    -Loading:.

    - :object program

    .

    -

    .

    (B)

    Loader

    Databases

    (A)

    (A)

    (B)

  • 8/7/2019 lect7_

    11/12

    11

    ))Absolute Loader

    .

    :

    )(

    Assembler

    :.

    Loader

    Object

    Program 1Object

    programsready for

    execution

    Loader

    Object

    Program 2

  • 8/7/2019 lect7_

    12/12

    12

    - Assembler address

    .

    - subroutines

    address addresslinksubroutine.